diff --git a/src/gpuvis.cpp b/src/gpuvis.cpp index c3e21c4e..5923bf3f 100644 --- a/src/gpuvis.cpp +++ b/src/gpuvis.cpp @@ -737,7 +737,8 @@ static void add_sched_switch_pid_comm( trace_info_t &trace_info, const trace_eve static bool is_msm_timeline_event( const char *name ) { - return ( !strcmp( name, "msm_gpu_submit_flush" ) || + return ( !strcmp( name, "msm_gpu_submit" ) || + !strcmp( name, "msm_gpu_submit_flush" ) || !strcmp( name, "msm_gpu_submit_retired" ) ); } @@ -1960,7 +1961,7 @@ uint64_t TraceEvents::get_event_gfxcontext_hash( const trace_event_t &event ) { if ( is_msm_timeline_event( event.name ) ) { - return atoi( get_event_field_val( event, "seqno", "0" ) ); + return atoi( get_event_field_val( event, "id", "0" ) ); } if ( is_drm_sched_timeline_event( event ) ) @@ -2142,9 +2143,9 @@ void TraceEvents::init_msm_timeline_event( trace_event_t &event ) m_gfxcontext_locs.add_location_u64( gfxcontext_hash, event.id ); - event.flags |= TRACE_FLAG_TIMELINE; + const std::vector< uint32_t > *plocs = m_gfxcontext_locs.get_locations_u64( gfxcontext_hash ); - event.id_start = INVALID_ID; + event.flags |= TRACE_FLAG_TIMELINE; if ( !strcmp( event.name, "msm_gpu_submit_retired" ) ) { @@ -2155,17 +2156,18 @@ void TraceEvents::init_msm_timeline_event( trace_event_t &event ) event.flags |= TRACE_FLAG_HW_QUEUE; } - const std::vector< uint32_t > *plocs = m_gfxcontext_locs.get_locations_u64( gfxcontext_hash ); if ( plocs->size() > 1 ) { // First event. trace_event_t &event0 = m_events[ plocs->front() ]; + event0.flags |= TRACE_FLAG_SW_QUEUE; - // Assume the user comm is the first comm event in this set. - event.user_comm = event0.comm; + // Event right before the event we just added. + auto it = plocs->rbegin() + 1; + trace_event_t &event_prev = m_events[ *it ]; - // We shouldn't recycle seqnos in the same trace hopefully? - event.id_start = event0.id; + event.user_comm = event0.comm; + event.id_start = event_prev.id; } } diff --git a/src/trace-cmd/trace-read.cpp b/src/trace-cmd/trace-read.cpp index 41fb56d9..96deba0e 100644 --- a/src/trace-cmd/trace-read.cpp +++ b/src/trace-cmd/trace-read.cpp @@ -1677,6 +1677,8 @@ static void init_event_flags( trace_data_t &trace_data, trace_event_t &event ) event.flags |= TRACE_FLAG_FENCE_SIGNALED; else if ( strstr( event.name, "amdgpu_cs_ioctl" ) ) event.flags |= TRACE_FLAG_SW_QUEUE; + else if ( strstr( event.name, "msm_gpu_submit" ) ) + event.flags |= TRACE_FLAG_SW_QUEUE; else if ( strstr( event.name, "amdgpu_sched_run_job" ) ) event.flags |= TRACE_FLAG_HW_QUEUE; }