Skip to content

Commit

Permalink
i915-perf: highlight process when hovering GPU timeline element
Browse files Browse the repository at this point in the history
Make it easier to see where is the process that scheduled this work.
  • Loading branch information
llandwerlin-intel authored and mikesart committed Jul 7, 2021
1 parent 18fe54e commit 364e06e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/gpuvis.h
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ class I915PerfCounters
struct i915_perf_process {
const char *label;
ImU32 color;
const trace_event_t *event;
};

i915_perf_process get_process( const trace_event_t &event );
Expand Down
3 changes: 3 additions & 0 deletions src/gpuvis_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2555,6 +2555,9 @@ uint32_t TraceWin::graph_render_i915_perf_events( graph_info_t &gi )
if ( gi.mouse_pos_in_rect( { x0, y, x1 - x0, row_h } ) )
{
imgui_drawrect( x0, y, x1 - x0, row_h, s_clrs().get( col_Graph_BarSelRect ) );

gi.set_selected_i915_ringctxseq( *process.event );

gi.i915_perf_bars.push_back( event.id );

m_i915_perf.counters.set_event( event );
Expand Down
9 changes: 6 additions & 3 deletions src/gpuvis_i915_perfcounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,19 @@ I915PerfCounters::get_process( const trace_event_t &i915_perf_event )
i915_perf_process process;
process.label = "<unknown>";
process.color = i915_perf_event.color;
process.event = NULL;

uint32_t *req_event_id = m_trace_events->m_i915.perf_to_req_in.get_val( i915_perf_event.id );

if ( req_event_id )
{
const trace_event_t &req_event = m_trace_events->m_events[ *req_event_id ];
process.label = req_event.comm;
const trace_event_t *req_event = &m_trace_events->m_events[ *req_event_id ];
process.label = req_event->comm;
process.event = req_event;


const std::vector< uint32_t > *sched_plocs =
m_trace_events->get_sched_switch_locs( req_event.pid,
m_trace_events->get_sched_switch_locs( req_event->pid,
TraceEvents::SCHED_SWITCH_PREV );
if ( sched_plocs )
{
Expand Down

0 comments on commit 364e06e

Please sign in to comment.