This adds two new counters modes:
- PMC_MODE_ST -- system-wide tracing
- PMC_MODE_TT -- thread virtual tracing
Four new PMC ioctl calls:
- LOG_KERNEL_MAP
Used to request kernel mappings to be send over pmc log. This is required in order to configure address ranges filter prior to starting system-wide PMC trace.
- THREAD_UNSUSPEND
Used to release the thread. As user thread can call mmap() any time, we put thread on suspend, then we ship mmap result over PMC log, so user can get idea about mapping location (for libc etc) and reconfigure PMC address ranges prior to thread execution.
- TRACE_READ
Used to get current fill of the trace buffers.
- TRACE_CONFIG
Used to reconfigure tracing address ranges after PMC allocation and prior starting PMC.
We now also create /dev/pmcX per each cpu core, so user can access trace buffers.
Example usage:
- pmctrace -u -e branches uname
- pmctrace -u -e branches -i libc.so.7 -f memset sleep 1
- sudo pmctrace -s -e branches -i kernel -f cpu_switch
Other parts of patch:
part 2
part 3
part 4
part 5
part 6
part 7
part 8
part 9
24.576MHz?