On Tue, Nov 11, 2025 at 11:37:08AM +0000, Suzuki Kuruppassery Poulose wrote:
On 11/11/2025 10:18, Leo Yan wrote:
On Tue, Nov 11, 2025 at 09:43:13AM +0000, Suzuki Kuruppassery Poulose wrote:
[...]
if (!is_idle_task(current)) { if (config->ss_ctrl[i] || config->ss_pe_cmp[i]) config->ss_status[i] &= ~TRCSSCSRn_STATUS; }What happens when we do a system wide session and a CPU is running an idle task ?
For a system wide trace, the ETM device is enabled and disabled by the perf when the session start and finish.
During the session:
- If CPU off states are not enabled, nothing will happen in idle threads, as no CPU PM notifier will be invoked.
What is a CPU is running the idle task, when the system wide session is activated ?
Just makes clear: if a CPU running in idle task, and it controls ETM, it must be a CPU PM operation. Otherwise, it is no reason for idle thread to enable/disable ETM, no matter what the session mode is.
An edge case is in per-thread mode when switch between the profiled process and the idle thread, the ETM operations always occur in profiled process rather than idle threads.
Basing our decision to tune the ETM control on the "active task being idle" feels fragile to me. This is purely a decision under ETM driver, specific to the session you are dealing with. Thus having it in the "config" is preferred and is cleaner.
It is fine for me to use "config" method. Will spin in this way.
Thanks, Leo