lkml.org 
[lkml]   [2023]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH RFC 1/5] perf: Add ioctl to emit sideband events
From
On 17/04/23 13:57, Peter Zijlstra wrote:
> On Fri, Apr 14, 2023 at 11:22:56AM +0300, Adrian Hunter wrote:
>> perf tools currently read /proc to get this information, but that
>> races with changes made by the kernel.
>>
>> Add an ioctl to output status-only sideband events for a currently
>> active event on the current CPU. Using timestamps, these status-only
>> sideband events will be correctly ordered with respect to "real"
>> sideband events.
>>
>> The assumption is a user will:
>> - open and enable a dummy event to track sideband events
>> - call the new ioctl to get sideband information for currently
>> running processes as needed
>> - enable the remaining selected events
>>
>> The initial sideband events to be supported will be: fork, namespaces, comm
>> and mmap.
>>
>> Add a new misc flag PERF_RECORD_MISC_STATUS_ONLY to differentiate "real"
>> sideband events from status-only sideband events.
>>
>> The limitation that the event must be active is significant. The ioctl
>> caller must either:
>> i) For a CPU context, set CPU affinity to the correct CPU.
>> Note, obviously that would not need to be done for system-wide
>> tracing on all CPUs. It would also only need to be done for the
>> period of tracing when the ioctl is to be used.
>> ii) Use an event opened for the current process on all CPUs.
>> Note, if such an additional event is needed, it would also use
>> additional memory from the user's perf_event_mlock_kb /
>> RLIMIT_MEMLOCK limit.
>
> Why would a single per-task event not work? I see nothing in the code
> that would require a per-task-per-cpu setup. Or am I just having trouble
> reading again?

Sorry, "all CPUS" should have been "cpu=-1"

\
 
 \ /
  Last update: 2023-04-18 08:31    [W:0.092 / U:1.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site