Commit 70e27c8f authored by Thomas Applencourt's avatar Thomas Applencourt
Browse files

Workarround intel bug, timeline gpu id

parent 68b324ce
......@@ -215,7 +215,7 @@ static void clinterval_<%= dbt_event.name %>_callback(
<% end %>
<% end %>
<% end %>
<%#
|\/| _ ._ _ _ ._ _. _ _ _ _ _ _ _
| | (/_ | | | (_) | \/ (_| (_ (_ (/_ _> _> (/_ _>
......@@ -353,7 +353,9 @@ static void clinterval_<%= dbt_event.name %>_callback(
const auto [device,subdevice] = state->function_name_to_dsd[hpt_function_name_t(hostname,process_id,thread_id, function_name)];
const hp_device_t hp_device{hostname, process_id, device};
const uint64_t start_event = state->device_ts_to_llng_ts.count(hp_device) ? state->device_ts_to_llng_ts[hp_device] + start: ts + (start - queued);
//const uint64_t start_event = state->device_ts_to_llng_ts.count(hp_device) ? state->device_ts_to_llng_ts[hp_device] + start: ts + (start - queued);
const uint64_t start_event = ts + (start - queued);
// Check for error
if (delta != 0)
create_and_enqueue_device_message(hostname.c_str(),process_id,thread_id,device, subdevice, function_name.c_str(),start_event,delta);
......@@ -365,8 +367,9 @@ static void clinterval_<%= dbt_event.name %>_callback(
const auto [device,subdevice] = state->function_name_to_dsd[hpt_function_name_t(hostname,process_id,thread_id, function_name)];
const hp_device_t hp_device{hostname, process_id, device};
const uint64_t start_event = state->device_ts_to_llng_ts.count(hp_device) ? state->device_ts_to_llng_ts[hp_device] + start: ts + (start - queued);
//const uint64_t start_event = state->device_ts_to_llng_ts.count(hp_device) ? state->device_ts_to_llng_ts[hp_device] + start: ts + (start - queued);
const uint64_t start_event = ts + (start - queued);
state->event_result_to_start_and_delta[hp_event] = sd_t(start_event,delta);
state->event_to_function_name_and_ts[hp_event] = tfn_ts_t(thread_id, function_name,ts);
}
......
......@@ -47,8 +47,8 @@ bt_component_class_sink_consume_method_status timeline_dispatch_consume(
const bt_message *message = messages[i];
if (bt_message_get_type(message) == BT_MESSAGE_TYPE_EVENT) {
const bt_event *event = bt_message_event_borrow_event_const(message);
//const bt_event_class *event_class = bt_event_borrow_class_const(event);
//const char * class_name = bt_event_class_get_name(event_class);
const bt_event_class *event_class = bt_event_borrow_class_const(event);
const char * class_name = bt_event_class_get_name(event_class);
//Common context field
const bt_field *common_context_field = bt_event_borrow_common_context_field_const(event);
......@@ -74,13 +74,26 @@ bt_component_class_sink_consume_method_status timeline_dispatch_consume(
const bt_field *dur_field = bt_field_structure_borrow_member_field_by_index_const(payload_field, 1);
const long dur = bt_field_integer_unsigned_get_value(dur_field);
std::cout << "{\"pid\": " << process_id
<< ",\"tid\":" << thread_id
<< std::fixed << std::setprecision(2) << ",\"ts\":" << ts*1.E-3
<< ",\"dur\":" << dur*1.E-3
<< ",\"name\":" << "\"" << name << "\""
<< ",\"ph\":\"X\""
<< "}," << std::endl;
if (strcmp(class_name,"lttng:host") == 0 ) {
std::cout << "{\"pid\": " << "\"" + hostname << "-" << process_id << "\""
<< ",\"tid\":" << thread_id
<< std::fixed << std::setprecision(2) << ",\"ts\":" << ts*1.E-3
<< ",\"dur\":" << dur*1.E-3
<< ",\"name\":" << "\"" << name << "\""
<< ",\"ph\":\"X\""
<< "}," << std::endl;
} else if ( strcmp(class_name,"lttng:device") == 0 ) {
const bt_field *did_field = bt_field_structure_borrow_member_field_by_index_const(payload_field, 2);
const thapi_device_id did = bt_field_integer_unsigned_get_value(did_field);
std::cout << "{\"pid\": " << "\"" + hostname << "-" << process_id << "\""
<< ",\"tid\":" << "\"GPU-"<< did << "\""
<< std::fixed << std::setprecision(2) << ",\"ts\":" << ts*1.E-3
<< ",\"dur\":" << dur*1.E-3
<< ",\"name\":" << "\"" << name << "\""
<< ",\"ph\":\"X\""
<< "}," << std::endl;
}
}
bt_message_put_ref(message);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment