Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1432281rdb; Fri, 16 Feb 2024 16:25:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXFABRgXjpu0pok5xXFgL9RxbonZDPA6U21NygbVDFHSRN+Bz8UVgWviPGRxvm3+jgVIIMYWzcultUGpuSL1QO19PW9rtrM3Wb1yK8QDQ== X-Google-Smtp-Source: AGHT+IH+p2dx+WZnBfB46ovQDtfgzw4m9TG2of4zW3m7wARNQ1w/U/kPml5RKSYyvF+mzNH39wpQ X-Received: by 2002:a05:6358:d18:b0:176:40fb:e123 with SMTP id v24-20020a0563580d1800b0017640fbe123mr7270203rwj.5.1708129531362; Fri, 16 Feb 2024 16:25:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708129531; cv=pass; d=google.com; s=arc-20160816; b=zXc+SQe6zkYgGnd2p/HTPRYRYxmdoYxW5clCNBggrXwib4bM2IE0o3Y//XaLSbVpjG 9yqBU9WwtJ5RjtguxhA2PBioM66aYiDLEpIZZtKIrxFe/CXfoyaNtZBPeiqgW3Jk040Y B787M5OXQcweAjDZb40WHsWKFU1Ex2gJ2N/H9T6+9MVPAOwzubX7oAwPQq9U7ycoZhfL o6OhcGH+GqVfjWzu/3rnbGvY7z20ZxW5sN+UUjVtSk5TmYag73jLSeEGYsxoT2wYafZK cyu4M2MguAIppegbb6XDMMaY51f0f8U5ZfE2i6j8PEMeFMzk3QcLfgTG6irxbMlfKwxw lAjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=e5nHitY2bHlFsKUV8Hcu5r1EP9s4BPQyRji7f+MdFDc=; fh=newNMRy7keZ0y5w0/Wd6Bbu+mKaa9TfuMVeTvbgjwiY=; b=MwNkjUmELrMGmiOBnH2DVvusDUdA0VqxVdd10iSl9s7PcGVNhFn9trpIGgojse2nIL 5TZnF750lKZ6K+c+egomuNQUb53nopblMk45A4BOqlj69uIN+YFgBTQrOoZu4l1ePvgu x1SAAkE67skgGJ0i2fcrISVSV7l/Vglf6zTGzqkrz1Fh9CHjWogCd/1zNRu5Lc3z1Wfm WygmmPSTT5uFffEesRFskrgPFyAZ+1eMYbg48FCzB58GR3mS4HSIL5dmpLnJprgdRrIy nxIUfwUPnU0AzTQwQ5AZToIJhv6ibJUQGh3+IDzaOtMm+9d+asd3EKRsIcw+vSYvk0Z/ kCpA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VdwPVcgb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-69521-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69521-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id oe9-20020a17090b394900b002992e934559si732238pjb.113.2024.02.16.16.25.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 16:25:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69521-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VdwPVcgb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-69521-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69521-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7A655B22701 for ; Sat, 17 Feb 2024 00:07:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E0604C66; Sat, 17 Feb 2024 00:07:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VdwPVcgb" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6351F802; Sat, 17 Feb 2024 00:07:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708128420; cv=none; b=dmEAqcFZ6Qdq7LZNFFHefPLbZr/0DwYCoe3HCCupoT9djHGRWccyahudvgaDvUav0rHiYEF7zRY8nrJVkJ50b0Fno7sCZXyKErl60OvO3WT1MTsz3/3EiOMpLu+A2bt3AkmLkXe1r5lyDUKbinGD3uUzh6hl38D4cktdNn0vmAM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708128420; c=relaxed/simple; bh=Obu3eb9mb41tU7o19CjGNQFxpVIGGPXO9igJxp99SbI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=frQ7seiuM4KrNxmJIAdYjsYB+LwhQG5Kt66sEj/NTLIl5hbnfuznLJFvRY2gr9kBUTzjwzOLJB/KKgAJRUTEgS74inhRpjDlPMsIFZXfJX5IzfvNNM9JL6a4J8cH8lDHZfoVwyQW7q7vKbiMNwXZWbTElEgzownG1P8n6K/CwjA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VdwPVcgb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84D67C433C7; Sat, 17 Feb 2024 00:06:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708128419; bh=Obu3eb9mb41tU7o19CjGNQFxpVIGGPXO9igJxp99SbI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VdwPVcgbE+Ufqw7cOjRjwy89sg2yYzpiCi1TSamCG3YKnazcBltY5MjPXIIDMmwtn i1QkLKPUq3zu75Ckdw16oyDWM+vNLnlRUfXVJTlNd9p/dFo85VvVrZpMon9WFo5nZQ oVD1MUZ+NTl3tOFlKSPhejpCvdH3OdK5BaNwsznpjEk/xFbi4/BmceN4dEszWB4kWJ m8MovT0xYT036VIHi8T6UQcMndzlaMVpQxP4dObHz8ACZlriHTHujEBvQcjItNpzT7 fYlEMoequeJwKEDfnT+8sNSL3pwt+T7BYxwQhBdZuKT+kKigTUd37dJWlnnhy8w2QI k4uQ86KDvQtbw== Date: Fri, 16 Feb 2024 16:06:58 -0800 From: Namhyung Kim To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] perf list: For metricgroup only list include description Message-ID: References: <20240216192044.119897-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 Thanks, Namhyung > > Signed-off-by: Ian Rogers > --- > 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 >