[PATCH v2] man/man2/perf_event_open.2: Clarify that exclude_kernel does not affect time_running

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alex,

Thanks for the guidance.

I've done my best to incorporate your feedback in the updated patch below.

> Have a lovely day!
You as well! Thanks

Cody

---
The goal of this patch is to clarify some limitations regarding re-scaled event
counts measured via perf_event_open.

The man page recommends re-scaling event counts as (value * time_enabled
/ time_running), but does not mention that some time-filters (esp.
exclude_kernel and exclude_user) do not affect the reported time_enabled or
time_running, sometimes causing a very noisy estimate of the true event count.

This limitation is easy to encounter when profiling events that are dominated
by kernel (>= 50%) vs. user time and which are relatively short compared to
the PMU muxing frequency (~several milliseconds, on my machine). In those
cases, it is common to see (time_running / time_enabled) report, e.g., ~50%
active time when perhaps almost none of the user time was actually spent
with the counter running, leading to a dramatic under-estimate of the event
counts.

Signed-off-by: Cody Tapscott <cody@xxxxxxxxxxx>
---
 man/man2/perf_event_open.2 | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/man/man2/perf_event_open.2 b/man/man2/perf_event_open.2
index bcc6a39cb..bc22a3b12 100644
--- a/man/man2/perf_event_open.2
+++ b/man/man2/perf_event_open.2
@@ -1063,9 +1063,22 @@ .SS Arguments
 .TP
 .I exclude_user
 If this bit is set, the count excludes events that happen in user space.
+.IP
+Note this does not affect the
+.I time_running
+or
+.I time_enabled
+fields, so enabling this may impact the reliability of the estimated
total counts in the presence of multiplexing.
 .TP
 .I exclude_kernel
 If this bit is set, the count excludes events that happen in kernel space.
+.IP
+Note this does not affect the
+.I time_running
+or
+.I time_enabled
+fields,
+so enabling this may impact the reliability of the estimated total
counts in the presence of multiplexing.
 .TP
 .I exclude_hv
 If this bit is set, the count excludes events that happen in the
@@ -1677,6 +1690,16 @@ .SS Reading results
 and
 .I time running
 values can be used to scale an estimated value for the count.
+.IP
+Note that for most events these values are not affected by
+.IR exclude_hv ,
+.IR exclude_idle ,
+.IR exclude_user ,
+or
+.I exclude_kernel
+and,
+if these are enabled,
+the scaled estimate may be significantly less reliable in the
presence of multiplexing.
 .TP
 .I value
 An unsigned 64-bit value containing the counter result.
--
2.34.1




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux