Gbaraldi/threadtrace2 (#724)
* Added first ATT API * Finalizing thread trace API * Fixing more rebase conflicts * Added codeobj disassembly sample * Fixing merge issues with rebase [2] * Adding ATT packets * Implemented thread trace intercept * Moved codeobj parser to same repo as rocprofiler * Moved thread trace to new API * Fixing merge conflicts * Fixing more merge conflicts * Adding thread trace packet reuse * Merged aql_profile_v2 headers * Linked ATT sample to aqlprofile * Updated decoder to include non-loaded codeobjs * Implemented ISA decoder into ATT sample * Added marker_id to vaddr * Updating aql_profile_v2 API to memcpy * Updating thread trace API to include 64bit markers. Using the result of ISA matching. * Added instruction type and cycles summary * Updated sample with selection of kernel by kernel_object * Added option to copy from memory kernels * Moved tool_data in thread_trace to dynamic alloc * Restoring hsa.cpp * Fixed ATT sample crash. General improvements. * Moved codeobj library to outside src/ * Updated license header * Moved codeobj_capture to camelcase * Solving some more merge conflicts * Update samples/advanced_thread_trace/CMakeLists.txt Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update samples/advanced_thread_trace/CMakeLists.txt Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update samples/code_object_isa_decode/CMakeLists.txt Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update source/lib/rocprofiler-sdk/thread_trace/CMakeLists.txt * Removing unused parameter check * Adding const to isEmpty * Removing unused warning * Adding libdw-dev to requirements * Running clang-format * Commenting out new aql calls * Clang format * Unused variable fix * Adding codeobj-decoder coverage * Commenting out threadtrace * Update samples/CMakeLists.txt Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * P * WOverloaded * Addressing clang-tidy * Virtual destructor on ttracer class * Corr id * Fixing code source format * Update CMakeLists.txt * Build fixes * Update source/lib/rocprofiler-sdk-codeobj/code_object_track.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix shadowing * Update CMakeLists.txt * Update samples/CMakeLists.txt Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ammar ELWazir <ammar.elwazir@amd.com> Co-authored-by: Ammar ELWazir <aelwazir@amd.com> Co-authored-by: Benjamin Welton <bewelton@amd.com>
This commit is contained in:
committed by
GitHub
parent
d2bad14bf6
commit
69b8a43dc6
@@ -122,7 +122,7 @@ TEST(aql_profile, construct_packets)
|
||||
LOG(WARNING) << fmt::format("Found Agent: {}", agent.get_hsa_agent().handle);
|
||||
auto metrics = rocprofiler::findDeviceMetrics(agent, {"SQ_WAVES"});
|
||||
ASSERT_EQ(metrics.size(), 1);
|
||||
AQLPacketConstruct(agent, metrics);
|
||||
CounterPacketConstruct(agent, metrics);
|
||||
}
|
||||
hsa_shut_down();
|
||||
}
|
||||
@@ -142,7 +142,7 @@ TEST(aql_profile, too_many_counters)
|
||||
{
|
||||
try
|
||||
{
|
||||
AQLPacketConstruct(agent, metrics);
|
||||
CounterPacketConstruct(agent, metrics);
|
||||
} catch(const std::exception& e)
|
||||
{
|
||||
EXPECT_NE(e.what(), nullptr) << e.what();
|
||||
@@ -163,9 +163,9 @@ TEST(aql_profile, packet_generation_single)
|
||||
ASSERT_GT(agents.size(), 0);
|
||||
for(const auto& [_, agent] : agents)
|
||||
{
|
||||
auto metrics = rocprofiler::findDeviceMetrics(agent, {"SQ_WAVES"});
|
||||
AQLPacketConstruct pkt(agent, metrics);
|
||||
auto test_pkt = pkt.construct_packet(rocprofiler::get_ext_table());
|
||||
auto metrics = rocprofiler::findDeviceMetrics(agent, {"SQ_WAVES"});
|
||||
CounterPacketConstruct pkt(agent, metrics);
|
||||
auto test_pkt = pkt.construct_packet(rocprofiler::get_ext_table());
|
||||
EXPECT_TRUE(test_pkt);
|
||||
}
|
||||
|
||||
@@ -183,14 +183,30 @@ TEST(aql_profile, packet_generation_multi)
|
||||
{
|
||||
auto metrics =
|
||||
rocprofiler::findDeviceMetrics(agent, {"SQ_WAVES", "TA_FLAT_READ_WAVEFRONTS"});
|
||||
AQLPacketConstruct pkt(agent, metrics);
|
||||
auto test_pkt = pkt.construct_packet(rocprofiler::get_ext_table());
|
||||
CounterPacketConstruct pkt(agent, metrics);
|
||||
auto test_pkt = pkt.construct_packet(rocprofiler::get_ext_table());
|
||||
EXPECT_TRUE(test_pkt);
|
||||
}
|
||||
|
||||
hsa_shut_down();
|
||||
}
|
||||
|
||||
class TestAqlPacket : public rocprofiler::hsa::CounterAQLPacket
|
||||
{
|
||||
public:
|
||||
TestAqlPacket(bool mallocd)
|
||||
: rocprofiler::hsa::CounterAQLPacket([](void* x) -> hsa_status_t {
|
||||
::free(x);
|
||||
return HSA_STATUS_SUCCESS;
|
||||
})
|
||||
{
|
||||
this->profile.output_buffer.ptr = malloc(sizeof(double));
|
||||
this->profile.command_buffer.ptr = malloc(sizeof(double));
|
||||
this->command_buf_mallocd = mallocd;
|
||||
this->output_buffer_malloced = mallocd;
|
||||
}
|
||||
};
|
||||
|
||||
TEST(aql_profile, test_aql_packet)
|
||||
{
|
||||
auto check_null = [](auto& val) {
|
||||
@@ -201,25 +217,12 @@ TEST(aql_profile, test_aql_packet)
|
||||
val.completion_signal.handle == null_val.completion_signal.handle;
|
||||
};
|
||||
|
||||
rocprofiler::hsa::AQLPacket test_pkt([](void* x) -> hsa_status_t {
|
||||
::free(x);
|
||||
return HSA_STATUS_SUCCESS;
|
||||
});
|
||||
TestAqlPacket test_pkt(true);
|
||||
EXPECT_TRUE(check_null(test_pkt.start)) << "Start packet not null";
|
||||
EXPECT_TRUE(check_null(test_pkt.stop)) << "Stop packet not null";
|
||||
EXPECT_TRUE(check_null(test_pkt.read)) << "Read packet not null";
|
||||
|
||||
// If this leaks, then AQLPacket is not freeing data correctly.
|
||||
test_pkt.profile.output_buffer.ptr = malloc(sizeof(double));
|
||||
test_pkt.profile.command_buffer.ptr = malloc(sizeof(double));
|
||||
test_pkt.command_buf_mallocd = true;
|
||||
test_pkt.output_buffer_malloced = true;
|
||||
|
||||
// test custom destructor as well
|
||||
rocprofiler::hsa::AQLPacket test_pkt2([](void* x) -> hsa_status_t {
|
||||
::free(x);
|
||||
return HSA_STATUS_SUCCESS;
|
||||
});
|
||||
test_pkt2.profile.output_buffer.ptr = malloc(sizeof(double));
|
||||
test_pkt2.profile.command_buffer.ptr = malloc(sizeof(double));
|
||||
// Why is this valid?
|
||||
TestAqlPacket test_pkt2(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user