public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/2] Add procfs based memory and network tool events
@ 2026-01-04  1:17 Ian Rogers
  2026-01-04  1:17 ` [PATCH v1 1/2] perf tool_pmu: Add memory events Ian Rogers
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Ian Rogers @ 2026-01-04  1:17 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Jiri Olsa, Ian Rogers, Adrian Hunter, James Clark,
	Thomas Falcon, Thomas Richter, linux-perf-users, linux-kernel

Add events for memory use and network activity based on data readily
available in /prod/pid/statm, /proc/pid/smaps_rollup and
/proc/pid/net/dev. For example the network usage of chrome processes
on a system may be gathered with:
```
$ perf stat -e net_rx_bytes,net_rx_compressed,net_rx_drop,net_rx_errors,net_rx_fifo,net_rx_frame,net_rx_multicast,net_rx_packets,net_tx_bytes,net_tx_carrier,net_tx_colls,net_tx_compressed,net_tx_drop,net_tx_errors,net_tx_fifo,net_tx_packets -p $(pidof -d, chrome) -I 1000
     1.001023475                  0      net_rx_bytes
     1.001023475                  0      net_rx_compressed
     1.001023475         42,647,328      net_rx_drop
     1.001023475        463,069,152      net_rx_errors
     1.001023475                  0      net_rx_fifo
     1.001023475                  0      net_rx_frame
     1.001023475                  0      net_rx_multicast
     1.001023475    423,195,831,744      net_rx_packets
     1.001023475                  0      net_tx_bytes
     1.001023475                  0      net_tx_carrier
     1.001023475                  0      net_tx_colls
     1.001023475                  0      net_tx_compressed
     1.001023475                  0      net_tx_drop
     1.001023475                  0      net_tx_errors
     1.001023475                  0      net_tx_fifo
     1.001023475                  0      net_tx_packets
```

As the events are in the tool_pmu they can be used in metrics. The
json descriptions they are exposed in `perf list` and the events can
be seen in the python ilist application.

Note, if a process terminates then the count reading returns an error
and this can expose what appear to be latent bugs in the aggregation
and display code.

Ian Rogers (2):
  perf tool_pmu: Add memory events
  perf tool_pmu: Add network events

 tools/perf/builtin-stat.c                     |  10 +-
 .../pmu-events/arch/common/common/tool.json   | 266 ++++++++-
 tools/perf/pmu-events/empty-pmu-events.c      | 312 +++++++----
 tools/perf/util/tool_pmu.c                    | 514 +++++++++++++++++-
 tools/perf/util/tool_pmu.h                    |  44 ++
 5 files changed, 1026 insertions(+), 120 deletions(-)

-- 
2.52.0.351.gbe84eed79e-goog


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-01-15  5:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-04  1:17 [PATCH v1 0/2] Add procfs based memory and network tool events Ian Rogers
2026-01-04  1:17 ` [PATCH v1 1/2] perf tool_pmu: Add memory events Ian Rogers
2026-01-04  1:17 ` [PATCH v1 2/2] perf tool_pmu: Add network events Ian Rogers
2026-01-04  1:21 ` [PATCH v1 0/2] Add procfs based memory and network tool events Ian Rogers
2026-01-07  8:08 ` Namhyung Kim
2026-01-07 19:03   ` Ian Rogers
2026-01-12 16:50 ` Andi Kleen
2026-01-12 18:08   ` Ian Rogers
2026-01-15  5:00     ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox