-
Notifications
You must be signed in to change notification settings - Fork 626
Open
Description
The ability to use frame pointer unwinding landed in ab3bf51. But as far as I can tell this still copies the user stack bytes and does the unwinding in user-land, which is slow (copies a lot of memory) and which leads to truncated stacks because it can only unwind the top 64KB of the stack.
perfetto/src/profiling/perf/event_config.cc
Lines 623 to 638 in 0ce5e90
| if (IsUserFramesEnabled(unwind_mode)) { | |
| pe.sample_type |= PERF_SAMPLE_STACK_USER | PERF_SAMPLE_REGS_USER; | |
| // PERF_SAMPLE_STACK_USER: | |
| // Needs to be < ((u16)(~0u)), and have bottom 8 bits clear. | |
| // Note that the kernel still needs to make space for the other parts of the | |
| // sample (up to the max record size of 64k), so the effective maximum | |
| // can be lower than this. | |
| pe.sample_stack_user = (1u << 16) - 256; | |
| // PERF_SAMPLE_REGS_USER: | |
| pe.sample_regs_user = | |
| PerfUserRegsMaskForArch(unwindstack::Regs::CurrentArch()); | |
| } | |
| if (kernel_frames) { | |
| pe.sample_type |= PERF_SAMPLE_CALLCHAIN; | |
| pe.exclude_callchain_user = true; | |
| } |
I would like to have a path which asks the kernel to do the unwinding of the user stack, i.e. which uses PERF_SAMPLE_CALLCHAIN, and which does not drop the user frames (exclude_callchain_user = false). This path would not set PERF_SAMPLE_STACK_USER, i.e. it would skip the copying of the stack bytes.
Could such a path be added? cc @LalitMaganti
Metadata
Metadata
Assignees
Labels
No labels