xref: /aosp_15_r20/external/cronet/third_party/metrics_proto/perf_stat.proto (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1// Copyright 2015 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5syntax = "proto2";
6
7option optimize_for = LITE_RUNTIME;
8option java_package = "org.chromium.components.metrics";
9
10package metrics;
11
12// Stores output generated by the "perf stat" command.
13//
14// See https://perf.wiki.kernel.org/index.php/Tutorial#Counting_with_perf_stat
15// for more details.
16
17// Next tag: 3
18message PerfStatProto {
19  // All lines printed by "perf stat".
20  repeated PerfStatLine line = 1;
21
22  // The command line used to run "perf stat".
23  optional string command_line = 2;
24
25  // Represents one line of "perf stat" output.
26  // Next tag: 4
27  message PerfStatLine {
28    // Time since the start of the "perf stat" command, in milliseconds.
29    //
30    // When running "perf stat" and printing the counters at the end, this is
31    // the total time taken by the run.
32    //
33    // Alternatively, "perf stat" can print its stats at regular intervals until
34    // the end of the run. For example, if "perf stat" runs for one second and
35    // prints at 200-ms intervals, it will print counter values for each event
36    // a total of five times. According to "perf stat" usage instructions, the
37    // printing interval should be no less than 100 ms.
38    optional uint64 time_ms = 1;
39
40    // Current count value of the event being counted. May be different from the
41    // nominal counter value reported by "perf stat", depending on the event.
42    // For example, memory access counters are in units of 64 bytes. A counter
43    // value of 1024 would represent 65536 bytes, and we would set this field to
44    // 65536.
45    optional uint64 count = 2;
46
47    // Name of event whose counter is listed on this line.
48    // This string should also appear as part of |PerfStatProto::command_line|.
49    // "perf stat" will preserve the event name exactly as it is passed in via
50    // the command line.
51    optional string event_name = 3;
52  }
53}
54