summaryrefslogtreecommitdiff
path: root/simpleperf/tracing.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-06-13 18:03:47 -0700
committerYabin Cui <yabinc@google.com>2016-06-17 17:57:36 -0700
commit877751bbae11e009070e036ee1cd16e88135fff5 (patch)
treee0c795052ab4055a2d9bb0d2d2282305ff3b649d /simpleperf/tracing.cpp
parent90d56472a6981cbbeba5adfc293f920004cd9a22 (diff)
downloadextras-877751bbae11e009070e036ee1cd16e88135fff5.tar.gz
simpleperf: support event group.
Kernel supports monitoring several events as a group, so they are scheduled on and out at the same time. Add --group option to stat command and record command. Adjust the method to calculate miss rate in stat command: limit the matched events in the same group or with scale == 1.0. Bug: 29213742 Change-Id: I899aba207f1e3357307541e81f97526f5a2913c3
Diffstat (limited to 'simpleperf/tracing.cpp')
-rw-r--r--simpleperf/tracing.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/simpleperf/tracing.cpp b/simpleperf/tracing.cpp
index 1757e05d..884a883c 100644
--- a/simpleperf/tracing.cpp
+++ b/simpleperf/tracing.cpp
@@ -396,18 +396,17 @@ const std::string& Tracing::GetKallsyms() const {
uint32_t Tracing::GetPageSize() const { return tracing_file_->GetPageSize(); }
-bool GetTracingData(const std::vector<EventTypeAndModifier>& event_types,
+bool GetTracingData(const std::vector<const EventType*>& event_types,
std::vector<char>* data) {
data->clear();
std::vector<TraceType> trace_types;
for (const auto& type : event_types) {
- if (type.event_type.type == PERF_TYPE_TRACEPOINT) {
- size_t pos = type.event_type.name.find(':');
- TraceType trace_type;
- trace_type.system = type.event_type.name.substr(0, pos);
- trace_type.name = type.event_type.name.substr(pos + 1);
- trace_types.push_back(trace_type);
- }
+ CHECK_EQ(PERF_TYPE_TRACEPOINT, type->type);
+ size_t pos = type->name.find(':');
+ TraceType trace_type;
+ trace_type.system = type->name.substr(0, pos);
+ trace_type.name = type->name.substr(pos + 1);
+ trace_types.push_back(trace_type);
}
TracingFile tracing_file;
if (!tracing_file.RecordHeaderFiles()) {