Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface proposal : pull request 5 #61

Open
wants to merge 22 commits into
base: rocm-4.3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0adba5c
Fix fine-grained control
yoann-heitz Sep 21, 2021
b4e487e
Add buffer for tracing KFD API
yoann-heitz Sep 21, 2021
a669e4a
Isolate flushing function for roctx
yoann-heitz Sep 21, 2021
bb24c82
Isolate flushing instructions for HSA activity
yoann-heitz Sep 21, 2021
f06ef8d
Isolate flushing instructions for HIP API
yoann-heitz Sep 22, 2021
035a498
Isolate flushing instructions for HIP activity
yoann-heitz Sep 22, 2021
77d23b6
Update HSA activity flushing function signature
yoann-heitz Sep 23, 2021
9b390bf
Update HIP activity (HCC ops) flushing function signature
yoann-heitz Sep 23, 2021
3787d72
Move roctx_trace_entry_t to a new header
yoann-heitz Sep 23, 2021
9d0dd89
Update CMakeLists to take into account the new header
yoann-heitz Sep 23, 2021
dccd171
Move hsa_api_trace_entry_t to roctracer_trace_entries.h
yoann-heitz Sep 23, 2021
5b06b80
Move hsa_activity_trace_entry_t to roctracer_trace_entries.h
yoann-heitz Sep 23, 2021
a73995f
Move hip_api_trace_entry_t to roctracer_trace_entries.h
yoann-heitz Sep 23, 2021
abbab33
Move hip_activity_trace_entry_t to roctracer_trace_entries.h
yoann-heitz Sep 23, 2021
b3a0781
Move kfd_api_trace_entry_t to roctracer_trace_entries.h
yoann-heitz Sep 23, 2021
0d36ffa
Add loading instructions for opening/closing output plugin
yoann-heitz Sep 24, 2021
6297eba
Add overloading instructions for rocTX
yoann-heitz Sep 24, 2021
bcd300c
Add overloading instructions for HSA API
yoann-heitz Sep 24, 2021
d7b88de
Add overloading instructions for HSA activity
yoann-heitz Sep 24, 2021
ffff6cb
Add overloading instructions for HIP API
yoann-heitz Sep 24, 2021
7a41a43
Add overloading instructions for HIP activity
yoann-heitz Sep 24, 2021
1cc010d
Add overloading instructions for KFD API
yoann-heitz Sep 24, 2021
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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ set ( PUBLIC_HEADERS
roctracer_kfd.h
roctracer_roctx.h
roctracer_cb_table.h
roctracer_trace_entries.h
ext/prof_protocol.h
ext/hsa_rt_utils.hpp
)
Expand Down
89 changes: 89 additions & 0 deletions inc/roctracer_trace_entries.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#ifndef INC_ROCTRACER_TRACE_ENTRIES_H_
#define INC_ROCTRACER_TRACE_ENTRIES_H_

#include <atomic>
#include <cstdint>

#include <roctracer.h>
#include <roctracer_roctx.h>
#include <roctracer_hsa.h>
#include <roctracer_hip.h>
#include <roctracer_kfd.h>
#include <ext/prof_protocol.h>
#include <ext/hsa_rt_utils.hpp>

typedef hsa_rt_utils::Timer::timestamp_t timestamp_t;

namespace roctracer {
enum entry_type_t {
DFLT_ENTRY_TYPE = 0,
API_ENTRY_TYPE = 1,
COPY_ENTRY_TYPE = 2,
KERNEL_ENTRY_TYPE = 3,
NUM_ENTRY_TYPE = 4
};
}

struct roctx_trace_entry_t {
std::atomic<uint32_t> valid;
roctracer::entry_type_t type;
uint32_t cid;
timestamp_t time;
uint32_t pid;
uint32_t tid;
roctx_range_id_t rid;
const char* message;
};

struct hsa_api_trace_entry_t {
std::atomic<uint32_t> valid;
roctracer::entry_type_t type;
uint32_t cid;
timestamp_t begin;
timestamp_t end;
uint32_t pid;
uint32_t tid;
hsa_api_data_t data;
};

struct hsa_activity_trace_entry_t {
uint64_t index;
uint32_t op;
uint32_t pid;
activity_record_t *record;
void *arg;
};

struct hip_api_trace_entry_t {
std::atomic<uint32_t> valid;
roctracer::entry_type_t type;
uint32_t domain;
uint32_t cid;
timestamp_t begin;
timestamp_t end;
uint32_t pid;
uint32_t tid;
hip_api_data_t data;
const char* name;
void* ptr;
};

struct hip_activity_trace_entry_t {
const roctracer_record_t *record;
const char *name;
uint32_t pid;
};

struct kfd_api_trace_entry_t {
std::atomic<uint32_t> valid;
roctracer::entry_type_t type;
uint32_t domain;
uint32_t cid;
timestamp_t begin;
timestamp_t end;
uint32_t pid;
uint32_t tid;
kfd_api_data_t data;
};

#endif
10 changes: 2 additions & 8 deletions src/core/trace_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <string.h>
#include <unistd.h>

#include <roctracer_trace_entries.h>

#define FATAL(stream) \
do { \
std::ostringstream oss; \
Expand All @@ -36,14 +38,6 @@ enum {
TRACE_ENTRY_COMPL = 2
};

enum entry_type_t {
DFLT_ENTRY_TYPE = 0,
API_ENTRY_TYPE = 1,
COPY_ENTRY_TYPE = 2,
KERNEL_ENTRY_TYPE = 3,
NUM_ENTRY_TYPE = 4
};

struct trace_entry_t {
std::atomic<uint32_t> valid;
entry_type_t type;
Expand Down
Loading