On Tue, Jul 4, 2023 at 12:44 AM Yang Jihong <yangjihong1@xxxxxxxxxx> wrote:The actual application scenario is to perform perf records only for specified cores. However, during sampling, the system may create new processes and then migrate the processes between cores due to scheduling. If the processes run on the selected core, In this case, the perf report cannot parse symbols for these processes.
User space tasks can migrate between CPUs, we need to track side-band
events for all CPUs.
The specific scenarios are as follows:
CPU0 CPU1
perf record -C 0 start
taskA starts to be created and executed
-> PERF_RECORD_COMM and PERF_RECORD_MMAP
events only deliver to CPU1
......
|
migrate to CPU0
|
Running on CPU0 <----------/
...
perf record -C 0 stop
But I'm curious why you don't limit the task to run on the
specified CPUs only (using taskset).
Also, as you may know, you don't need to specify -C if you
want to profile specific tasks only. It'll open per-cpu, per-task
events and they will have all necessary info.
Yes, PERF_RECORD_COMM and PERF_RECORD_MMAP. There's a clerical error here...
Now perf samples the PC of taskA. However, perf does not record the
PERF_RECORD_COMM and PERF_RECORD_COMM events of taskA.
_COMM and _MMAP right?