Skip to content

Commit

Permalink
Changes Applied
Browse files Browse the repository at this point in the history
  • Loading branch information
solo2abera committed Sep 15, 2023
1 parent c18752b commit fed7f40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions utils/xprof_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ typedef uintptr_t thread_id_t;
typedef std::string hostname_t;
typedef std::string thapi_function_name;
typedef uintptr_t thapi_device_id;
typedef uintptr_t thapi_domain_id;

// Represent a device and a sub device
typedef std::tuple<thapi_device_id, thapi_device_id> dsd_t;
Expand All @@ -58,6 +59,7 @@ typedef std::tuple<hostname_t, process_id_t, thread_id_t, thapi_device_id, thapi
hpt_device_function_name_t;
typedef std::tuple<hostname_t, process_id_t, thapi_device_id> hp_device_t;
typedef std::tuple<hostname_t, process_id_t, thapi_device_id, thapi_device_id> hp_dsd_t;
typedef std::tuple<hostname_t, process_id_t, thapi_device_id, thapi_domain_id> hp_ddomain_t;
typedef std::tuple<long, long> sd_t;
typedef std::tuple<thread_id_t, thapi_function_name, long> tfn_ts_t;
typedef std::tuple<thapi_function_name, long> fn_ts_t;
Expand Down
8 changes: 4 additions & 4 deletions xprof/btx_timeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static perfetto_uuid_t gen_perfetto_uuid() {
static perfetto_uuid_t get_parent_counter_track_uuid(timeline_dispatch_t *dispatch,
std::string hostname, uint64_t process_id, thapi_device_id did ) {
perfetto_uuid_t hp_uuid = 0;
auto [it, inserted] = timeline_dispatch_t->hp_device2countertracks.insert({{hostname, process_id, did}, hp_uuid});
auto [it, inserted] = dispatch->hp_device2countertracks.insert({{hostname, process_id, did}, hp_uuid});
auto &potential_uuid = it->second;
// Exists
if (!inserted)
Expand All @@ -71,7 +71,7 @@ static perfetto_uuid_t get_parent_counter_track_uuid(timeline_dispatch_t *dispat
}

static perfetto_uuid_t get_counter_track_uuuid(timeline_dispatch_t *dispatch,
std::unordered_map<hp_dsd_t, perfetto_uuid_t> &counter_tracks, const std::string track_name,
std::unordered_map<hp_ddomain_t, perfetto_uuid_t> &counter_tracks, const std::string track_name,
std::string hostname, uint64_t process_id, thapi_device_id did, thapi_domain_id domain) {
perfetto_uuid_t hp_dev_uuid = 0;
auto [it, inserted] = counter_tracks.insert({{hostname, process_id, did, domain}, hp_dev_uuid});
Expand Down Expand Up @@ -99,11 +99,11 @@ static perfetto_uuid_t get_counter_track_uuuid(timeline_dispatch_t *dispatch,
}
static perfetto_uuid_t get_frequency_track_uuuid(timeline_dispatch_t *dispatch, std::string hostname,
uint64_t process_id, thapi_device_id did, thapi_domain_id domain) {
return get_counter_track_uuuid(dispatch->hp_devs2frqtracks, "GPU Frequency", hostname, process_id, did, domain);
return get_counter_track_uuuid(dispatch, dispatch->hp_ddomain2frqtracks, "GPU Frequency", hostname, process_id, did, domain);
}
static perfetto_uuid_t get_power_track_uuuid(timeline_dispatch_t *dispatch, std::string hostname,
uint64_t process_id, thapi_device_id did, thapi_device_id domain) {
return get_counter_track_uuuid(dispatch, dispatch->hp2pwrtracks, dispatch->hp_devs2pwrtracks, "GPU Power", hostname, process_id, did, domain);
return get_counter_track_uuuid(dispatch, dispatch->hp_ddomain2pwrtracks, " GPU Power", hostname, process_id, did, domain);
}

static void add_event_frequency(timeline_dispatch_t *dispatch, std::string hostname,
Expand Down

0 comments on commit fed7f40

Please sign in to comment.