Skip to content

Commit 90dd121

Browse files
Address comments on PR
Signed-off-by: rahul <rbramand@amd.com>
1 parent 27115a4 commit 90dd121

7 files changed

Lines changed: 40 additions & 45 deletions

File tree

src/runtime_src/core/common/api/elf_int.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ class elf_impl
342342
parse_custom_sections(const std::vector<uint32_t>& custom_section_ids);
343343

344344
public:
345-
virtual ~elf_impl();
345+
virtual ~elf_impl() = default;
346346

347347
// Base class managed through shared_ptr - no copy/move
348348
elf_impl(const elf_impl&) = delete;

src/runtime_src/core/common/api/xrt_bo.cpp

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,7 @@ class bo_impl
289289
, size(sz)
290290
{}
291291

292-
virtual ~bo_impl()
293-
{
294-
XRT_TRACE_POINT_LOG(xrt_bo_dtor);
295-
}
292+
virtual ~bo_impl() = default;
296293

297294
bo_impl(const bo_impl&) = delete;
298295
bo_impl(bo_impl&&) = delete;
@@ -1087,7 +1084,7 @@ alloc_bo(const device_type& device, size_t sz, xrtBufferFlags flags, xrtMemoryGr
10871084
static std::shared_ptr<xrt::bo_impl>
10881085
alloc_kbuf(const device_type& device, size_t sz, xrtBufferFlags flags, xrtMemoryGroup grp)
10891086
{
1090-
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_kbuf_ctor);
1087+
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_kbuf);
10911088
auto handle = alloc_bo(device, sz, flags, grp);
10921089
auto boh = std::make_shared<xrt::buffer_kbuf>(device, std::move(handle), sz);
10931090
boh->get_usage_logger()->log_buffer_info_construct(device->get_device_id(), sz, device.get_hwctx_handle());
@@ -1097,7 +1094,7 @@ alloc_kbuf(const device_type& device, size_t sz, xrtBufferFlags flags, xrtMemory
10971094
static std::shared_ptr<xrt::bo_impl>
10981095
alloc_ubuf(const device_type& device, void* userptr, size_t sz, xrtBufferFlags flags, xrtMemoryGroup grp)
10991096
{
1100-
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_ubuf_ctor);
1097+
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_ubuf);
11011098
// On NoDMA platforms a userptr would require userspace management
11021099
// of specified userptr with extra memcpy on sync and copy. If
11031100
// supported then it would hide inefficient application code, so
@@ -1119,7 +1116,7 @@ alloc_ubuf(const device_type& device, void* userptr, size_t sz, xrtBufferFlags f
11191116
static std::shared_ptr<xrt::bo_impl>
11201117
alloc_hbuf(const device_type& device, xrt_core::aligned_ptr_type&& hbuf, size_t sz, xrtBufferFlags flags, xrtMemoryGroup grp)
11211118
{
1122-
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_hbuf_ctor);
1119+
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_hbuf);
11231120
auto handle = alloc_bo(device, hbuf.get(), sz, flags, grp);
11241121
auto boh = std::make_shared<xrt::buffer_hbuf>(device, std::move(handle), sz, std::move(hbuf));
11251122
boh->get_usage_logger()->log_buffer_info_construct(device->get_device_id(), sz, device.get_hwctx_handle());
@@ -1129,7 +1126,7 @@ alloc_hbuf(const device_type& device, xrt_core::aligned_ptr_type&& hbuf, size_t
11291126
static std::shared_ptr<xrt::bo_impl>
11301127
alloc_dbuf(const device_type& device, size_t sz, xrtBufferFlags, xrtMemoryGroup grp)
11311128
{
1132-
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_dbuf_ctor);
1129+
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_dbuf);
11331130
auto handle = alloc_bo(device, sz, XCL_BO_FLAGS_DEV_ONLY, grp);
11341131
auto boh = std::make_shared<xrt::buffer_dbuf>(device, std::move(handle), sz);
11351132
boh->get_usage_logger()->log_buffer_info_construct(device->get_device_id(), sz, device.get_hwctx_handle());
@@ -1139,7 +1136,7 @@ alloc_dbuf(const device_type& device, size_t sz, xrtBufferFlags, xrtMemoryGroup
11391136
static std::shared_ptr<xrt::bo_impl>
11401137
alloc_nodma(const device_type& device, size_t sz, xrtBufferFlags, xrtMemoryGroup grp)
11411138
{
1142-
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_nodma_ctor);
1139+
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_nodma);
11431140
constexpr size_t align = 64;
11441141
if (sz % align)
11451142
throw xrt_core::error(EINVAL, "Invalid buffer size '" + std::to_string(sz) +
@@ -1186,21 +1183,21 @@ alloc(const device_type& device, size_t sz, xrtBufferFlags flags, xrtMemoryGroup
11861183
static std::shared_ptr<xrt::bo_impl>
11871184
alloc_xbuf(const device_type& device, xcl_buffer_handle xhdl)
11881185
{
1189-
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_xbuf_ctor);
1186+
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_xbuf);
11901187
return std::make_shared<xrt::buffer_xbuf>(device, xhdl);
11911188
}
11921189

11931190
static std::shared_ptr<xrt::bo_impl>
11941191
alloc_userptr(const device_type& device, void* userptr, size_t sz, xrtBufferFlags flags, xrtMemoryGroup grp)
11951192
{
1196-
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_userptr_ctor);
1193+
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_userptr);
11971194
return alloc_ubuf(device, userptr, sz, flags, grp);
11981195
}
11991196

12001197
static std::shared_ptr<xrt::bo_impl>
12011198
alloc_import(const device_type& device, xrt::bo_impl::export_handle ehdl)
12021199
{
1203-
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_import_ctor);
1200+
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_import);
12041201
auto boh = std::make_shared<xrt::buffer_import>(device, ehdl);
12051202
boh->get_usage_logger()->log_buffer_info_construct(device->get_device_id(), boh->get_size(), device.get_hwctx_handle());
12061203
return boh;
@@ -1209,7 +1206,7 @@ alloc_import(const device_type& device, xrt::bo_impl::export_handle ehdl)
12091206
static std::shared_ptr<xrt::bo_impl>
12101207
alloc_import_from_pid(const device_type& device, xrt::pid_type pid, xrt::bo_impl::export_handle ehdl)
12111208
{
1212-
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_import_from_pid_ctor);
1209+
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_import_from_pid);
12131210
auto boh = std::make_shared<xrt::buffer_import>(device, pid, ehdl);
12141211
boh->get_usage_logger()->log_buffer_info_construct(device->get_device_id(),
12151212
boh->get_size(),
@@ -1220,7 +1217,7 @@ alloc_import_from_pid(const device_type& device, xrt::pid_type pid, xrt::bo_impl
12201217
static std::shared_ptr<xrt::bo_impl>
12211218
alloc_sub(const std::shared_ptr<xrt::bo_impl>& parent, size_t size, size_t offset)
12221219
{
1223-
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_sub_ctor);
1220+
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_sub);
12241221
auto boh = std::make_shared<xrt::buffer_sub>(parent, size, offset);
12251222
boh->get_usage_logger()->log_buffer_info_construct(boh->get_core_device()->get_device_id(),
12261223
boh->get_size(),
@@ -1232,7 +1229,7 @@ alloc_sub(const std::shared_ptr<xrt::bo_impl>& parent, size_t size, size_t offse
12321229
static std::shared_ptr<xrt::bo_impl>
12331230
alloc_clone(const std::shared_ptr<xrt::bo_impl>& src, xrt::memory_group grp)
12341231
{
1235-
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_clone_ctor);
1232+
XRT_TRACE_POINT_SCOPE(xrt_bo_alloc_clone);
12361233
// Same device and flags as src bo
12371234
auto device = src->get_device();
12381235
auto xflags = static_cast<xrtBufferFlags>(src->get_flags());

src/runtime_src/core/common/api/xrt_device.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ send_exception_message(const char* msg)
5555
static std::shared_ptr<xrt_core::device>
5656
alloc_device_index(unsigned int index)
5757
{
58-
XRT_TRACE_POINT_SCOPE(xrt_device_index_ctor);
58+
XRT_TRACE_POINT_SCOPE(xrt_device_alloc_index);
5959
auto dev = xrt_core::get_userpf_device(index);
6060

6161
dev->get_usage_logger()->log_device_info(dev.get());
@@ -66,7 +66,7 @@ alloc_device_index(unsigned int index)
6666
static std::shared_ptr<xrt_core::device>
6767
alloc_device_handle(xclDeviceHandle dhdl)
6868
{
69-
XRT_TRACE_POINT_SCOPE(xrt_device_handle_ctor);
69+
XRT_TRACE_POINT_SCOPE(xrt_device_alloc_handle);
7070
return xrt_core::get_userpf_device(dhdl) ;
7171
}
7272

src/runtime_src/core/common/api/xrt_elf.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,6 @@ elf_impl(ELFIO::elfio&& elfio, elf::platform platform)
333333
, m_platform{platform}
334334
{}
335335

336-
elf_impl::
337-
~elf_impl()
338-
{
339-
XRT_TRACE_POINT_LOG(xrt_elf_dtor);
340-
}
341-
342336
// Get symbol information from .symtab at given index
343337
elf_impl::symbol_info
344338
elf_impl::
@@ -1438,7 +1432,7 @@ namespace {
14381432
static std::shared_ptr<xrt::elf_impl>
14391433
create_elf_impl(ELFIO::elfio&& elfio)
14401434
{
1441-
XRT_TRACE_POINT_SCOPE(xrt_elf_ctor);
1435+
XRT_TRACE_POINT_SCOPE(xrt_elf_create_impl);
14421436
auto os_abi = elfio.get_os_abi();
14431437

14441438
switch (os_abi) {

src/runtime_src/core/common/api/xrt_hw_context.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ class hw_context_impl : public std::enable_shared_from_this<hw_context_impl>
232232
static std::unique_ptr<uc_log_buffer>
233233
init_uc_log_buf(const std::shared_ptr<xrt_core::device>& device, xrt_core::hwctx_handle* ctx_hdl)
234234
{
235+
XRT_TRACE_POINT_SCOPE(xrt_hw_context_init_uc_log_buf);
235236
// If uc log buffer is not supported then this function returns nullptr
236237
static auto uc_log_enabled = xrt_core::config::get_uc_log();
237238
if (!ctx_hdl || !uc_log_enabled)
@@ -347,6 +348,7 @@ class hw_context_impl : public std::enable_shared_from_this<hw_context_impl>
347348
void
348349
add_config(const xrt::elf& elf)
349350
{
351+
XRT_TRACE_POINT_SCOPE(xrt_hw_context_add_config);
350352
auto part_size = elf.get_partition_size();
351353

352354
// create hw ctx handle if not already created
@@ -409,6 +411,7 @@ class hw_context_impl : public std::enable_shared_from_this<hw_context_impl>
409411
void
410412
dump_uc_log_buffer()
411413
{
414+
XRT_TRACE_POINT_SCOPE(xrt_hw_context_dump_uc_log_buffer);
412415
if (!m_uc_log_buf)
413416
return;
414417

@@ -537,6 +540,7 @@ class hw_context_impl : public std::enable_shared_from_this<hw_context_impl>
537540
void
538541
dump_scratchpad_mem()
539542
{
543+
XRT_TRACE_POINT_SCOPE(xrt_hw_context_dump_scratchpad_mem);
540544
if (m_scratchpad_buf.size() == 0) {
541545
xrt_core::message::send(xrt_core::message::severity_level::debug, "xrt_hw_context",
542546
"preemption scratchpad memory is not available");
@@ -728,23 +732,23 @@ template<typename Cfg>
728732
static std::shared_ptr<hw_context_impl>
729733
alloc_hwctx_from_cfg(const xrt::device& device, const xrt::uuid& xclbin_id, Cfg&& cfg)
730734
{
731-
XRT_TRACE_POINT_SCOPE(xrt_hw_context_cfg_ctor);
735+
XRT_TRACE_POINT_SCOPE(xrt_hw_context_alloc_from_cfg);
732736
return post_alloc_hwctx(std::make_shared<hw_context_impl>(
733737
device.get_handle(), xclbin_id, hwctx_cfg_storage{std::forward<Cfg>(cfg)}));
734738
}
735739

736740
static std::shared_ptr<hw_context_impl>
737741
alloc_hwctx_from_mode(const xrt::device& device, const xrt::uuid& xclbin_id, xrt::hw_context::access_mode mode)
738742
{
739-
XRT_TRACE_POINT_SCOPE(xrt_hw_context_mode_ctor);
743+
XRT_TRACE_POINT_SCOPE(xrt_hw_context_alloc_from_mode);
740744
return post_alloc_hwctx(std::make_shared<hw_context_impl>(device.get_handle(), xclbin_id, mode));
741745
}
742746

743747
template<typename Cfg>
744748
static std::shared_ptr<hw_context_impl>
745749
alloc_empty_hwctx(const xrt::device& device, Cfg&& cfg, xrt::hw_context::access_mode mode)
746750
{
747-
XRT_TRACE_POINT_SCOPE(xrt_hw_context_empty_ctor);
751+
XRT_TRACE_POINT_SCOPE(xrt_hw_context_alloc_empty);
748752
return post_alloc_hwctx(std::make_shared<hw_context_impl>(
749753
device.get_handle(), hwctx_cfg_storage{std::forward<Cfg>(cfg)}, mode));
750754
}
@@ -754,7 +758,7 @@ static std::shared_ptr<hw_context_impl>
754758
alloc_hwctx_from_elf(const xrt::device& device, const xrt::elf& elf, Cfg&& cfg,
755759
xrt::hw_context::access_mode mode)
756760
{
757-
XRT_TRACE_POINT_SCOPE(xrt_hw_context_elf_ctor);
761+
XRT_TRACE_POINT_SCOPE(xrt_hw_context_alloc_from_elf);
758762
return post_alloc_hwctx(std::make_shared<hw_context_impl>(
759763
device.get_handle(), elf, hwctx_cfg_storage{std::forward<Cfg>(cfg)}, mode));
760764
}

src/runtime_src/core/common/api/xrt_kernel.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,7 +1842,6 @@ class kernel_impl : public std::enable_shared_from_this<kernel_impl>
18421842
~kernel_impl()
18431843
{
18441844
XRT_DEBUGF("kernel_impl::~kernel_impl(%d)\n" , uid);
1845-
XRT_TRACE_POINT_LOG(xrt_kernel_dtor);
18461845
}
18471846

18481847
kernel_impl(const kernel_impl&) = delete;
@@ -2497,7 +2496,6 @@ class run_impl : public std::enable_shared_from_this<run_impl>
24972496
virtual
24982497
~run_impl()
24992498
{
2500-
XRT_TRACE_POINT_LOG(xrt_run_dtor);
25012499
// It is a fatal error to destruct a run_impl while its command is
25022500
// still in progress. But only abort if there are no live
25032501
// exception objects.
@@ -3680,7 +3678,6 @@ class runlist_impl
36803678

36813679
~runlist_impl()
36823680
{
3683-
XRT_TRACE_POINT_LOG(xrt_runlist_dtor);
36843681
// Make sure all run objects are severed from this list
36853682
try {
36863683
clear_runs();
@@ -3951,7 +3948,7 @@ get_run_update(xrtRunHandle rhdl)
39513948
static std::unique_ptr<xrt::run_impl>
39523949
alloc_run(const std::shared_ptr<xrt::kernel_impl>& khdl)
39533950
{
3954-
XRT_TRACE_POINT_SCOPE(xrt_run_ctor);
3951+
XRT_TRACE_POINT_SCOPE(xrt_run_alloc);
39553952
return khdl->has_mailbox()
39563953
? std::make_unique<xrt::mailbox_impl>(khdl)
39573954
: std::make_unique<xrt::run_impl>(khdl);
@@ -3963,7 +3960,7 @@ alloc_kernel(const std::shared_ptr<device_type>& dev,
39633960
const std::string& name,
39643961
xrt::kernel::cu_access_mode mode)
39653962
{
3966-
XRT_TRACE_POINT_SCOPE(xrt_kernel_ctor);
3963+
XRT_TRACE_POINT_SCOPE(xrt_kernel_alloc);
39673964
auto amode = hwctx_access_mode(mode); // legacy access mode to hwctx qos
39683965
return std::make_shared<xrt::kernel_impl>(dev, xrt::hw_context{dev->get_xrt_device(), xclbin_id, amode}, xrt::module{}, name);
39693966
}
@@ -3973,7 +3970,7 @@ alloc_kernel_from_ctx(const std::shared_ptr<device_type>& dev,
39733970
const xrt::hw_context& hwctx,
39743971
const std::string& name)
39753972
{
3976-
XRT_TRACE_POINT_SCOPE(xrt_kernel_ctx_ctor);
3973+
XRT_TRACE_POINT_SCOPE(xrt_kernel_alloc_from_ctx);
39773974
// Delegating constructor with no module
39783975
return std::make_shared<xrt::kernel_impl>(dev, hwctx, xrt::module{}, name);
39793976
}
@@ -3984,7 +3981,7 @@ alloc_kernel_from_module(const std::shared_ptr<device_type>& dev,
39843981
const xrt::module& module,
39853982
const std::string& name)
39863983
{
3987-
XRT_TRACE_POINT_SCOPE(xrt_kernel_module_ctor);
3984+
XRT_TRACE_POINT_SCOPE(xrt_kernel_alloc_from_module);
39883985
return std::make_shared<xrt::kernel_impl>(dev, hwctx, module, name);
39893986
}
39903987

@@ -3993,7 +3990,7 @@ alloc_kernel_from_name(const std::shared_ptr<device_type>& dev,
39933990
const xrt::hw_context& hwctx,
39943991
const std::string& name)
39953992
{
3996-
XRT_TRACE_POINT_SCOPE(xrt_kernel_name_ctor);
3993+
XRT_TRACE_POINT_SCOPE(xrt_kernel_alloc_from_name);
39973994
return std::make_shared<xrt::kernel_impl>(dev, hwctx, name);
39983995
}
39993996

@@ -4246,6 +4243,7 @@ void
42464243
run::
42474244
set_dtrace_control_file(const std::string& path)
42484245
{
4246+
XRT_TRACE_POINT_SCOPE(xrt_run_set_dtrace_control_file);
42494247
handle->set_dtrace_control_file(path);
42504248
}
42514249

@@ -4332,20 +4330,23 @@ void
43324330
run::
43334331
set_arg_at_index(int index, const void* value, size_t bytes)
43344332
{
4333+
XRT_TRACE_POINT_SCOPE(xrt_run_set_arg_value);
43354334
handle->set_arg_at_index(index, value, bytes);
43364335
}
43374336

43384337
void
43394338
run::
43404339
set_arg_at_index(int index, const xrt::bo& glb)
43414340
{
4341+
XRT_TRACE_POINT_SCOPE(xrt_run_set_arg_bo);
43424342
handle->set_arg_at_index(index, glb);
43434343
}
43444344

43454345
void
43464346
run::
43474347
update_arg_at_index(int index, const void* value, size_t bytes)
43484348
{
4349+
XRT_TRACE_POINT_SCOPE(xrt_run_update_arg_value);
43494350
auto upd = get_run_update(handle.get());
43504351
upd->update_arg_at_index(index, value, bytes);
43514352
}
@@ -4354,6 +4355,7 @@ void
43544355
run::
43554356
update_arg_at_index(int index, const xrt::bo& glb)
43564357
{
4358+
XRT_TRACE_POINT_SCOPE(xrt_run_update_arg_bo);
43574359
auto upd = get_run_update(handle.get());
43584360
upd->update_arg_at_index(index, glb);
43594361
}
@@ -4523,7 +4525,7 @@ set_read_range(const xrt::kernel& kernel, uint32_t start, uint32_t size)
45234525
static std::shared_ptr<runlist_impl>
45244526
alloc_runlist(xrt::hw_context hwctx)
45254527
{
4526-
XRT_TRACE_POINT_SCOPE(xrt_runlist_ctor);
4528+
XRT_TRACE_POINT_SCOPE(xrt_runlist_alloc);
45274529
return std::make_shared<runlist_impl>(std::move(hwctx));
45284530
}
45294531

@@ -4542,6 +4544,7 @@ void
45424544
runlist::
45434545
add(const xrt::run& run)
45444546
{
4547+
XRT_TRACE_POINT_SCOPE(xrt_runlist_add);
45454548
if (!handle)
45464549
throw xrt_core::error("cannot add run object to uninitialized runlist");
45474550

src/runtime_src/core/common/api/xrt_module.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ class module_impl
9090
, m_name(std::move(name))
9191
{}
9292

93-
virtual ~module_impl()
94-
{
95-
XRT_TRACE_POINT_LOG(xrt_module_dtor);
96-
}
93+
virtual ~module_impl() = default;
9794

9895
// Base class managed through shared_ptr - no copy/move
9996
module_impl(const module_impl&) = delete;
@@ -1143,14 +1140,14 @@ class module_run_aie_gen2_plus : public module_run
11431140
static std::shared_ptr<module_impl>
11441141
alloc_module_impl(const xrt::elf& elf)
11451142
{
1146-
XRT_TRACE_POINT_SCOPE(xrt_module_ctor);
1143+
XRT_TRACE_POINT_SCOPE(xrt_module_alloc_impl);
11471144
return std::make_shared<module_impl>(elf);
11481145
}
11491146

11501147
static std::shared_ptr<module_impl>
11511148
alloc_module_impl(const xrt::elf& elf, std::string name)
11521149
{
1153-
XRT_TRACE_POINT_SCOPE(xrt_module_name_ctor);
1150+
XRT_TRACE_POINT_SCOPE(xrt_module_alloc_impl_with_name);
11541151
return std::make_shared<module_impl>(elf, std::move(name));
11551152
}
11561153

@@ -1194,7 +1191,7 @@ xrt::module
11941191
create_module_run(const xrt::elf& elf, const xrt::hw_context& hwctx,
11951192
uint32_t ctrl_code_id, const xrt::bo& ctrlpkt_bo)
11961193
{
1197-
XRT_TRACE_POINT_SCOPE(xrt_module_run_ctor);
1194+
XRT_TRACE_POINT_SCOPE(xrt_module_run);
11981195
auto platform = elf.get_platform();
11991196
switch (platform) {
12001197
case xrt::elf::platform::aie2p:

0 commit comments

Comments
 (0)