Re: [PATCH v2] coresight: etm4x: Fix PID tracing when perf is run in an init PID namespace

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

 



Hi Suzuki

On 21/10/2024 14:31, Suzuki K Poulose wrote:

Hi Julien


[...]

Unfortunately this is not safe. i.e., event->owner is not guaranteed to
be stable (even NULL or an invalid pointer) (e.g. kernel created events
or task exit raced event_start on another CPU).

I expected that event->owner was safe, but you are right. During my tests, I essentially attached an existing PID executed in an container (lxc), so I was not able to detect that race condition. I miss to re-validate all the other usage of CoreSight.

That said, one thing to note is that the ETM4x driver parses the event
config in each "event_start" call back, instead of doing once during the
event_init. If we move this to a onetime parsing at the event_init, with
additional checks in place (e.g, !is_kernel_event()), we may be able to
solve it.
Thanks for this suggestion, I will try this approach and provide a v3.

Regards,
Julien




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux