On Fri, Sep 6, 2024 at 11:26 AM Ian Forbes <ian.forbes@xxxxxxxxxxxx> wrote: > > On Thu, Sep 5, 2024 at 10:59 PM Zack Rusin <zack.rusin@xxxxxxxxxxxx> wrote: > > > > > > In general it looks good but what's the reason for the submit_time? > > > > z > > So you can get an approximate time of how long each command buffer takes. > You can then use it to construct a histogram or look for outliers > using bpftrace. > Useful when doing performance analysis to determine if slowdowns are being > caused by the host or the guest driver. > > $ sudo bpftrace -e 'tracepoint:vmwgfx:vmwgfx_cmdbuf_done{ > if(args->status == 1) { $elapsed =(jiffies - > args->header->submit_time); @exec_times = hist($elapsed); } }' > Attaching 1 probe... Can't you do the same with just: bpftrace -e 'kprobe:vmw_cmdbuf_header_submit { @start[tid] = nsecs; } kretprobe:vmw_cmdbuf_header_submit /@start[tid]/ { @ns[comm] = hist(nsecs - @start[tid]); delete(@start[tid]); }' Or kfunc/kretfunc if you want to condition it based on args->status? z