From: Ian Rogers Date: Fri, 15 Oct 2021 17:21:22 +0000 (-0700) Subject: perf metric: Document the internal 'struct metric' X-Git-Tag: v6.6.17~8887^2~67 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=485fcaed98ef1601fbab1cbec6dbbe4a4349d188;p=platform%2Fkernel%2Flinux-rpi.git perf metric: Document the internal 'struct metric' Add documentation as part of code tidying. Signed-off-by: Ian Rogers Acked-by: Andi Kleen Cc: Adrian Hunter Cc: Alexander Antonov Cc: Alexander Shishkin Cc: Andrew Kilroy Cc: Andrew Morton Cc: Changbin Du Cc: Denys Zagorui Cc: Fabian Hemmer Cc: Felix Fietkau Cc: Heiko Carstens Cc: Ingo Molnar Cc: Jacob Keller Cc: Jiapeng Chong Cc: Jin Yao Cc: Jiri Olsa Cc: Joakim Zhang Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kees Kook Cc: Mark Rutland Cc: Namhyung Kim Cc: Nicholas Fraser Cc: Nick Desaulniers Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Sami Tolvanen Cc: ShihCheng Tu Cc: Song Liu Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Thomas Richter Cc: Wan Jiabing Cc: Zhen Lei Link: https://lore.kernel.org/r/20211015172132.1162559-12-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c index c96f9fe..632867c 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -117,14 +117,34 @@ struct metric_ref_node { struct list_head list; }; +/** + * The metric under construction. The data held here will be placed in a + * metric_expr. + */ struct metric { struct list_head nd; + /** + * The expression parse context importantly holding the IDs contained + * within the expression. + */ struct expr_parse_ctx *pctx; + /** The name of the metric such as "IPC". */ const char *metric_name; + /** The expression to parse, for example, "instructions/cycles". */ const char *metric_expr; + /** + * The "ScaleUnit" that scales and adds a unit to the metric during + * output. + */ const char *metric_unit; + /** The list of metrics referenced by this one. */ struct list_head metric_refs; + /** The size of the metric_refs list. */ int metric_refs_cnt; + /** + * Is there a constraint on the group of events? In which case the + * events won't be grouped. + */ bool has_constraint; };