Skip to content

Commit

Permalink
Adress requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cvonelm committed Aug 22, 2023
1 parent 5971636 commit cc4b46c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion include/lo2s/monitor/io_monitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class IoMonitor : public PollMonitor
{
public:
IoMonitor(trace::Trace& trace)
: monitor::PollMonitor(trace, "", config().perf_read_interval), multi_reader_(trace)
: monitor::PollMonitor(trace, "IoMonitor", config().perf_read_interval), multi_reader_(trace)

{
for (auto fd : multi_reader_.get_fds())
Expand Down
2 changes: 2 additions & 0 deletions include/lo2s/perf/multi_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#pragma once

#include <lo2s/log.hpp>
#include <lo2s/perf/bio/writer.hpp>
#include <lo2s/perf/io_reader.hpp>
#include <lo2s/perf/time/converter.hpp>
Expand All @@ -31,6 +32,7 @@
#include <otf2xx/event/metric.hpp>
#include <otf2xx/writer/local.hpp>

#include <functional>
#include <queue>
#include <unordered_map>
#include <vector>
Expand Down
18 changes: 5 additions & 13 deletions src/perf/sample/writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,13 @@ bool Writer::handle(const Reader::RecordSwitchType* context_switch)
auto tp = time_converter_(context_switch->time);
tp = adjust_timepoints(tp);

bool is_switch_out = context_switch->header.misc & PERF_RECORD_MISC_SWITCH_OUT;
update_calling_context(Process(context_switch->pid), Thread(context_switch->tid), tp,
context_switch->header.misc & PERF_RECORD_MISC_SWITCH_OUT);
is_switch_out);

if (context_switch->header.misc & PERF_RECORD_MISC_SWITCH_OUT)
{
cpuid_metric_event_.timestamp(tp);
cpuid_metric_event_.raw_values()[0] = -1;
otf2_writer_ << cpuid_metric_event_;
}
else
{
cpuid_metric_event_.timestamp(tp);
cpuid_metric_event_.raw_values()[0] = context_switch->cpu;
otf2_writer_ << cpuid_metric_event_;
}
cpuid_metric_event_.timestamp(tp);
cpuid_metric_event_.raw_values()[0] = is_switch_out ? -1 : context_switch->cpu;
otf2_writer_ << cpuid_metric_event_;

return false;
}
Expand Down

0 comments on commit cc4b46c

Please sign in to comment.