Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
58 changes: 45 additions & 13 deletions src/controller/src/rocprofvis_controller_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <cstdint>
#include <cstring>
#include <set>
#include <algorithm>

namespace RocProfVis
{
Expand Down Expand Up @@ -128,6 +129,48 @@ Trace::GetMemoryManager(){
return m_mem_mgmt;
}

std::string
Trace::GetTrackName(rocprofvis_dm_track_t track_handle, uint64_t track_type)
{
std::string dm_track_name;
switch(track_type)
{
case kRocProfVisDmRegionMainTrack:
{
dm_track_name += rocprofvis_dm_get_property_as_charptr(
track_handle, kRPVDMTrackSubProcessNameCharPtr, 0);
break;
}
case kRocProfVisDmRegionSampleTrack:
{
dm_track_name += "Sampled ";
if (char* subprocess_name = rocprofvis_dm_get_property_as_charptr(
track_handle, kRPVDMTrackSubProcessNameCharPtr, 0))
{
std::string str(subprocess_name);
std::transform(str.begin(), str.end(), str.begin(), [](unsigned char c) {
return static_cast<char>(std::tolower(c));
});
dm_track_name += str;
}
break;
}
default:
{
dm_track_name += rocprofvis_dm_get_property_as_charptr(
track_handle, kRPVDMTrackCategoryEnumCharPtr, 0);
dm_track_name += ":";
dm_track_name += rocprofvis_dm_get_property_as_charptr(
track_handle, kRPVDMTrackMainProcessNameCharPtr, 0);
dm_track_name += ":";
dm_track_name += rocprofvis_dm_get_property_as_charptr(
track_handle, kRPVDMTrackSubProcessNameCharPtr, 0);
break;
}
}

return dm_track_name;
}

#ifdef JSON_TRACE_SUPPORT
rocprofvis_result_t Trace::LoadJson(char const* const filename) {
Expand Down Expand Up @@ -470,19 +513,8 @@ rocprofvis_result_t Trace::LoadRocpd(char const* const filename) {
new Track(type, track_id, dm_track_handle, this);
{
std::string dm_track_name =
rocprofvis_dm_get_property_as_charptr(
dm_track_handle,
kRPVDMTrackCategoryEnumCharPtr, 0);
dm_track_name += ":";
dm_track_name +=
rocprofvis_dm_get_property_as_charptr(
dm_track_handle,
kRPVDMTrackMainProcessNameCharPtr, 0);
dm_track_name += ":";
dm_track_name +=
rocprofvis_dm_get_property_as_charptr(
dm_track_handle,
kRPVDMTrackSubProcessNameCharPtr, 0);
GetTrackName(dm_track_handle, dm_track_type);

track->SetString(kRPVControllerTrackName, 0,
dm_track_name.c_str());

Expand Down
2 changes: 2 additions & 0 deletions src/controller/src/rocprofvis_controller_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ class Trace : public Handle
MemoryManager* GetMemoryManager();

private:
std::string GetTrackName(rocprofvis_dm_track_t track_handle, uint64_t track_type);

std::vector<Track*> m_tracks;
std::vector<Node*> m_nodes;
uint64_t m_id;
Expand Down
2 changes: 0 additions & 2 deletions src/model/src/database/rocprofvis_db_rocprof.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,6 @@ rocprofvis_dm_result_t RocprofDatabase::ReadTraceMetadata(Future* future)
ShowProgress(5, "Indexing tables", kRPVDbBusy, future);
CreateIndexes();



ShowProgress(10, "Load Information Tables", kRPVDbBusy, future);
LoadInformationTables(future);

Expand Down
2 changes: 1 addition & 1 deletion src/model/src/database/rocprofvis_db_sqlite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ rocprofvis_dm_result_t SqliteDatabase::ExecuteSQLQuery(DbInstance* db_instance,
std::string guid_str = GuidAt(db_instance->GuidIndex());
ReplaceAllSubstrings(query_str, "%GUID%", guid_str);
query = query_str.c_str();
int rc = Sqlite3Exec(conn, query, params->callback, params);
int rc = Sqlite3Exec(conn, query, params->callback, params);
if(rc != SQLITE_OK)
{
if (rc == SQLITE_ABORT)
Expand Down
8 changes: 4 additions & 4 deletions src/view/src/rocprofvis_timeline_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,17 +428,17 @@ TimelineView::Update()
if(m_data_provider.SetGraphIndex(m_reorder_request.track_id,
m_reorder_request.new_index))
{
std::vector<TrackGraph> m_graphs_reordered;
std::vector<TrackGraph> graphs_reordered;
TimelineModel& tlm = m_data_provider.DataModel().GetTimeline();
m_graphs_reordered.resize(tlm.GetTrackCount());
graphs_reordered.resize(tlm.GetTrackCount());
for(TrackGraph& graph : *m_graphs)
{
const TrackInfo* metadata =
tlm.GetTrack(graph.chart->GetID());
ROCPROFVIS_ASSERT(metadata);
m_graphs_reordered[metadata->index] = std::move(graph);
graphs_reordered[metadata->index] = std::move(graph);
}
*m_graphs = std::move(m_graphs_reordered);
*m_graphs = std::move(graphs_reordered);
}
}
// Rebuild the positioning map.
Expand Down
5 changes: 3 additions & 2 deletions src/view/src/rocprofvis_track_topology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ TrackTopology::UpdateTopology()
InfoTable::Cell{ process_info->environment, false } } }
};
m_topology.nodes[i].processes[j].header =
"[" + std::to_string(process_info->id) + "]";
process_info->command +
"(" + std::to_string(process_info->id) + ")";
const std::vector<uint64_t>& queue_ids = process_info->queue_ids;
m_topology.nodes[i].processes[j].queues.resize(queue_ids.size());
m_topology.nodes[i].processes[j].queue_header =
Expand Down Expand Up @@ -266,7 +267,7 @@ TrackTopology::UpdateTopology()
m_topology.nodes[i].processes[j].sampled_threads.resize(
sampled_thread_ids.size());
m_topology.nodes[i].processes[j].sampled_thread_header =
"Sample Threads (" +
"Sampled Threads (" +
std::to_string(sampled_thread_ids.size()) + ")";
for(int k = 0; k < sampled_thread_ids.size(); k++)
{
Expand Down