linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	James Clark <james.clark@linaro.org>, Xu Yang <xu.yang_2@nxp.com>,
	"Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
	Collin Funk <collin.funk1@gmail.com>,
	Howard Chu <howardchu95@gmail.com>,
	Weilin Wang <weilin.wang@intel.com>,
	Andi Kleen <ak@linux.intel.com>,
	"Dr. David Alan Gilbert" <linux@treblig.org>,
	Thomas Richter <tmricht@linux.ibm.com>,
	Tiezhu Yang <yangtiezhu@loongson.cn>,
	Gautam Menghani <gautam@linux.ibm.com>,
	Thomas Falcon <thomas.falcon@intel.com>,
	Chun-Tse Shao <ctshao@google.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v7 00/16] New perf ilist app
Date: Wed, 23 Jul 2025 16:24:17 -0300	[thread overview]
Message-ID: <aIE24fDAuIqDXX3h@x1> (raw)
In-Reply-To: <aIEzzt1f3UWDCAIw@x1>

On Wed, Jul 23, 2025 at 04:11:13PM -0300, Arnaldo Carvalho de Melo wrote:
> On Wed, Jul 23, 2025 at 04:08:55PM -0300, Arnaldo Carvalho de Melo wrote:
> > On Wed, Jul 23, 2025 at 11:00:18AM -0700, Namhyung Kim wrote:
> > > > I think there is some follow up for "make install" for scripts like
> > > > these, but I'm keen for the python API to move forward.
  
> > > I'll review the series today so that we can get some part of it, at
> > > least.  Basically I think we need a wrapper script like perf-ilist to
> > > run this easily (maybe with documentation).
 
> > I just tried, with the series applied:
 
> > root@number:~# perf ilist
> > perf: 'ilist' is not a perf-command. See 'perf --help'.
 
> > Did you mean this?
> > 	list
> > root@number:~#
 
> > Now trying to figure out why it is not running.
 
> So it is not wired up like 'perf archive', trying it directly:
 
> root@number:~# ~acme/git/perf-tools-next/tools/perf/python/ilist.py 
> Traceback (most recent call last):
>   File "/home/acme/git/perf-tools-next/tools/perf/python/ilist.py", line 11, in <module>
>     from textual import on
> ModuleNotFoundError: No module named 'textual'
> root@number:~#
 
> I thought there was some discussion about catching this exception and
> providing guidance, lemme try...

root@number:~# sudo dnf install python-textual
Updating and loading repositories:
 google-chrome                                        100% |   6.1 KiB/s |   1.3 KiB |  00m00s
 Copr repo for PyCharm owned by phracek               100% |   2.0 KiB/s |   2.1 KiB |  00m01s
 RPM Fusion for Fedora 42 - Nonfree - NVIDIA Driver   100% |   2.6 KiB/s |   2.5 KiB |  00m01s
 RPM Fusion for Fedora 42 - Nonfree - Steam           100% |   5.8 KiB/s |   2.4 KiB |  00m00s
 google-chrome                                        100% |   7.2 KiB/s |   3.2 KiB |  00m00s
 Copr repo for PyCharm owned by phracek               100% |  15.7 KiB/s |   4.8 KiB |  00m00s
Repositories loaded.
Package                           Arch    Version         Repository     Size
Installing:
 python3-textual                  noarch  1.0.0-1.fc42    fedora      6.6 MiB
Installing dependencies:
 python3-linkify-it-py            noarch  2.0.3-4.fc42    fedora    110.4 KiB
 python3-markdown-it-py           noarch  3.0.0-8.fc42    fedora    496.3 KiB
 python3-markdown-it-py+linkify   noarch  3.0.0-8.fc42    fedora      9.0 KiB
 python3-markdown-it-py+plugins   noarch  3.0.0-8.fc42    fedora      9.0 KiB
 python3-mdit-py-plugins          noarch  0.4.2-2.fc42    fedora    289.4 KiB
 python3-mdurl                    noarch  0.1.2-9.fc42    fedora     41.4 KiB
 python3-platformdirs             noarch  4.2.2-4.fc42    fedora    162.0 KiB
 python3-pygments                 noarch  2.18.0-4.fc42   fedora     10.6 MiB
 python3-rich                     noarch  13.9.4-2.fc42   fedora      2.5 MiB
 python3-uc-micro-py              noarch  1.0.3-4.fc42    fedora     13.1 KiB

Transaction Summary:
 Installing:        11 packages

Total size of inbound packages is 5 MiB. Need to download 5 MiB.
After this operation, 21 MiB extra will be used (install 21 MiB, remove 0 B).
Is this ok [y/N]: y
<SNIP>
[13/13] Installing python3-textual-0:1.0.0-1.fc42.noarch                                                                         100% |  10.1 MiB/s |   6.8 MiB |  00m01s
Complete!
root@number:~# ~acme/git/perf-tools-next/tools/perf/python/ilist.py 
╭────────────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────────╮
│ /home/acme/git/perf-tools-next/tools/perf/python/ilist.py:470 in compose                                                                                              │
│                                                                                                                                                                       │
│   467 │   │   │   return tree                                                                                                                                         │
│   468 │   │                                                                                                                                                           │
│   469 │   │   yield Header(id="header")                                                                                                                               │
│ ❱ 470 │   │   yield Horizontal(Vertical(metric_event_tree(), id="events"),                                                                                            │
│   471 │   │   │   │   │   │    Vertical(Label("event name", id="event_name"),                                                                                         │
│   472 │   │   │   │   │   │   │   │     Static("description", markup=False, id="event_descript                                                                        │
│   473 │   │   │   │   │   │   │   │     ))                                                                                                                            │
│                                                                                                                                                                       │
│ ╭───────────────────────────────────────────────── locals ─────────────────────────────────────────────────╮                                                          │
│ │ self = IListApp(title='Interactive Perf List', classes={'-dark-mode'}, pseudo_classes={'dark', 'focus'}) │                                                          │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                          │
│                                                                                                                                                                       │
│ /home/acme/git/perf-tools-next/tools/perf/python/ilist.py:433 in metric_event_tree                                                                                    │
│                                                                                                                                                                       │
│   430 │   │   │   """Create tree of PMUs and metricgroups with events or metrics under."""     ╭─────────── locals ────────────╮                                      │
│   431 │   │   │   tree: Tree[TreeValue] = Tree("Root", id="root")                              │ pmus = TreeNode('PMUs', None) │                                      │
│   432 │   │   │   pmus = tree.root.add("PMUs")                                                 │ tree = Tree(id='root')        │                                      │
│ ❱ 433 │   │   │   for pmu in perf.pmus():                                                      ╰───────────────────────────────╯                                      │
│   434 │   │   │   │   pmu_name = pmu.name().lower()                                                                                                                   │
│   435 │   │   │   │   pmu_node = pmus.add(pmu_name)                                                                                                                   │
│   436 │   │   │   │   try:                                                                                                                                            │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: module 'perf' has no attribute 'pmus'
root@number:~# 

Ok, that was with the 'python-perf3' rpm package on fedora 42, trying
with the new one...

root@number:~# export PYTHONPATH=/tmp/build/perf-tools-next/python
root@number:~# ~acme/git/perf-tools-next/tools/perf/python/ilist.py 

Cool stuff!

Lots of flashing lights! :-)

Interesting to quickly browse all those events, I like it.

I searched for "wakeup" and stumbled on ftrace:wakeup failures, but that
should be just a minor adjustment, some exception list:

root@number:~# ls -la /sys/kernel/tracing/events/ftrace/wakeup/
total 0
drwxr-xr-x. 1 root root 0 Jul 23 16:04 .
drwxr-xr-x. 1 root root 0 Jul 23 16:04 ..
-r--r-----. 1 root root 0 Jul 23 16:04 format
-r--r-----. 1 root root 0 Jul 23 16:19 hist
root@number:~# 
root@number:~# ls -la /sys/kernel/tracing/events/sched/sched_wakeup/
total 0
drwxr-xr-x. 1 root root 0 Jul 23 16:04 .
drwxr-xr-x. 1 root root 0 Jul 23 16:04 ..
-rw-r-----. 1 root root 0 Jul 23 16:19 enable
-rw-r-----. 1 root root 0 Jul 23 16:19 filter
-r--r-----. 1 root root 0 Jul 23 16:04 format
-r--r-----. 1 root root 0 Jul 23 16:19 hist
-r--r-----. 1 root root 0 Jul 23 16:04 id
-rw-r-----. 1 root root 0 Jul 23 16:19 trigger
root@number:~#

Do you know how to take text screen shots in textual?

Apart from the super minor nits, thanks for working on this:

Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>

- Arnaldo

  reply	other threads:[~2025-07-23 19:24 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-14 16:43 [PATCH v7 00/16] New perf ilist app Ian Rogers
2025-07-14 16:43 ` [PATCH v7 01/16] perf python: Add more exceptions on error paths Ian Rogers
2025-07-23 16:48   ` Arnaldo Carvalho de Melo
2025-07-23 18:12   ` Namhyung Kim
2025-07-23 18:21     ` Ian Rogers
2025-07-23 22:24       ` Ian Rogers
2025-07-14 16:43 ` [PATCH v7 02/16] perf jevents: Add common software event json Ian Rogers
2025-07-23 16:52   ` Arnaldo Carvalho de Melo
2025-07-23 18:24   ` Namhyung Kim
2025-07-23 22:34     ` Ian Rogers
2025-07-24  0:10       ` Namhyung Kim
2025-07-24  1:47         ` Ian Rogers
2025-07-24 16:58           ` Namhyung Kim
2025-07-14 16:43 ` [PATCH v7 03/16] perf parse-events: Remove non-json software events Ian Rogers
2025-07-24  0:20   ` Namhyung Kim
2025-07-14 16:43 ` [PATCH v7 04/16] perf tp_pmu: Factor existing tracepoint logic to new file Ian Rogers
2025-07-23 16:57   ` Arnaldo Carvalho de Melo
2025-07-14 16:43 ` [PATCH v7 05/16] perf tp_pmu: Add event APIs Ian Rogers
2025-07-23 18:57   ` Arnaldo Carvalho de Melo
2025-07-14 16:43 ` [PATCH v7 06/16] perf list: Remove tracepoint printing code Ian Rogers
2025-07-14 16:43 ` [PATCH v7 07/16] perf list: Skip ABI PMUs when printing pmu values Ian Rogers
2025-07-14 16:43 ` [PATCH v7 08/16] perf python: Improve the tracepoint function if no libtraceevent Ian Rogers
2025-07-14 16:43 ` [PATCH v7 09/16] perf python: Add basic PMU abstraction and pmus sequence Ian Rogers
2025-07-14 16:43 ` [PATCH v7 10/16] perf python: Add function returning dictionary of all events on a PMU Ian Rogers
2025-07-14 16:43 ` [PATCH v7 11/16] perf ilist: Add new python ilist command Ian Rogers
2025-07-21  7:32   ` Gautam Menghani
2025-07-21 13:41     ` Ian Rogers
2025-07-23 18:33   ` Falcon, Thomas
2025-07-23 21:33     ` Ian Rogers
2025-07-14 16:44 ` [PATCH v7 12/16] perf python: Add parse_metrics function Ian Rogers
2025-07-14 16:44 ` [PATCH v7 13/16] perf python: Add evlist metrics function Ian Rogers
2025-07-14 16:44 ` [PATCH v7 14/16] perf python: Add evlist compute_metric Ian Rogers
2025-07-14 16:44 ` [PATCH v7 15/16] perf python: Add metrics function Ian Rogers
2025-07-14 16:44 ` [PATCH v7 16/16] perf ilist: Add support for metrics Ian Rogers
2025-07-23 15:32 ` [PATCH v7 00/16] New perf ilist app Ian Rogers
2025-07-23 18:00   ` Namhyung Kim
2025-07-23 18:15     ` Ian Rogers
2025-07-23 19:08     ` Arnaldo Carvalho de Melo
2025-07-23 19:11       ` Arnaldo Carvalho de Melo
2025-07-23 19:24         ` Arnaldo Carvalho de Melo [this message]
2025-07-23 21:30           ` Ian Rogers

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=aIE24fDAuIqDXX3h@x1 \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=collin.funk1@gmail.com \
    --cc=ctshao@google.com \
    --cc=gautam@linux.ibm.com \
    --cc=howardchu95@gmail.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux@treblig.org \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=thomas.falcon@intel.com \
    --cc=tmricht@linux.ibm.com \
    --cc=weilin.wang@intel.com \
    --cc=xu.yang_2@nxp.com \
    --cc=yangtiezhu@loongson.cn \
    /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).