aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlankhaar <vlankhaar@google.com>2018-01-24 14:44:45 -0800
committerlannadorai <lannadorai@gmail.com>2018-02-07 18:05:28 -0800
commit97c4dfce7078cf1aea52386c1910cbb1574f23df (patch)
treeb71772a57b7f0ff75963559bb3e1b926d0aa8ac6
parent91a5cde056d3aa767f25cab57dccbe830b63babb (diff)
downloadperf_data_converter-97c4dfce7078cf1aea52386c1910cbb1574f23df.tar.gz
Always run perf.data through PerfParser when converting.
In order to allow hugepage deduction against perf.data files, via $ perf_converter -i perf.data.before -I perf -o perf.data.after -O perf always run PerfParser on PerfReader regardless of output type. Thus, any quirks/fixes applied by quipper can be applied to a perf.data file. PiperOrigin-RevId: 183144568
-rw-r--r--quipper/conversion_utils.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/quipper/conversion_utils.cc b/quipper/conversion_utils.cc
index b1bd056..5e1819c 100644
--- a/quipper/conversion_utils.cc
+++ b/quipper/conversion_utils.cc
@@ -78,16 +78,18 @@ bool WriteOutput(const FormatAndFile& output,
const PerfParserOptions& options,
PerfReader* reader) {
LOG(INFO) << "Writing output.";
+
+ // Apply use PerfParser to modify data in reader, applying hacks all hacks,
+ // regardless of output format.
+ PerfParser parser(reader, options);
+ if (!parser.ParseRawEvents()) return false;
+
string output_string;
if (output.format == kPerfFormat) {
return reader->WriteFile(output.filename);
}
if (output.format == kProtoTextFormat) {
- PerfParser parser(reader, options);
- if (!parser.ParseRawEvents())
- return false;
-
PerfDataProto perf_data_proto;
reader->Serialize(&perf_data_proto);