Skip to content

trace cmd

Michael Sartain edited this page Sep 5, 2017 · 16 revisions

Capturing traces

Example trace-cmd command to capture a trace.dat file with amdgpu gpu information:

trace-cmd record -i \
    -p function \
    -e "sched:sched_switch" \
    -e "sched:sched_process_exec" \
    -e "sched:sched_process_fork" \
    -e "sched:sched_process_exit" \
    -e "amdgpu:amdgpu_vm_flush"  \
    -e "amdgpu:amdgpu_cs_ioctl"  \
    -e "amdgpu:amdgpu_sched_run_job"  \
    -e "drm:drm_vblank_event"  \
    -e "drm:drm_vblank_event_queued"  \
    -e "amdgpu:amdgpu_vm_flush" \
    -e "amdgpu:amdgpu_cs_ioctl" \
    -e "amdgpu:amdgpu_sched_run_job" \
    -e "amdgpu:amdgpu_ttm_bo_move" \
    -e "*fence:*fence_signaled"  \
    sleep 2

Note: amdgpu events require Linux kernel v4.12+

trace-cmd links

To capture tgid (thread group information), you will need this modified trace-cmd:

https://github.com/mikesart/trace-cmd

Several of the trace-cmd changes have been submitted upstream (waiting for merge):
[[https://www.mail-archive.com/[email protected]/msg1467935.html]]

Patches for tgid information will be submitted after above patches are accepted. Specifically, these add tgid information to the trace file:

* Add tgid support to trace record and report
* Read tgid info from procfs if saved_tgids file not found
* When saved_tgids file is empty, read tgid info from procfs

Gpuvis tgid screenshots

Thread group information in main gpuvis window

Thread group information in Info for 'trace.dat' (Under Options Menu)

Context Menu Item for hiding all rows for a tgid process

Clone this wiki locally