From 08e60ed15d0483be38a87d17538ccf02acff5b1f Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Thu, 15 Sep 2016 15:24:43 -0700 Subject: perf pmu: Support alias descriptions Add support to print alias descriptions in perf list, which are taken from the generated event files. The sorting code is changed to put the events with descriptions at the end. The descriptions are printed as possibly multiple word wrapped lines. Example output: % perf list ... arith.fpu_div [Divide operations executed] arith.fpu_div_active [Cycles when divider is busy executing divide operations] Committer notes: Further testing on a Broadwell machine (ThinkPad t450s), using these files: $ find tools/perf/pmu-events/arch/x86/ tools/perf/pmu-events/arch/x86/ tools/perf/pmu-events/arch/x86/Broadwell tools/perf/pmu-events/arch/x86/Broadwell/Cache.json tools/perf/pmu-events/arch/x86/Broadwell/Other.json tools/perf/pmu-events/arch/x86/Broadwell/Frontend.json tools/perf/pmu-events/arch/x86/Broadwell/Virtual-Memory.json tools/perf/pmu-events/arch/x86/Broadwell/Pipeline.json tools/perf/pmu-events/arch/x86/Broadwell/Floating-point.json tools/perf/pmu-events/arch/x86/Broadwell/Memory.json tools/perf/pmu-events/arch/x86/mapfile.csv $ Taken from: https://github.com/sukadev/linux/tree/json-code+data-v21/tools/perf/pmu-events/arch/x86/ to get this machinery to actually parse JSON files, generate $(OUTPUT)pmu-events/pmu-events.c, compile it and link it with perf, that will then use the table it contains, these files will be submitted right after this patchkit. [acme@jouet linux]$ perf list page_walker List of pre-defined events (to be used in -e): page_walker_loads.dtlb_l1 [Number of DTLB page walker hits in the L1+FB] page_walker_loads.dtlb_l2 [Number of DTLB page walker hits in the L2] page_walker_loads.dtlb_l3 [Number of DTLB page walker hits in the L3 + XSNP] page_walker_loads.dtlb_memory [Number of DTLB page walker hits in Memory] page_walker_loads.itlb_l1 [Number of ITLB page walker hits in the L1+FB] page_walker_loads.itlb_l2 [Number of ITLB page walker hits in the L2] page_walker_loads.itlb_l3 [Number of ITLB page walker hits in the L3 + XSNP] [acme@jouet linux]$ Signed-off-by: Andi Kleen Signed-off-by: Sukadev Bhattiprolu Acked-by: Ingo Molnar Acked-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Madhavan Srinivasan Cc: Peter Zijlstra Cc: linuxppc-dev@lists.ozlabs.org Link: http://lkml.kernel.org/r/1473978296-20712-7-git-send-email-sukadev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/pmu.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/perf/util/pmu.h') diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h index 743422ad900b..51d8d0d35e63 100644 --- a/tools/perf/util/pmu.h +++ b/tools/perf/util/pmu.h @@ -40,6 +40,7 @@ struct perf_pmu_info { struct perf_pmu_alias { char *name; + char *desc; struct list_head terms; /* HEAD struct parse_events_term -> list */ struct list_head list; /* ELEM */ char unit[UNIT_MAX_LEN+1]; -- cgit v1.2.3-59-g8ed1b