Support for libbfd (binary file descriptor) (#168)

- provides addr2line information for sampling
Bu işleme şunda yer alıyor:
Jonathan R. Madsen
2022-09-28 00:18:05 -05:00
işlemeyi yapan: GitHub
ebeveyn 19edd0d421
işleme 2ed818449f
7 değiştirilmiş dosya ile 52 ekleme ve 12 silme
+7 -2
Dosyayı Görüntüle
@@ -116,6 +116,8 @@ set(CMAKE_INSTALL_MESSAGE
mark_as_advanced(CMAKE_INSTALL_MESSAGE)
omnitrace_add_option(OMNITRACE_USE_CLANG_TIDY "Enable clang-tidy" OFF)
omnitrace_add_option(OMNITRACE_USE_BFD
"Enable BFD support (map call-stack samples to LOC)" ON)
omnitrace_add_option(OMNITRACE_USE_MPI "Enable MPI support" OFF)
omnitrace_add_option(OMNITRACE_USE_HIP "Enable HIP support" ON)
omnitrace_add_option(OMNITRACE_USE_PAPI "Enable HW counter support via PAPI" ON)
@@ -133,8 +135,11 @@ omnitrace_add_option(OMNITRACE_USE_OMPT "Enable OpenMP tools support" ON)
omnitrace_add_option(OMNITRACE_USE_PYTHON "Enable Python support" OFF)
omnitrace_add_option(OMNITRACE_BUILD_DYNINST "Build dyninst from submodule" OFF)
omnitrace_add_option(OMNITRACE_BUILD_LIBUNWIND "Build libunwind from submodule" ON)
omnitrace_add_option(OMNITRACE_BUILD_EXAMPLES "Enable building the examples" OFF)
omnitrace_add_option(OMNITRACE_BUILD_TESTING "Enable building the testing suite" OFF)
omnitrace_add_option(OMNITRACE_BUILD_EXAMPLES "Enable building the examples" OFF ADVANCED)
omnitrace_add_option(OMNITRACE_BUILD_TESTING "Enable building the testing suite" OFF
ADVANCED)
omnitrace_add_option(OMNITRACE_BUILD_DEBUG "Enable building with extensive debug symbols"
OFF ADVANCED)
omnitrace_add_option(OMNITRACE_CUSTOM_DATA_SOURCE "Enable custom data source" OFF
ADVANCED)
omnitrace_add_option(
+11
Dosyayı Görüntüle
@@ -23,6 +23,7 @@ omnitrace_add_interface_library(omnitrace-rocm-smi
omnitrace_add_interface_library(
omnitrace-rccl "Provides flags for ROCm Communication Collectives Library (RCCL)")
omnitrace_add_interface_library(omnitrace-mpi "Provides MPI or MPI headers")
omnitrace_add_interface_library(omnitrace-bfd "Provides Binary File Descriptor (BFD)")
omnitrace_add_interface_library(omnitrace-ptl "Enables PTL support (tasking)")
omnitrace_add_interface_library(omnitrace-papi "Enable PAPI support")
omnitrace_add_interface_library(omnitrace-ompt "Enable OMPT support")
@@ -40,6 +41,7 @@ set(OMNITRACE_EXTENSION_LIBRARIES
omnitrace::omnitrace-rocprofiler
omnitrace::omnitrace-rocm-smi
omnitrace::omnitrace-rccl
omnitrace::omnitrace-bfd
omnitrace::omnitrace-mpi
omnitrace::omnitrace-ptl
omnitrace::omnitrace-ompt
@@ -596,6 +598,9 @@ set(TIMEMORY_USE_OMPT
set(TIMEMORY_USE_PAPI
${OMNITRACE_USE_PAPI}
CACHE BOOL "Enable PAPI support in timemory" FORCE)
set(TIMEMORY_USE_BFD
${OMNITRACE_USE_BFD}
CACHE BOOL "Enable BFD support in timemory" FORCE)
set(TIMEMORY_USE_LIBUNWIND
ON
CACHE BOOL "Enable libunwind support in timemory")
@@ -707,6 +712,12 @@ target_link_libraries(
$<BUILD_INTERFACE:timemory::timemory-gotcha>
$<BUILD_INTERFACE:timemory::timemory-cxx-static>)
target_link_libraries(omnitrace-bfd INTERFACE $<BUILD_INTERFACE:timemory::timemory-bfd>)
if(OMNITRACE_USE_BFD)
omnitrace_target_compile_definitions(omnitrace-bfd INTERFACE OMNITRACE_USE_BFD)
endif()
# ----------------------------------------------------------------------------------------#
#
# PTL (Parallel Tasking Library) submodule
Sağlanmış
+1 -1
external/timemory alt modülü güncellendi: 59ac91b591...f95f257a7f
+1
Dosyayı Görüntüle
@@ -32,6 +32,7 @@ target_link_libraries(
$<BUILD_INTERFACE:omnitrace::omnitrace-compile-definitions>
$<BUILD_INTERFACE:omnitrace::omnitrace-perfetto>
$<BUILD_INTERFACE:omnitrace::omnitrace-timemory>
$<BUILD_INTERFACE:omnitrace::omnitrace-bfd>
$<BUILD_INTERFACE:omnitrace::omnitrace-mpi>
$<BUILD_INTERFACE:omnitrace::omnitrace-ptl>
$<BUILD_INTERFACE:omnitrace::omnitrace-hip>
+5 -3
Dosyayı Görüntüle
@@ -109,7 +109,7 @@ backtrace::description()
return "Records backtrace data";
}
std::vector<std::string>
std::vector<backtrace::entry_type>
backtrace::filter_and_patch(const std::vector<entry_type>& _data)
{
// check whether the call-stack entry should be used. -1 means break, 0 means continue
@@ -143,14 +143,16 @@ backtrace::filter_and_patch(const std::vector<entry_type>& _data)
return std::string{ _lbl }.replace(_pos, _dyninst.length(), "");
};
auto _ret = std::vector<std::string>{};
auto _ret = std::vector<entry_type>{};
for(const auto& itr : _data)
{
auto _name = tim::demangle(_patch_label(itr.name));
auto _use = _use_label(_name);
if(_use == -1) break;
if(_use == 0) continue;
_ret.emplace_back(_name);
auto _v = itr;
_v.name = _name;
_ret.emplace_back(_v);
}
return _ret;
+1 -1
Dosyayı Görüntüle
@@ -70,7 +70,7 @@ struct backtrace
backtrace& operator=(const backtrace&) = default;
backtrace& operator=(backtrace&&) noexcept = default;
static std::vector<std::string> filter_and_patch(const std::vector<entry_type>&);
static std::vector<entry_type> filter_and_patch(const std::vector<entry_type>&);
static void start();
static void stop();
+26 -5
Dosyayı Görüntüle
@@ -606,6 +606,8 @@ post_process_perfetto(int64_t _tid, const bundle_t* _init,
tracing::push_perfetto_ts(category::sampling{}, "samples [omnitrace]", _beg_ns,
"begin_ns", _beg_ns);
auto _as_hex = [](auto _v) { return JOIN("", "0x", std::hex, _v); };
for(const auto& itr : _data)
{
const auto* _bt_ts = itr->get<backtrace_timestamp>();
@@ -617,13 +619,32 @@ post_process_perfetto(int64_t _tid, const bundle_t* _init,
static std::set<std::string> _static_strings{};
for(const auto& itr : backtrace::filter_and_patch(_bt_cs->get()))
{
const auto* _name = _static_strings.emplace(itr).first->c_str();
const auto* _name = _static_strings.emplace(itr.name).first->c_str();
uint64_t _beg = _last_ts;
uint64_t _end = _bt_ts->get_timestamp();
if(!_thread_info->is_valid_lifetime({ _beg, _end })) continue;
tracing::push_perfetto_ts(category::sampling{}, _name, _beg, "begin_ns",
_beg);
tracing::push_perfetto_ts(
category::sampling{}, _name, _beg, [&](perfetto::EventContext ctx) {
tracing::add_perfetto_annotation(ctx, "begin_ns", _beg);
tracing::add_perfetto_annotation(ctx, "file", itr.location);
tracing::add_perfetto_annotation(ctx, "pc", _as_hex(itr.address));
tracing::add_perfetto_annotation(ctx, "line_address",
_as_hex(itr.line_address));
if(itr.lineinfo)
{
size_t _n = 0;
for(const auto& litr : itr.lineinfo.lines)
{
auto _label = JOIN('-', "lineinfo", _n++);
tracing::add_perfetto_annotation(
ctx, _label.c_str(),
JOIN('@', demangle(litr.name),
JOIN(':', litr.location, litr.line)));
}
}
});
tracing::pop_perfetto_ts(category::sampling{}, _name, _end, "end_ns",
_end);
}
@@ -687,7 +708,7 @@ post_process_timemory(int64_t _tid, const bundle_t* _init,
// generate the instances of the tuple of components and start them
for(const auto& itr : backtrace::filter_and_patch(_bt_data->get()))
{
_tc.emplace_back(tim::string_view_t{ itr });
_tc.emplace_back(tim::string_view_t{ itr.name });
_tc.back().push(_bt_time->get_tid());
_tc.back().start();
}
@@ -761,7 +782,7 @@ post_process_timemory(int64_t _tid, const bundle_t* _init,
// generate the instances of the tuple of components and start them
for(const auto& itr : backtrace::filter_and_patch(_bt_data->get()))
{
_tc.emplace_back(tim::string_view_t{ itr });
_tc.emplace_back(tim::string_view_t{ itr.name });
_tc.back().push(_bt_time->get_tid());
_tc.back().start();
}