Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerilk authored Sep 8, 2023
1 parent 7d9040e commit ff68502
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
18 changes: 1 addition & 17 deletions utils/babeltrace_energy.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# TODO: merge into babeltrace_thapi at some point
DATADIR = File.join("@prefix@", "share")
$:.unshift(DATADIR) if File::directory?(DATADIR)
require 'optparse'
Expand All @@ -8,10 +9,6 @@ require 'yaml'
require 'pp'

$event_lambdas = {}
#require 'babeltrace_opencl_lib'
#require 'babeltrace_ze_lib'
#require 'babeltrace_cuda_lib'
#require 'babeltrace_omp_lib'

$options = {
context: false,
Expand Down Expand Up @@ -96,19 +93,6 @@ consume = lambda { |iterator, _|
l = $event_lambdas[e.name]
if l
l.call e
# str = "#{Time.at(0, m.get_default_clock_snapshot.ns_from_origin, :nsec).strftime("%H:%M:%S.%9L")}"
# if $context
# str << " - #{e.stream.trace.get_environment_entry_value_by_name("hostname")}"
# common_context_field = e.get_common_context_field
# str << " - " << common_context_field.value.collect { |k, v| "#{k}: #{v}" }.join(", ") if common_context_field
# end
# str << " - #{e.name}: "
# if l
# str << l.call(e.payload_field.value)
# else
# str << e.payload_field.to_s
# end
# puts str
end
end
}
Expand Down
1 change: 1 addition & 0 deletions xprof/btx_timeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ static perfetto_uuid_t get_parent_counter_track_uuid(timeline_dispatch_t *dispat
auto *packet = dispatch->trace.add_packet();
packet->set_trusted_packet_sequence_id(10000);
packet->set_timestamp(0);
// TODO: check if this is required
packet->set_previous_packet_dropped(true);
auto *track_descriptor = packet->mutable_track_descriptor();
track_descriptor->set_uuid(hp_uuid);
Expand Down
1 change: 1 addition & 0 deletions ze/tracer_ze_helpers.include.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,7 @@ static void _load_tracer(void) {

if (getenv("LTTNG_UST_SAMPLING_ENERGY")) {
initializeHandles();
/* TODO: make it configurable */
interval.tv_sec = 0;
interval.tv_nsec = 50000000;
thapi_register_sampling(&thapi_sampling_energy, &interval);
Expand Down

0 comments on commit ff68502

Please sign in to comment.