[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fUmH84ohUqzXOzG_msB08xf2cPqR=H2QQvXSo+SyMXBrw@mail.gmail.com>
Date: Sat, 3 Jan 2026 17:21:59 -0800
From: Ian Rogers <irogers@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>, Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>,
James Clark <james.clark@...aro.org>, Thomas Falcon <thomas.falcon@...el.com>,
Thomas Richter <tmricht@...ux.ibm.com>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 0/2] Add procfs based memory and network tool events
On Sat, Jan 3, 2026 at 5:17 PM Ian Rogers <irogers@...gle.com> wrote:
>
> 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.
I forgot to mention there are also other events that could be added.
For example, from /proc/self/status the signal information could be
useful as could voluntary vs involuntary context switch counts. What
is here is likely useful enough that a bigger patch series isn't
warranted.
Thanks,
Ian
> 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
>
Powered by blists - more mailing lists