[rocprof-sys] Use fmt APIs to construct strings instead of JOIN (#2643)

## Motivation

With the introduction of the new logging system base on `spdlog` library, opportunity shows to replace `timemory` dependent JOIN implementation with `fmt` library `format` and `join` APIs, which are shipped as a part of `spdlog` lib

## Technical Details

Use `fmt` provided APIs to properly format and package strings.
This commit is contained in:
marantic-amd
2026-01-23 06:34:58 +01:00
committed by GitHub
vanhempi 3318c540ea
commit 956a73c4c8
38 muutettua tiedostoa jossa 356 lisäystä ja 357 poistoa
@@ -1411,13 +1411,14 @@ post_process_perfetto(int64_t _tid, const std::vector<timer_sampling_data>& _tim
_overflow_event.substr(_overflow_pos + _overflow_prefix.length());
const auto* _main_name =
static_strings.emplace(join(" ", _overflow_event, "samples [rocprof-sys]"))
static_strings
.emplace(fmt::format("{} samples [rocprof-sys]", _overflow_event))
.first->c_str();
auto _track = tracing::get_perfetto_track(
category::overflow_sampling{},
[](auto _seq_id, auto _sys_id) {
return TIMEMORY_JOIN(" ", "Thread", _seq_id, "Overflow", "(S)", _sys_id);
return fmt::format("Thread {} Overflow (S) {}", _seq_id, _sys_id);
},
_thread_info->index_data->sequent_value,
_thread_info->index_data->system_value);
@@ -1461,12 +1462,13 @@ post_process_perfetto(int64_t _tid, const std::vector<timer_sampling_data>& _tim
size_t _n = 0;
for(const auto& line : _lines)
{
auto _label = JOIN('-', "lineinfo", _n++);
auto _label = fmt::format("lineinfo-{}", _n++);
tracing::add_perfetto_annotation(
ctx, _label.c_str(),
JOIN('@',
rocprofsys::utility::demangle(line.name),
JOIN(':', line.location, line.line)));
fmt::format(
"{}@{}:{}",
rocprofsys::utility::demangle(line.name),
line.location, line.line));
}
}
}
@@ -1494,7 +1496,7 @@ post_process_perfetto(int64_t _tid, const std::vector<timer_sampling_data>& _tim
auto _track = tracing::get_perfetto_track(
category::timer_sampling{},
[](auto _seq_id, auto _sys_id) {
return TIMEMORY_JOIN(" ", "Thread", _seq_id, "(S)", _sys_id);
return fmt::format("Thread {} (S) {}", _seq_id, _sys_id);
},
_thread_info->index_data->sequent_value,
_thread_info->index_data->system_value);
@@ -1559,7 +1561,7 @@ post_process_perfetto(int64_t _tid, const std::vector<timer_sampling_data>& _tim
static_strings
.emplace(rocprofsys::utility::demangle(line.name))
.first->c_str();
auto _info = JOIN(':', line.location, line.line);
auto _info = fmt::format("{}:{}", line.location, line.line);
tracing::push_perfetto_track(
category::timer_sampling{}, _name, _track, _beg,
[&](::perfetto::EventContext ctx) {
@@ -1602,12 +1604,13 @@ post_process_perfetto(int64_t _tid, const std::vector<timer_sampling_data>& _tim
size_t _n = 0;
for(const auto& line : _lines)
{
auto _label = JOIN('-', "lineinfo", _n++);
auto _label = fmt::format("lineinfo-{}", _n++);
tracing::add_perfetto_annotation(
ctx, _label.c_str(),
JOIN('@',
rocprofsys::utility::demangle(line.name),
JOIN(':', line.location, line.line)));
fmt::format(
"{}@{}:{}",
rocprofsys::utility::demangle(line.name),
line.location, line.line));
}
}
}