Patch "perf metric: Return early if no CPU PMU table exists" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    perf metric: Return early if no CPU PMU table exists

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     perf-metric-return-early-if-no-cpu-pmu-table-exists.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d2725fc61d0846c110e6a0b5279193b84f509646
Author: Ian Rogers <irogers@xxxxxxxxxx>
Date:   Tue Aug 30 09:48:40 2022 -0700

    perf metric: Return early if no CPU PMU table exists
    
    [ Upstream commit 3f5df3ac646e21a79a421ae4037c4ef0632bcaa9 ]
    
    Previous behavior is to segfault if there is no CPU PMU table and a
    metric is sought. To reproduce compile with NO_JEVENTS=1 then request a
    metric, for example, "perf stat -M IPC true".
    
    Committer testing:
    
    Before:
    
      $ make -k NO_JEVENTS=1 BUILD_BPF_SKEL=1 O=/tmp/build/perf-urgent -C tools/perf install-bin
      $ perf stat -M IPC true
      Segmentation fault (core dumped)
      $
    
    After:
    
      $ perf stat -M IPC true
    
       Usage: perf stat [<options>] [<command>]
    
          -M, --metrics <metric/metric group list>
                                monitor specified metrics or metric groups (separated by ,)
      $
    
    Fixes: 00facc760903be66 ("perf jevents: Switch build to use jevents.py")
    Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
    Tested-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
    Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
    Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
    Cc: Caleb Biggers <caleb.biggers@xxxxxxxxx>
    Cc: Florian Fischer <florian.fischer@muhq.space>
    Cc: Ian Rogers <rogers.email@xxxxxxxxx>
    Cc: Ingo Molnar <mingo@xxxxxxxxxx>
    Cc: James Clark <james.clark@xxxxxxx>
    Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
    Cc: John Garry <john.garry@xxxxxxxxxx>
    Cc: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
    Cc: Kshipra Bopardikar <kshipra.bopardikar@xxxxxxxxx>
    Cc: Mark Rutland <mark.rutland@xxxxxxx>
    Cc: Miaoqian Lin <linmq006@xxxxxxxxx>
    Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
    Cc: Perry Taylor <perry.taylor@xxxxxxxxx>
    Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
    Cc: Stephane Eranian <eranian@xxxxxxxxxx>
    Cc: Thomas Richter <tmricht@xxxxxxxxxxxxx>
    Cc: Xing Zhengjun <zhengjun.xing@xxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220830164846.401143-3-irogers@xxxxxxxxxx
    Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
index 060454a172935..81b274aa81c18 100644
--- a/tools/perf/util/metricgroup.c
+++ b/tools/perf/util/metricgroup.c
@@ -1122,6 +1122,9 @@ int metricgroup__parse_groups(const struct option *opt,
 	if (!map)
 		return 0;
 
+	if (!table)
+		return -EINVAL;
+
 	return parse_groups(perf_evlist, str, metric_no_group,
 			    metric_no_merge, NULL, metric_events, map);
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux