Thread (7 messages) flat view 7 messages, 2 authors, 2025-07-16

Re: [PATCH v3 01/17] tools/rv: Do not skip idle in trace

From: Gabriele Monaco <gmonaco@redhat.com>
Date: 2025-07-16 13:13:49
Also in: lkml

On Wed, 2025-07-16 at 15:08 +0200, Peter Zijlstra wrote:
quoted
quoted
quoted
quoted
quoted
-	if (config_has_id && (config_my_pid == id))
+	if (config_my_pid && config_has_id &&
(config_my_pid == id))
But should we then not write:

	if (config_has_id && (config_my_pid == id))
Sorry, got a bit confused, I flipped the two while describing:
* -s shows traces from RV but skips from pid-0 (unintended)
* omitting -s skips events from RV (correct)

If we are running a per-task monitor config_has_id is always true,
we pass -s,
which makes config_my_pid = 0 (intended /not/ to skip RV).
Now when we are about to trace an event from idle (id=0), we skip
it, although
we really shouldn't.
That's why we also needs to check for config_my_pid not being 0.

Does it make sense?
Sorta, but would it not make sense to use has_pid := -1 for the
invalid case, instead of 0, which is a valid pid?
Yeah that's another option, I reckon even cleaner since it's currently
misleading..
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help