linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org,
	Dmitry Vyukov <dvyukov@google.com>
Subject: Re: [PATCH 1/3] perf sort: Keep output fields in the same level
Date: Thu, 20 Mar 2025 10:32:39 +0100	[thread overview]
Message-ID: <Z9vgt1pjiNbDBDbM@gmail.com> (raw)
In-Reply-To: <Z9tjKcKvjYgbR6hb@google.com>


* Namhyung Kim <namhyung@kernel.org> wrote:

> On Fri, Mar 07, 2025 at 12:08:27AM -0800, Namhyung Kim wrote:
> > This is useful for hierarchy output mode where the first level is
> > considered as output fields.  We want them in the same level so that it
> > can show only the remaining groups in the hierarchy.
> > 
> > Before:
> >   $ perf report -s overhead,sample,period,comm,dso -H --stdio
> >   ...
> >   #          Overhead  Samples / Period / Command / Shared Object
> >   # .................  ..........................................
> >   #
> >      100.00%           4035
> >         100.00%           3835883066
> >            100.00%           perf
> >                99.37%           perf
> >                 0.50%           ld-linux-x86-64.so.2
> >                 0.06%           [unknown]
> >                 0.04%           libc.so.6
> >                 0.02%           libLLVM-16.so.1
> > 
> > After:
> >   $ perf report -s overhead,sample,period,comm,dso -H --stdio
> >   ...
> >   #    Overhead       Samples        Period  Command / Shared Object
> >   # .......................................  .......................
> >   #
> >      100.00%          4035    3835883066     perf
> >          99.37%          4005    3811826223     perf
> >           0.50%            19      19210014     ld-linux-x86-64.so.2
> >           0.06%             8       2367089     [unknown]
> >           0.04%             2       1720336     libc.so.6
> >           0.02%             1        759404     libLLVM-16.so.1
> > 
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> 
> Ping!  Anybody interested in this change? :)

Oh yes, all such pieces of intelligent organization of textual output 
of profiling data are worth their weight in gold in my book. :-)

  Acked-by: Ingo Molnar <mingo@kernel.org>

1)

On a related note, does anyone know why perf stat output alignment 
sucks so much these days:

  starship:~/tip> perf stat --null --repeat 20 perf stat --null --repeat 3 perf bench sched messaging 2>&1 | grep elapsed
           0.11620 +- 0.00327 seconds time elapsed  ( +-  2.81% )
          0.120813 +- 0.000570 seconds time elapsed  ( +-  0.47% )
          0.122280 +- 0.000443 seconds time elapsed  ( +-  0.36% )
          0.119813 +- 0.000752 seconds time elapsed  ( +-  0.63% )
           0.12190 +- 0.00134 seconds time elapsed  ( +-  1.10% )
          0.119862 +- 0.000542 seconds time elapsed  ( +-  0.45% )
          0.120075 +- 0.000608 seconds time elapsed  ( +-  0.51% )
          0.120350 +- 0.000273 seconds time elapsed  ( +-  0.23% )
           0.12203 +- 0.00114 seconds time elapsed  ( +-  0.93% )
           0.12229 +- 0.00114 seconds time elapsed  ( +-  0.93% )
           0.12032 +- 0.00115 seconds time elapsed  ( +-  0.95% )
          0.121241 +- 0.000463 seconds time elapsed  ( +-  0.38% )
          0.119404 +- 0.000333 seconds time elapsed  ( +-  0.28% )
          0.119945 +- 0.000766 seconds time elapsed  ( +-  0.64% )
          0.121215 +- 0.000879 seconds time elapsed  ( +-  0.72% )
           0.12001 +- 0.00109 seconds time elapsed  ( +-  0.91% )
           0.12193 +- 0.00182 seconds time elapsed  ( +-  1.49% )
          0.119184 +- 0.000794 seconds time elapsed  ( +-  0.67% )
          0.120062 +- 0.000439 seconds time elapsed  ( +-  0.37% )
          0.120834 +- 0.000760 seconds time elapsed  ( +-  0.63% )
          0.369473 +- 0.000992 seconds time elapsed  ( +-  0.27% )

... see how the vertical alignment of the output goes randomly wacko - 
I presume because there's a trailing zero in the output number and the 
code for some inexplicable reason decides to shorten it to make the 
life of developers harder? ;-)

2)

It's also incredibly hard to Ctrl-C a 'perf stat --repeat' instance:

 starship:~/tip> perf stat --null --repeat 20 perf stat --null --repeat 3 perf bench sched messaging
 # Running 'sched/messaging' benchmark:
 # 20 sender and receiver processes per group
 # 10 groups == 400 processes run

 ...
 Ctrl-C

 # Running 'sched/messaging' benchmark:
 perf: pollperf: perf: pollperf: pollpollperf: pollperf: pollperf: : Interrupted system call
 : Interrupted system call
 poll: Interrupted system call
 perf: pollperf: : Interrupted system call
 perf: pollperf: pollpollperf: : Interrupted system call
 pollperf: pollperf: perf: perf: pollpollpollperf: : Interrupted system call
 pollperf: poll: Interrupted system call
 : Interrupted system call
 : Interrupted system call
 : Interrupted system call
 perf: poll: Interrupted system call
 perf: perf: pollpoll: Interrupted system call
 : Interrupted system call
 perf: perf: perf: perf: perf: perf: : Interrupted system call
 pollpollpollpollpollpoll: Interrupted system call
 : Interrupted system call
 : Interrupted system call
 perf: perf: pollperf: perf: perf: perf: perf: perf: pollperf: : Interrupted system call
 pollpollpoll: Interrupted system call

Note how the perf stat instance actually *hangs*. I have to Ctrl-Z it, 
and kill -9 %1 it the hard way to clean up:

 pollpollpoll: Interrupted system call
 �
 [1]+  Stopped                 perf stat --null --repeat 20 perf stat --null --repeat 3 perf bench sched messaging
 starship:~/tip> kill -9 %1

 [1]+  Stopped                 perf stat --null --repeat 20 perf stat --null --repeat 3 perf bench sched messaging
 starship:~/tip> kill -9 %1

Does anyone use this thing for actual benchmarking work? ;-)

3)

It would also be nice to be able to Ctrl-C out of a 'perf top' instance 
that freezes the output or so. Or prints a snapshot in ASCII. Anything 
but what it does currently: it just exits and clears the xterm screen 
of all useful information...

I have to use 'f' (how many people know about that feature?) and copy & 
paste anything interesting from the screen the hard way.

4)

It would also be nice to have an export function to save current 'perf 
top' profiling data and have it available for 'perf report' et al 
analysis. Ie. frequently I just see an interesting snapshot and decide 
that it's good for further analysis, freeze the screen and are left 
with very few options to keep it for further look and reference.

5)

Would anyone be interested in an OpenGL-ish version of perf top, with 
its own low level shader for font-atlas based text output and vertex 
based polygon graphics, double buffering, full screen support with very 
little Xorg interaction for the GX pathway, etc? It should be *far* 
faster and lower overhead than the current ncurses->xterm->Wayland 
levels of indirection... and it could open up a new world of on-screen 
profiling information as well. Basically a very simple self-sustained 
OpenGL game engine for the key low level graphics primitives of modern 
GFX hardware. I could whip up a prototype if there's interest.

Thanks,

	Ingo

  reply	other threads:[~2025-03-20  9:32 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-07  8:08 [PATCH 1/3] perf sort: Keep output fields in the same level Namhyung Kim
2025-03-07  8:08 ` [PATCH 2/3] perf report: Allow hierarchy mode for --children Namhyung Kim
2025-03-07  8:08 ` [PATCH 3/3] perf report: Disable children column for data type profiling Namhyung Kim
2025-03-20  0:36 ` [PATCH 1/3] perf sort: Keep output fields in the same level Namhyung Kim
2025-03-20  9:32   ` Ingo Molnar [this message]
2025-03-20 16:16     ` Namhyung Kim
2025-03-24  7:28       ` Ingo Molnar
2025-03-25  0:26         ` Namhyung Kim
2025-04-04  9:41         ` [perf top] annotation doesn't work, libunwind doesn't seem to be working either Ingo Molnar
2025-04-04 17:28           ` Namhyung Kim
2025-04-04 18:13             ` Arnaldo Carvalho de Melo
2025-04-04 18:25               ` Arnaldo Carvalho de Melo
2025-04-04 18:40                 ` Arnaldo Carvalho de Melo
2025-04-05  9:06             ` Ingo Molnar
2025-04-05  9:09               ` Ingo Molnar
2025-04-07  6:02           ` Howard Chu
2025-04-07 16:58             ` Ingo Molnar
2025-04-07 17:04               ` Ingo Molnar
2025-04-08  0:54               ` Arnaldo Carvalho de Melo
2025-04-08  6:16                 ` Namhyung Kim
2025-04-09  3:26                   ` Arnaldo Carvalho de Melo
2025-04-10 20:48                     ` Namhyung Kim
2025-04-10 20:54                       ` Ingo Molnar
2025-04-24 12:37                       ` Arnaldo Carvalho de Melo
2025-04-08  8:05                 ` Ingo Molnar
2025-04-09  2:23                   ` Arnaldo Carvalho de Melo
2025-04-09 12:19                     ` Arnaldo Carvalho de Melo
2025-04-09 15:57                       ` Arnaldo Carvalho de Melo
2025-04-09 19:17                         ` Arnaldo Carvalho de Melo
2025-04-09 19:22                           ` Arnaldo Carvalho de Melo
2025-04-09 21:26                             ` Ingo Molnar
2025-04-10  1:38                               ` Arnaldo Carvalho de Melo
2025-04-10  6:24                                 ` Ingo Molnar
2025-04-10 14:03                                   ` Fixes for perf build system and TUI browsers was " Arnaldo Carvalho de Melo
2025-03-25  0:46     ` [PATCH 1/3] perf sort: Keep output fields in the same level Namhyung Kim
2025-03-30  5:54     ` Namhyung Kim
2025-03-21 18:30 ` 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=Z9vgt1pjiNbDBDbM@gmail.com \
    --to=mingo@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=dvyukov@google.com \
    --cc=irogers@google.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=namhyung@kernel.org \
    --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 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).