[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACT4Y+ZtFQdA+EkWfxkdt_6NU-u7BvARRuU6fZvxa+Kf_7g9SQ@mail.gmail.com>
Date: Fri, 7 Feb 2025 12:42:06 +0100
From: Dmitry Vyukov <dvyukov@...gle.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: irogers@...gle.com, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org, Arnaldo Carvalho de Melo <acme@...nel.org>
Subject: Re: [PATCH v5 6/8] perf report: Add --latency flag
On Fri, 7 Feb 2025 at 04:53, Namhyung Kim <namhyung@...nel.org> wrote:
>
> On Wed, Feb 05, 2025 at 05:27:45PM +0100, Dmitry Vyukov wrote:
> > Add record/report --latency flag that allows to capture and show
> > latency-centric profiles rather than the default CPU-consumption-centric
> > profiles. For latency profiles record captures context switch events,
> > and report shows Latency as the first column.
> >
> > Signed-off-by: Dmitry Vyukov <dvyukov@...gle.com>
> > Cc: Namhyung Kim <namhyung@...nel.org>
> > Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
> > Cc: Ian Rogers <irogers@...gle.com>
> > Cc: linux-perf-users@...r.kernel.org
> > Cc: linux-kernel@...r.kernel.org
> >
> > ---
> [SNIP]
> > +void perf_hpp__cancel_latency(void)
> > +{
> > + struct perf_hpp_fmt *fmt, *lat, *acc, *tmp;
> > +
> > + if (is_strict_order(field_order) || is_strict_order(sort_order))
> > + return;
>
> This also needs to be changed since you call setup_overhead even if you
> have a strict sort_order.
>
> For example, it's strange these two are different.
>
> With default sort order:
>
> $ perf record --latency -- ls /
>
> $ perf report --stdio
> ...
> # Overhead Command Shared Object Symbol
> # ........ ....... .................... ........................
> #
> 64.50% ls ld-linux-x86-64.so.2 [.] do_lookup_x
> 33.41% ls [kernel.kallsyms] [k] chacha_block_generic
> 2.00% perf-ex [kernel.kallsyms] [k] put_ctx
> 0.09% perf-ex [kernel.kallsyms] [k] native_write_msr
>
> Same sort order, but explicitly:
>
> $ perf report --stdio -s comm,dso,sym
> ...
> # Overhead Latency Command Shared Object Symbol
> # ........ ........ ....... .................... ........................
> #
> 64.50% 64.50% ls ld-linux-x86-64.so.2 [.] do_lookup_x
> 33.41% 33.41% ls [kernel.kallsyms] [k] chacha_block_generic
> 2.00% 2.00% perf-ex [kernel.kallsyms] [k] put_ctx
> 0.09% 0.09% perf-ex [kernel.kallsyms] [k] native_write_msr
>
> Maybe you want to cancel the latency field even if sort key is given
> (unless it has 'latency').
>
> Something like this?
Makes sense! Done in v6.
> ---8<---
> @@ -714,7 +715,9 @@ void perf_hpp__cancel_latency(void)
> {
> struct perf_hpp_fmt *fmt, *lat, *acc, *tmp;
>
> - if (is_strict_order(field_order) || is_strict_order(sort_order))
> + if (is_strict_order(field_order))
> + return;
> + if (is_strict_order(sort_order) && strstr(sort_order, "latency"))
> return;
>
> lat = &perf_hpp__format[PERF_HPP__LATENCY];
> ---8<---
>
> Thanks,
> Namhyung
>
> > +
> > + lat = &perf_hpp__format[PERF_HPP__LATENCY];
> > + acc = &perf_hpp__format[PERF_HPP__LATENCY_ACC];
> > +
> > + perf_hpp_list__for_each_format_safe(&perf_hpp_list, fmt, tmp) {
> > + if (fmt_equal(lat, fmt) || fmt_equal(acc, fmt))
> > + perf_hpp__column_unregister(fmt);
> > + }
> > +}
> > +
> > void perf_hpp__setup_output_field(struct perf_hpp_list *list)
> > {
> > struct perf_hpp_fmt *fmt;
Powered by blists - more mailing lists