Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better i915-perf / tracepoint tracking #65

Merged
merged 2 commits into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
i915-perf: highlight process when hovering GPU timeline element
Make it easier to see where is the process that scheduled this work.
  • Loading branch information
llandwerlin-intel committed Jul 6, 2021
commit 8910a4c8d454bfc3727ee30e12db424103a2e9a3
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