All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] perf list: For metricgroup only list include description
Date: Fri, 16 Feb 2024 16:06:58 -0800	[thread overview]
Message-ID: <Zc_4orTDBzUC6cMM@google.com> (raw)
In-Reply-To: <20240216192044.119897-1-irogers@google.com>

On Fri, Feb 16, 2024 at 11:20:44AM -0800, Ian Rogers wrote:
> If perf list is invoked with 'metricgroups' include the description
> unless it is invoked with flags to exclude it. Make the description of
> metricgroup dumping dependent on the desc flag in print_state as with
> metrics.
> 
> Before:
> ```
> $ perf list metricgroups
> List of pre-defined events (to be used in -e or -M):
> 
> Metric Groups:
> 
> Backend
> Bad
> BadSpec
> ...
> ```
> 
> After:
> ```
> $ perf list metricgroups
> List of pre-defined events (to be used in -e or -M):
> 
> Metric Groups:
> 
> Backend [Grouping from Top-down Microarchitecture Analysis Metrics spreadsheet]
> Bad [Grouping from Top-down Microarchitecture Analysis Metrics spreadsheet]
> BadSpec
> ...
> ```

When I run `perf list` and look at the Metric Groups:

  Metric Groups:
  
  Backend: [Grouping from Top-down Microarchitecture Analysis Metrics spreadsheet]
    tma_core_bound
         [This metric represents fraction of slots where Core non-memory issues were of a bottleneck]
    tma_info_core_ilp
         [Instruction-Level-Parallelism (average number of uops executed when there is execution) per-core]
    tma_info_memory_l2mpki
         [L2 cache true misses per kilo instruction for retired demand loads]
    tma_memory_bound
         [This metric represents fraction of slots the Memory subsystem within the Backend was a bottleneck]
  
  Bad: [Grouping from Top-down Microarchitecture Analysis Metrics spreadsheet]
    tma_info_bad_spec_branch_misprediction_cost
         [Branch Misprediction Cost: Fraction of TMA slots wasted per non-speculative branch misprediction (retired JEClear)]
    tma_info_bad_spec_ipmisp_cond_ntaken
         [Instructions per retired mispredicts for conditional non-taken branches (lower number means higher occurrence rate)]
    tma_info_bad_spec_ipmisp_cond_taken
         [Instructions per retired mispredicts for conditional taken branches (lower number means higher occurrence rate)]
    ...
 
So this change aligns with the default behavior, so

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> 
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
> v2 rebases on top of perf-tools-next patch:
> 79bacb6ad73c perf list: Add output file option
> https://lore.kernel.org/r/20240124043015.1388867-3-irogers@google.com
> ---
>  tools/perf/builtin-list.c | 21 ++++++++++++++-------
>  1 file changed, 14 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
> index e27a1b1288c2..02bf608d585e 100644
> --- a/tools/perf/builtin-list.c
> +++ b/tools/perf/builtin-list.c
> @@ -208,17 +208,24 @@ static void default_print_metric(void *ps,
>  	if (!print_state->last_metricgroups ||
>  	    strcmp(print_state->last_metricgroups, group ?: "")) {
>  		if (group && print_state->metricgroups) {
> -			if (print_state->name_only)
> +			if (print_state->name_only) {
>  				fprintf(fp, "%s ", group);
> -			else if (print_state->metrics) {
> -				const char *gdesc = describe_metricgroup(group);
> +			} else {
> +				const char *gdesc = print_state->desc
> +					? describe_metricgroup(group)
> +					: NULL;
> +				const char *print_colon = "";
> +
> +				if (print_state->metrics) {
> +					print_colon = ":";
> +					fputc('\n', fp);
> +				}
>  
>  				if (gdesc)
> -					fprintf(fp, "\n%s: [%s]\n", group, gdesc);
> +					fprintf(fp, "%s%s [%s]\n", group, print_colon, gdesc);
>  				else
> -					fprintf(fp, "\n%s:\n", group);
> -			} else
> -				fprintf(fp, "%s\n", group);
> +					fprintf(fp, "%s%s\n", group, print_colon);
> +			}
>  		}
>  		zfree(&print_state->last_metricgroups);
>  		print_state->last_metricgroups = strdup(group ?: "");
> -- 
> 2.44.0.rc0.258.g7320e95886-goog
> 

  reply	other threads:[~2024-02-17  0:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 19:20 [PATCH v2] perf list: For metricgroup only list include description Ian Rogers
2024-02-17  0:06 ` Namhyung Kim [this message]
2024-02-21  2:00 ` Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zc_4orTDBzUC6cMM@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.