Re: [PATCH V4 10/11] perf intel-pt: Add documentation for pause / resume

From: Adrian Hunter
Date: Mon Jan 22 2024 - 05:07:44 EST


On 19/01/24 23:28, Namhyung Kim wrote:
> Hello,
>
> On Tue, Jan 16, 2024 at 4:22 AM Adrian Hunter <adrian.hunter@xxxxxxxxx> wrote:
>>
>> On 16/01/24 13:15, Andi Kleen wrote:
>>> Adrian Hunter <adrian.hunter@xxxxxxxxx> writes:
>>>> +
>>>> +For example, to trace only the uname system call (sys_newuname) when running the
>>>> +command line utility uname:
>>>> +
>>>> + $ perf record --kcore -e
>>>> intel_pt/aux-action=start-paused/k,syscalls:sys_enter_newuname/aux-action=resume/,syscalls:sys_exit_newuname/aux-action=pause/
>>>> uname
>>>
>>> It's unclear if the syntax works for hardware break points, kprobes, uprobes too?
>>
>> Yes, the perf tool syntax requires only that the group leader is
>> an AUX area event like intel_pt. Note that an attempt is made to
>> automatically group AUX area events with events with aux-action,
>> so grouping syntax like '{...}' is not always necessary.
>
> Depends on the position, right? Maybe there can be other events
> without aux-action mixed with aux events.

Yes it depends on position. Non-grouped events in between will get
grouped too. So:

-e intel_pt --filter=blah -e not_grouped_event -e some_event/aux-action=resume/

would put those 3 in a group, but still allow --filter.

>
> Thanks,
> Namhyung
>
>>
>> Note the current kernel implementation is called from
>> __perf_event_output() which is used in nearly all cases for the
>> output of samples, the exceptions being Intel BTS (which we do not
>> support at the same time as Intel PT, but wouldn't make much sense
>> anyway) and S390 cpumsf_output_event_pid().
>>
>>> That would be most useful. If it works would be good to add examples for it.
>>
>> OK
>>