Skip to content

Commit 0a2263b

Browse files
committed
Fix missing data
1 parent 894c351 commit 0a2263b

File tree

6 files changed

+319
-272
lines changed

6 files changed

+319
-272
lines changed

source/lib/core/rocpd/data_processor.cpp

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ data_processor::insert_event(size_t category_id, size_t stack_id, size_t parent_
221221
if(it == _category_map.end())
222222
{
223223
char buf[128];
224-
snprintf(buf, sizeof(buf), "Insert event: Unknown category id. ID = %ld!", category_id);
224+
snprintf(buf, sizeof(buf), "Insert event: Unknown category id. ID = %ld!",
225+
category_id);
225226
throw std::runtime_error(buf);
226227
}
227228

@@ -405,9 +406,23 @@ data_processor::initialize_memory_alloc_stmt()
405406
_insert_memory_alloc_statement =
406407
data_storage::database::get_instance()
407408
.create_statment_executor<
408-
const char*, size_t, size_t, size_t, std::optional<size_t>, const char*, const char*,
409+
const char*, size_t, size_t, size_t, size_t, const char*, const char*,
409410
uint64_t, uint64_t, size_t, size_t, size_t, size_t, size_t, const char*>(
410411
query);
412+
413+
// Statement without agent_id
414+
query = query_builder.set_table_name("rocpd_memory_allocate_" + _upid)
415+
.set_columns("guid", "nid", "pid", "tid", "type", "level", "start", "end",
416+
"address", "size", "queue_id", "stream_id", "event_id",
417+
"extdata")
418+
.set_values('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',
419+
'?', '?')
420+
.get_query_string();
421+
_insert_memory_alloc_no_agent_statement =
422+
data_storage::database::get_instance()
423+
.create_statment_executor<const char*, size_t, size_t, size_t, const char*,
424+
const char*, uint64_t, uint64_t, size_t, size_t,
425+
size_t, size_t, size_t, const char*>(query);
411426
}
412427

413428
void
@@ -577,14 +592,24 @@ data_processor::insert_memory_copy(size_t node_id, size_t process_id, size_t thr
577592

578593
void
579594
data_processor::insert_memory_alloc(size_t node_id, size_t process_id, size_t thread_id,
580-
std::optional<size_t> agent_id, const char* type, const char* level,
581-
uint64_t start, uint64_t end, size_t address,
582-
size_t size, size_t queue_id, size_t stream_id,
583-
size_t event_id, const char* extdata)
584-
{
585-
_insert_memory_alloc_statement(_upid.c_str(), node_id, process_id, thread_id,
586-
agent_id, type, level, start, end, address, size,
587-
queue_id, stream_id, event_id, extdata);
595+
std::optional<size_t> agent_id, const char* type,
596+
const char* level, uint64_t start, uint64_t end,
597+
size_t address, size_t size, size_t queue_id,
598+
size_t stream_id, size_t event_id,
599+
const char* extdata)
600+
{
601+
if(agent_id.has_value())
602+
{
603+
_insert_memory_alloc_statement(_upid.c_str(), node_id, process_id, thread_id,
604+
agent_id.value(), type, level, start, end, address,
605+
size, queue_id, stream_id, event_id, extdata);
606+
}
607+
else
608+
{
609+
_insert_memory_alloc_no_agent_statement(
610+
_upid.c_str(), node_id, process_id, thread_id, type, level, start, end,
611+
address, size, queue_id, stream_id, event_id, extdata);
612+
}
588613
}
589614

590615
void

0 commit comments

Comments
 (0)