linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>, Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-perf-users@vger.kernel.org,
	Kan Liang <kan.liang@linux.intel.com>,
	Zhengjun Xing <zhengjun.xing@linux.intel.com>,
	James Clark <james.clark@arm.com>,
	Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Subject: Re: [PATCHSET 00/19] perf stat: Improve perf stat output (v1)
Date: Tue, 15 Nov 2022 11:04:31 -0300	[thread overview]
Message-ID: <Y3Ocb2Ie4PCx2t1X@kernel.org> (raw)
In-Reply-To: <20221114230227.1255976-1-namhyung@kernel.org>

Em Mon, Nov 14, 2022 at 03:02:08PM -0800, Namhyung Kim escreveu:
> Hello,
> 
> I'm working on cleanup up the perf stat code.  The main focus this time
> is the display logic which has various combinations of options.
> 
> I split the code for each output mode - std, csv and json.  And then
> organize them according to the purpose like header, prefix, value,
> metric and footer.  I hope this would help maintaining the code a bit
> more.
> 
> Also I found that cgroup support is missing or insufficient.
> Specifically when --for-each-cgroup option is given, it'd have multiple
> copies of the events for those cgroups.  Then the output should group
> the result.  This is true for the normal output mode, but the metric-
> only mode didn't support it well.
> 
> With this change, I can see the per-cgroup topdown metrics like below:
> 
>   $ sudo ./perf stat -a --topdown --for-each-cgroup user.slice,system.slice sleep 3
>   nmi_watchdog enabled with topdown. May give wrong results.
>   Disable with echo 0 > /proc/sys/kernel/nmi_watchdog
> 
>    Performance counter stats for 'system wide':
> 
>                                   retiring      bad speculation   frontend bound    backend bound
>   S0-D0-C0      2  user.slice            117.3%         3.9%            47.8%           -69.1%
>   S0-D0-C1      2  user.slice            119.8%         4.1%            49.3%           -73.2%
>   S0-D0-C2      2  user.slice             24.4%         7.9%            68.4%             0.0%
>   S0-D0-C3      2  user.slice             24.0%         9.2%            91.2%           -24.4%
>   S0-D0-C0      2  system.slice           73.5%         4.0%            19.4%             3.1%
>   S0-D0-C1      2  system.slice           90.0%         5.8%            19.7%           -15.5%
>   S0-D0-C2      2  system.slice          101.2%         6.6%            33.4%           -41.1%
>   S0-D0-C3      2  system.slice           90.7%         4.9%            22.3%           -18.0%
> 
>          3.001678216 seconds time elapsed
> 
> You can get it from 'perf/stat-display-v1' branch in
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git

applied locally, build testing.

- Arnaldo
 
> Thanks,
> Namhyung
> 
> Namhyung Kim (19):
>   perf stat: Clear screen only if output file is a tty
>   perf stat: Split print_running() function
>   perf stat: Split print_noise_pct() function
>   perf stat: Split print_cgroup() function
>   perf stat: Split aggr_printout() function
>   perf stat: Factor out print_counter_value() function
>   perf stat: Handle bad events in abs_printout()
>   perf stat: Add before_metric argument
>   perf stat: Align cgroup names
>   perf stat: Split print_metric_headers() function
>   perf stat: Factor out prepare_interval()
>   perf stat: Cleanup interval print alignment
>   perf stat: Remove impossible condition
>   perf stat: Rework header display
>   perf stat: Move condition to print_footer()
>   perf stat: Factor out prefix display
>   perf stat: Factor out print_metric_{begin,end}()
>   perf stat: Support --for-each-cgroup and --metric-only
>   perf stat: Add print_aggr_cgroup() for --for-each-cgroup and --topdown
> 
>  tools/perf/builtin-stat.c      |   8 +
>  tools/perf/util/stat-display.c | 996 ++++++++++++++++++++-------------
>  2 files changed, 624 insertions(+), 380 deletions(-)
> 
> 
> base-commit: 7565f9617efac0c0c8e2dbd08dbe0695d56684f5
> -- 
> 2.38.1.493.g58b659f92b-goog

-- 

- Arnaldo

      parent reply	other threads:[~2022-11-15 14:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14 23:02 [PATCHSET 00/19] perf stat: Improve perf stat output (v1) Namhyung Kim
2022-11-14 23:02 ` [PATCH 01/19] perf stat: Clear screen only if output file is a tty Namhyung Kim
2022-11-14 23:02 ` [PATCH 02/19] perf stat: Split print_running() function Namhyung Kim
2022-11-14 23:02 ` [PATCH 03/19] perf stat: Split print_noise_pct() function Namhyung Kim
2022-11-14 23:02 ` [PATCH 04/19] perf stat: Split print_cgroup() function Namhyung Kim
2022-11-14 23:02 ` [PATCH 05/19] perf stat: Split aggr_printout() function Namhyung Kim
2022-11-14 23:02 ` [PATCH 06/19] perf stat: Factor out print_counter_value() function Namhyung Kim
2022-11-14 23:02 ` [PATCH 07/19] perf stat: Handle bad events in abs_printout() Namhyung Kim
2022-11-14 23:02 ` [PATCH 08/19] perf stat: Add before_metric argument Namhyung Kim
2022-11-14 23:02 ` [PATCH 09/19] perf stat: Align cgroup names Namhyung Kim
2022-11-14 23:02 ` [PATCH 10/19] perf stat: Split print_metric_headers() function Namhyung Kim
2022-11-14 23:02 ` [PATCH 11/19] perf stat: Factor out prepare_interval() Namhyung Kim
2022-11-14 23:02 ` [PATCH 12/19] perf stat: Cleanup interval print alignment Namhyung Kim
2022-11-14 23:02 ` [PATCH 13/19] perf stat: Remove impossible condition Namhyung Kim
2022-11-14 23:02 ` [PATCH 14/19] perf stat: Rework header display Namhyung Kim
2022-11-14 23:02 ` [PATCH 15/19] perf stat: Move condition to print_footer() Namhyung Kim
2022-11-14 23:02 ` [PATCH 16/19] perf stat: Factor out prefix display Namhyung Kim
2022-11-14 23:02 ` [PATCH 17/19] perf stat: Factor out print_metric_{begin,end}() Namhyung Kim
2022-11-14 23:02 ` [PATCH 18/19] perf stat: Support --for-each-cgroup and --metric-only Namhyung Kim
2022-11-14 23:02 ` [PATCH 19/19] perf stat: Add print_aggr_cgroup() for --for-each-cgroup and --topdown Namhyung Kim
2022-11-15 14:04 ` Arnaldo Carvalho de Melo [this message]

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=Y3Ocb2Ie4PCx2t1X@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=atrajeev@linux.vnet.ibm.com \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=zhengjun.xing@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).