Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf stat: Remove print_mixed_hw_group_error

print_mixed_hw_group_error will print a warning when a group of events
uses different PMUs.

This isn't possible to happen as parse_events__sort_events_and_fix_groups()
will break groups when this happens, adding the warning at the start
of perf of:

WARNING: events were regrouped to match PMUs

As the previous mixed group warning can never happen, remove the
associated code.

Committer testing:

Before/after:

acme@five:~$ perf stat -e '{cpu_core/cycles/,cpu_atom/cycles/}' sleep 1
WARNING: events were regrouped to match PMUs

Performance counter stats for 'sleep 1':

424,895 cpu_atom/cycles/u
<not counted> cpu_core/cycles/u (0.00%)

1.011862314 seconds time elapsed

0.000000000 seconds user
0.003166000 seconds sys

acme@five:~$

Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Dominique Martinet <asmadeus@codewreck.org>
Cc: Dr. David Alan Gilbert <linux@treblig.org>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Levi Yun <yeoreum.yun@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Weilin Wang <weilin.wang@intel.com>
Link: https://lore.kernel.org/r/20250402201549.4090305-3-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
a5efaf90 4b531377

-32
-31
tools/perf/util/stat-display.c
··· 798 798 print_cgroup(config, os, evsel->cgrp); 799 799 } 800 800 801 - static bool is_mixed_hw_group(struct evsel *counter) 802 - { 803 - struct evlist *evlist = counter->evlist; 804 - u32 pmu_type = counter->core.attr.type; 805 - struct evsel *pos; 806 - 807 - if (counter->core.nr_members < 2) 808 - return false; 809 - 810 - evlist__for_each_entry(evlist, pos) { 811 - /* software events can be part of any hardware group */ 812 - if (pos->core.attr.type == PERF_TYPE_SOFTWARE) 813 - continue; 814 - if (pmu_type == PERF_TYPE_SOFTWARE) { 815 - pmu_type = pos->core.attr.type; 816 - continue; 817 - } 818 - if (pmu_type != pos->core.attr.type) 819 - return true; 820 - } 821 - 822 - return false; 823 - } 824 - 825 801 static bool evlist__has_hybrid_pmus(struct evlist *evlist) 826 802 { 827 803 struct evsel *evsel; ··· 862 886 if (counter->supported) { 863 887 if (!evlist__has_hybrid_pmus(counter->evlist)) { 864 888 config->print_free_counters_hint = 1; 865 - if (is_mixed_hw_group(counter)) 866 - config->print_mixed_hw_group_error = 1; 867 889 } 868 890 } 869 891 } ··· 1561 1587 " echo 0 > /proc/sys/kernel/nmi_watchdog\n" 1562 1588 " perf stat ...\n" 1563 1589 " echo 1 > /proc/sys/kernel/nmi_watchdog\n"); 1564 - 1565 - if (config->print_mixed_hw_group_error) 1566 - fprintf(output, 1567 - "The events in group usually have to be from " 1568 - "the same PMU. Try reorganizing the group.\n"); 1569 1590 } 1570 1591 1571 1592 static void print_percore(struct perf_stat_config *config,
-1
tools/perf/util/stat.h
··· 100 100 int times; 101 101 int run_count; 102 102 int print_free_counters_hint; 103 - int print_mixed_hw_group_error; 104 103 const char *csv_sep; 105 104 struct stats *walltime_nsecs_stats; 106 105 struct rusage ru_data;