perf stat: Remove print_mixed_hw_group_error
authorIan Rogers <irogers@google.com>
Wed, 2 Apr 2025 20:15:46 +0000 (13:15 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 8 May 2025 15:46:23 +0000 (12:46 -0300)
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>
tools/perf/util/stat-display.c
tools/perf/util/stat.h

index 1115efb380fb2bede268924989b8fe001bccb4d2..aab3697aed63a8a1e17d1add7df8eaeda3249db7 100644 (file)
@@ -798,30 +798,6 @@ static void abs_printout(struct perf_stat_config *config,
        print_cgroup(config, os, evsel->cgrp);
 }
 
-static bool is_mixed_hw_group(struct evsel *counter)
-{
-       struct evlist *evlist = counter->evlist;
-       u32 pmu_type = counter->core.attr.type;
-       struct evsel *pos;
-
-       if (counter->core.nr_members < 2)
-               return false;
-
-       evlist__for_each_entry(evlist, pos) {
-               /* software events can be part of any hardware group */
-               if (pos->core.attr.type == PERF_TYPE_SOFTWARE)
-                       continue;
-               if (pmu_type == PERF_TYPE_SOFTWARE) {
-                       pmu_type = pos->core.attr.type;
-                       continue;
-               }
-               if (pmu_type != pos->core.attr.type)
-                       return true;
-       }
-
-       return false;
-}
-
 static bool evlist__has_hybrid_pmus(struct evlist *evlist)
 {
        struct evsel *evsel;
@@ -886,8 +862,6 @@ static void printout(struct perf_stat_config *config, struct outstate *os,
                if (counter->supported) {
                        if (!evlist__has_hybrid_pmus(counter->evlist)) {
                                config->print_free_counters_hint = 1;
-                               if (is_mixed_hw_group(counter))
-                                       config->print_mixed_hw_group_error = 1;
                        }
                }
        }
@@ -1587,11 +1561,6 @@ static void print_footer(struct perf_stat_config *config)
 "      echo 0 > /proc/sys/kernel/nmi_watchdog\n"
 "      perf stat ...\n"
 "      echo 1 > /proc/sys/kernel/nmi_watchdog\n");
-
-       if (config->print_mixed_hw_group_error)
-               fprintf(output,
-                       "The events in group usually have to be from "
-                       "the same PMU. Try reorganizing the group.\n");
 }
 
 static void print_percore(struct perf_stat_config *config,
index 2fda9acd7374c11f097e5857533bff957ff1cbc5..1bcd7634bf479005c09a3ae4196b7eb08a43d613 100644 (file)
@@ -100,7 +100,6 @@ struct perf_stat_config {
        int                      times;
        int                      run_count;
        int                      print_free_counters_hint;
-       int                      print_mixed_hw_group_error;
        const char              *csv_sep;
        struct stats            *walltime_nsecs_stats;
        struct rusage            ru_data;