forked from MinyaRancic/perf_chains
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathperf_data.proto
1033 lines (779 loc) · 28.7 KB
/
perf_data.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto2";
package quipper;
option cc_enable_arenas = true;
// Stores information from a perf session generated via running:
// "perf record"
//
// See $kernel/tools/perf/design.txt for more details.
// Next tag: 17
message PerfDataProto {
// Perf event attribute. Stores the event description.
// This data structure is defined in the linux kernel:
// $kernel/include/uapi/linux/perf_event.h.
// Next tag: 47
message PerfEventAttr {
// Type of the event. Type is an enumeration and can be one of the values
// described at: $kernel/include/linux/perf_event.h.
// Example types are:
// PERF_TYPE_HARDWARE
// PERF_TYPE_SOFTWARE, etc.
optional uint32 type = 1;
// Size of the event data in bytes.
optional uint32 size = 2;
// The config stores the CPU-specific counter information.
optional uint64 config = 3;
// Sample period of the event. Indicates how often the event is
// triggered in terms of # of events. After |sample_period| events, an event
// will be recorded and stored.
optional uint64 sample_period = 4;
// Sample frequency of the event. Indicates how often the event is
// triggered in terms of # per second. The kernel will try to record
// |sample_freq| events per second.
optional uint64 sample_freq = 5;
// Sample type is a bitfield that records attributes of the sample. Example,
// whether an entire callchain was recorded, etc.
optional uint64 sample_type = 6;
// Bitfield that indicates whether reads on the counter will return the
// total time enabled and total time running.
optional uint64 read_format = 7;
// Indicates whether the counter starts off disabled.
optional bool disabled = 8;
// Indicates whether child processes inherit the counter.
optional bool inherit = 9;
// Indicates whether the counter is pinned to a particular CPU.
optional bool pinned = 10;
// Indicates whether this counter's group has exclusive access to the CPU's
// counters.
optional bool exclusive = 11;
// The following bits restrict events to be counted when the CPU is in user,
// kernel, hypervisor or idle modes.
optional bool exclude_user = 12;
optional bool exclude_kernel = 13;
optional bool exclude_hv = 14;
optional bool exclude_idle = 15;
// Indicates whether mmap events should be recorded.
optional bool mmap = 16;
// Indicates whether process comm information should be recorded upon
// process creation.
optional bool comm = 17;
// Indicates that we are in frequency mode, not period mode.
optional bool freq = 18;
// Indicates whether we have per-task counts.
optional bool inherit_stat = 19;
// Indicates whether we enable perf events after an exec() function call.
optional bool enable_on_exec = 20;
// Indicates whether we trace fork/exit.
optional bool task = 21;
// Indicates whether we are using a watermark to wake up.
optional bool watermark = 22;
// CPUs often "skid" when recording events. That means the instruction
// pointer may not be the same as the one that caused the counter overflow.
// Indicates the capabilities of the CPU in terms of recording precise
// instruction pointer.
optional uint32 precise_ip = 23;
// Indicates whether we have non-exec mmap data.
optional bool mmap_data = 24;
// If set, all the event types will have the same sample_type.
optional bool sample_id_all = 25;
// Indicates whether we are counting events from the host (when running a
// VM).
optional bool exclude_host = 26;
// Exclude events that happen on a guest OS.
optional bool exclude_guest = 27;
// Exclude kernel callchains.
optional bool exclude_callchain_kernel = 36;
// Exclude user callchains.
optional bool exclude_callchain_user = 37;
// Include mmap2 events that have inode data.
optional bool mmap2 = 38;
// Flag comm events that are due to an exec.
optional bool comm_exec = 39;
// Indicates whether or not to use @clockid for time fields.
optional bool use_clockid = 42;
// Include context switch data.
optional bool context_switch = 43;
// Indicates whether ring buffer is written from end to beginning.
optional bool write_backward = 44;
// Include namespace data.
optional bool namespaces = 45;
// Include cgroup data.
optional bool cgroup = 46;
// Contains the number of events after which we wake up.
optional uint32 wakeup_events = 28;
// Contains the number of bytes after which we wake up.
optional uint32 wakeup_watermark = 29;
// Information about the type of the breakpoint.
optional uint32 bp_type = 30;
// Contains the breakpoint address.
optional uint64 bp_addr = 31;
// This is an extension of config (see above).
optional uint64 config1 = 32;
// The length of the breakpoint data in bytes.
optional uint64 bp_len = 33;
// This is an extension of config (see above).
optional uint64 config2 = 34;
// Contains the type of branch, example: user, kernel, call, return, etc.
optional uint64 branch_sample_type = 35;
// Defines set of user regs to dump on samples.
optional uint64 sample_regs_user = 40;
// Defines size of the user stack to dump on samples.
optional uint32 sample_stack_user = 41;
}
// Describes a perf.data file attribute.
// Next tag: 3
message PerfFileAttr {
optional PerfEventAttr attr = 1;
// List of perf file attribute ids. Each id describes an event.
repeated uint64 ids = 2;
}
// Protobuf version of the perf_event_type struct found in perf/util/event.h.
// Contains the name of the event (such as "cycles" or "branch-misses") and
// the event id (which is not unique).
// Next tag: 4
message PerfEventType {
// Event id. This is not unique across event types.
// The combination of the event id and the type field in PerfEventAttr is
// unique across event types.
optional uint64 id = 1;
// Event name.
optional string name = 2;
// Event name's md5 prefix.
optional uint64 name_md5_prefix = 3;
}
// This message contains information about a perf sample itself, as opposed to
// a perf event captured by a sample.
// Next tag: 7
message SampleInfo {
// Process ID / thread ID from which this sample was taken.
optional uint32 pid = 1;
optional uint32 tid = 2;
// Time this sample was taken (NOT the same as an event time).
// It is the number of nanoseconds since bootup.
optional uint64 sample_time_ns = 3;
// The ID of the sample's event type (cycles, instructions, etc).
// The event type IDs are defined in PerfFileAttr.
optional uint64 id = 4;
// The CPU on which this sample was taken.
optional uint32 cpu = 5;
// The stream id of the sample.
optional uint64 stream_id = 6;
}
// Next tag: 7
message CommEvent {
// Process id.
optional uint32 pid = 1;
// Thread id.
optional uint32 tid = 2;
// Comm string.
optional string comm = 3;
// Comm string's md5 prefix.
optional uint64 comm_md5_prefix = 4;
// Time the sample was taken.
// Deprecated, use |sample_info| instead.
optional uint64 sample_time = 5 [deprecated = true];
// Info about the perf sample containing this event.
optional SampleInfo sample_info = 6;
}
// Represents both mmap_event and mmap2_event.
// Next tag: 17
message MMapEvent {
// Process id.
optional uint32 pid = 1;
// Thread id.
optional uint32 tid = 2;
// Start address.
optional uint64 start = 3;
// Length.
optional uint64 len = 4;
// PG Offset.
optional uint64 pgoff = 5;
// Only in MMAP2 events, information about the mapped inode:
// Major/minor numbers
optional uint32 maj = 9;
optional uint32 min = 10;
// Inode number and generation.
optional uint64 ino = 11;
optional uint64 ino_generation = 12;
// Protection bits and flags.
optional uint32 prot = 13;
optional uint32 flags = 14;
// In both MMAP and MMAP2 events:
// Filename.
optional string filename = 6;
// Filename's md5 prefix.
optional uint64 filename_md5_prefix = 7;
// The root path is defined as the first two levels of directories starting
// from the root, e.g. /data/app, /system/lib.
optional string root_path = 15;
// Root path's md5 prefix. It helps to categorize filenames we could not
// recover by the filename_md5_prefix.
optional uint64 root_path_md5_prefix = 16;
// Info about the perf sample containing this event.
optional SampleInfo sample_info = 8;
}
// Next tag: 4
message ReadInfo {
optional uint64 time_enabled = 1;
optional uint64 time_running = 2;
message ReadValue {
optional uint64 value = 1;
optional uint64 id = 2;
}
// Based on the value of |PerfEventAttr::read_format & PERF_FORMAT_GROUP|,
// the read info could contain one or multiple read values and IDs. If the
// format is non-grouped, the repeated field will have only one entry.
repeated ReadValue read_value = 3;
}
// Next tag: 10
message BranchStackEntry {
// Branch source address.
optional uint64 from_ip = 1;
// Branch destination address.
optional uint64 to_ip = 2;
// Indicates a mispredicted branch.
optional bool mispredicted = 3;
// Indicates a predicted branch.
optional bool predicted = 4;
// Indicates running in a hardware transaction
optional bool in_transaction = 5;
// Indicates aborting a hardware transaction
optional bool abort = 6;
// Cycle count to last branch
optional uint32 cycles = 7;
// Branch type.
optional uint32 type = 8;
// Branch speculation info.
optional uint32 spec = 9;
}
// WeightStruct is microarchitecture-dependant field and only for special
// events. For example, for Sapphire Rapids the first field of WeightStruct is
// the instruction latency, and the second is the cache latency, but it can
// vary.
// Next tag: 4
message WeightStruct {
// First weight factor.
optional uint32 var1_dw = 1;
// Second weight factor.
optional uint32 var2_w = 2;
// Third weight factor.
optional uint32 var3_w = 3;
}
// Next tag: 27
message SampleEvent {
// Instruction pointer.
optional uint64 ip = 1;
// Process id.
optional uint32 pid = 2;
// Thread id.
optional uint32 tid = 3;
// The time after boot when the sample was recorded, in nanoseconds.
optional uint64 sample_time_ns = 4;
// The address of the sample.
optional uint64 addr = 5;
// The id of the sample.
optional uint64 id = 6;
// The stream id of the sample.
optional uint64 stream_id = 7;
// The period of the sample.
optional uint64 period = 8;
// The CPU where the event was recorded.
optional uint32 cpu = 9;
// The raw data for the event. Historically, the raw data itself was not
// stored in the perf_data.proto and so it's possible that only raw_size is
// set in which case the reader should assume all-zero raw data of the
// specified size. If raw field is present, then len(raw) == raw_size.
optional bytes raw = 21;
optional uint32 raw_size = 10;
// The read field.
optional ReadInfo read_info = 18;
// Sample callchain info.
repeated uint64 callchain = 11;
// Branch stack info.
repeated BranchStackEntry branch_stack = 12;
// These are not yet implemented, but are listed as placeholders.
//
// optional RegsUser regs_user = 13;
// optional StackUser stack_user = 14;
// Sample weight for special events.
optional uint64 weight = 15;
// Sample data source flags.
optional uint64 data_src = 16;
// Sample transaction flags for special events.
optional uint64 transaction = 17;
// Physical address of the sample.
optional uint64 physical_addr = 19;
// Cgroup id.
optional uint64 cgroup = 20;
// Data page size
optional uint64 data_page_size = 22;
// Code page size
optional uint64 code_page_size = 23;
// No hw_idx collected in branch_stack.
optional bool no_hw_idx = 24;
// Branch stack hw index,
// optional field in PERF_SAMPLE_BRANCH_STACK
// used when PERF_SAMPLE_BRANCH_HW_INDEX is set.
optional uint64 branch_stack_hw_idx = 25;
// Weight struct.
optional WeightStruct weight_struct = 26;
}
// ForkEvent is used for both FORK and EXIT events, which have the same data
// format. We don't want to call this "ForkOrExitEvent", in case a separate
// exit event is introduced in the future.
// Next tag: 12
message ForkEvent {
// Forked process ID.
optional uint32 pid = 1;
// Parent process ID.
optional uint32 ppid = 2;
// Forked process thread ID.
optional uint32 tid = 3;
// Parent process thread ID.
optional uint32 ptid = 4;
// Time of fork event in nanoseconds since bootup.
optional uint64 fork_time_ns = 5;
// Info about the perf sample containing this event.
optional SampleInfo sample_info = 11;
}
// The kernel collects the number of events it couldn't send in a stretch and
// when possible sends this number in a PERF_RECORD_LOST event, which is
// stored in LostEvent.
// Next tag: 4
message LostEvent {
// ID of the event which has been lost. This should be an id found in a
// PerfFileAttr.
optional uint64 id = 1;
// Number of events that were lost.
optional uint64 lost = 2;
// Info about the perf sample containing this event.
optional SampleInfo sample_info = 3;
}
// Next tag: 5
message ThrottleEvent {
// Time of throttle event, in nanoseconds since system startup.
optional uint64 time_ns = 1;
// Event ID.
optional uint64 id = 2;
// Stream ID.
optional uint64 stream_id = 3;
// Info about the perf sample containing this event.
optional SampleInfo sample_info = 4;
}
// Next tag: 8
message ReadEvent {
option deprecated = true;
// Process ID.
optional uint32 pid = 1;
// Thread ID.
optional uint32 tid = 2;
// Value of the event counter when it was queried.
optional uint64 value = 3;
// Time enabled.
optional uint64 time_enabled = 4;
// Time running.
optional uint64 time_running = 5;
// ID.
optional uint64 id = 6;
// Info about the perf sample containing this event.
optional SampleInfo sample_info = 7;
}
// Next tag: 7
message AuxEvent {
// Aux offset.
optional uint64 aux_offset = 1;
// Aux size.
optional uint64 aux_size = 2;
// Is the record was truncated to fit.
optional bool is_truncated = 3;
// Does the record contain snapshot from overwrite mode.
optional bool is_overwrite = 4;
// Does the record contain gaps.
optional bool is_partial = 5;
// Info about the perf sample containing this event.
optional SampleInfo sample_info = 6;
}
// Next tag: 3
message AuxtraceInfoEvent {
// Auxtrace type from the auxtrace_type enum in tools/perf/util/auxtrace.h.
optional uint32 type = 1;
// Private data.
// WARNING: unparsed_binary_blob_priv_data contains unparsed private data
// specific to the type stored in the above field. This data is included to
// support serialization of a perf.data to perf_data.proto and
// deserialization of a perf_data.proto to perf.data. If this data is used
// for something other than the aforementioned usecase, this data has to be
// parsed based on the type.
// For example:
// If type == PERF_AUXTRACE_INTEL_PT, unparsed_binary_blob_priv_data
// contains fields filled by intel_pt_info_fill() function in the file
// tools/perf/arch/x86/util/intel-pt.c.
// If type == PERF_AUXTRACE_INTEL_BTS, unparsed_binary_blob_priv_data
// contains fields filled by intel_bts_info_fill() function in the file
// tools/perf/arch/x86/util/intel-bts.c.
//
// NOTE: Do not read this unparsed data directly. Quipper should be
// modified to parse the data into a new field before reading. Please
// contact developers of quipper to add support for parsing this data.
//
repeated uint64 unparsed_binary_blob_priv_data = 2;
}
// Next tag: 8
message AuxtraceEvent {
// Size of AUX area tracing buffer.
optional uint64 size = 1;
// Offset as determined by aux_head / aux_tail members of struct
// perf_event_mmap_page.
optional uint64 offset = 2;
// Implementation specific reference determined when the data is recorded.
optional uint64 reference = 3;
// Index of AUX area tracing data buffer.
optional uint32 idx = 4;
// In per-thread mode, the tid this buffer is associated with.
optional uint32 tid = 5;
// In per-cpu mode, the cpu this buffer is associated with.
optional uint32 cpu = 6;
// The trace data.
optional bytes trace_data = 7;
}
// Next tag: 9
message AuxtraceErrorEvent {
// Error type as defined by the enum auxtrace_error_type_name.
optional uint32 type = 1;
// Intel PT or Intel BTS specific error code.
optional uint32 code = 2;
// In per-cpu mode, the cpu this auxtrace error is associated with.
optional uint32 cpu = 3;
// Process ID.
optional uint32 pid = 4;
// In per-thread mode, the tid this auxtrace error is associated with.
optional uint32 tid = 5;
// From instruction pointer.
optional uint64 ip = 6;
// Auxtrace error message.
optional string msg = 7;
// Message's md5 prefix.
optional uint64 msg_md5_prefix = 8;
}
// Next tag: 4
message ItraceStartEvent {
optional uint32 pid = 1;
optional uint32 tid = 2;
// Info about the perf sample containing this event.
optional SampleInfo sample_info = 3;
}
// The kernel discards mixed up samples and sends the number in a
// PERF_RECORD_LOST_SAMPLES event. This event is stored in LostSamplesEvent.
// Next tag: 3
message LostSamplesEvent {
// Number of lost samples.
optional uint64 num_lost = 1;
// Info about the perf sample containing this event.
optional SampleInfo sample_info = 2;
}
// Next tag: 5
message ContextSwitchEvent {
// Indicates whether the context switch is in or out.
optional bool is_out = 1;
// Next (switching out) or previous (switching in) pid.
optional uint32 next_prev_pid = 2;
// Next (switching out) or previous (switching in) tid.
optional uint32 next_prev_tid = 3;
// Info about the perf sample containing this event.
optional SampleInfo sample_info = 4;
}
// Next tag: 3
message PerfNamespacesLinkInfo {
// ID of device containing file.
optional uint64 dev = 1;
// inode number.
optional uint64 ino = 2;
}
// Next tag: 5
message NamespacesEvent {
// PID of the process mapped to these namespaces.
optional uint32 pid = 1;
// TID of the process mapped to these namespaces.
optional uint32 tid = 2;
// Device/inode information per namespace up to NR_NAMESPACES.
repeated PerfNamespacesLinkInfo link_info = 3;
// Info about the perf sample containing this event.
optional SampleInfo sample_info = 4;
}
// Next Tag: 4
message ThreadMapEventEntry {
optional uint64 pid = 1;
// Thread name.
optional string comm = 2;
// Thread name's md5 prefix.
optional uint64 comm_md5_prefix = 3;
}
// Next Tag: 2
message ThreadMapEvent {
repeated ThreadMapEventEntry entries = 1;
}
// Next Tag: 3
message StatConfigEventEntry {
// An enum value representing a field in the struct perf_stat_config.
optional uint64 tag = 1;
// Value of the field represented by the enum value in tag.
optional uint64 val = 2;
}
// Next Tag: 2
message StatConfigEvent {
// Key-value entries representing some fields of the struct
// perf_stat_config.
repeated StatConfigEventEntry data = 1;
}
// Next Tag: 7
message StatEvent {
// Perf sample identifier.
optional uint64 id = 1;
// CPU for which the performance statistics was collected.
optional uint32 cpu = 2;
// Thread for which the performance statistics was collected.
optional uint32 thread = 3;
// Counter value.
optional uint64 value = 4;
// Number of times the counter was enabled.
optional uint64 enabled = 5;
// Number of times the counter was running.
optional uint64 running = 6;
}
// Next Tag: 3
message StatRoundEvent {
// Type is an enumeration defining the type of stat round described at:
// $kernel/tools/perf/util/event.h.
// Example types are:
// PERF_STAT_ROUND_TYPE__INTERVAL
// PERF_STAT_ROUND_TYPE__FINAL
optional uint64 type = 1;
// Time taken in nanoseconds by the type of stat round.
optional uint64 time = 2;
}
// Next tag: 4
message CgroupEvent {
// Cgroup ID (file handle).
optional uint64 id = 1;
// Cgroup path.
optional string path = 2;
// Info about the perf sample containing this event.
optional SampleInfo sample_info = 3;
}
// Time members to convert between TSC and perf time.
// Next tag: 8
message TimeConvEvent {
// Time shift value.
optional uint64 time_shift = 1;
// Time multiplier.
optional uint64 time_mult = 2;
// Base time.
optional uint64 time_zero = 3;
// Fields added in perf 5.10.
optional uint64 time_cycles = 4;
optional uint64 time_mask = 5;
optional bool cap_user_time_zero = 6;
optional bool cap_user_time_short = 7;
}
// Next tag: 4
message EventHeader {
// Type of event.
optional uint32 type = 1;
optional uint32 misc = 2;
// Size of event.
optional uint32 size = 3;
}
// Next tag: 25
message PerfEvent {
optional EventHeader header = 1;
oneof event_type {
MMapEvent mmap_event = 2;
SampleEvent sample_event = 3;
CommEvent comm_event = 4;
// FORK and EXIT events are structurally identical. They only differ by
// the event type. But using two distinct fields allows us to
// differentiate between them without having to check the event type under
// |header|.
ForkEvent fork_event = 5;
ForkEvent exit_event = 9;
LostEvent lost_event = 6;
ThrottleEvent throttle_event = 7;
ReadEvent read_event = 8 [deprecated = true];
AuxEvent aux_event = 11;
ItraceStartEvent itrace_start_event = 13;
LostSamplesEvent lost_samples_event = 14;
ContextSwitchEvent context_switch_event = 15;
NamespacesEvent namespaces_event = 16;
AuxtraceInfoEvent auxtrace_info_event = 18;
AuxtraceEvent auxtrace_event = 12;
AuxtraceErrorEvent auxtrace_error_event = 19;
ThreadMapEvent thread_map_event = 20;
TimeConvEvent time_conv_event = 17;
StatConfigEvent stat_config_event = 21;
StatEvent stat_event = 22;
StatRoundEvent stat_round_event = 23;
CgroupEvent cgroup_event = 24;
}
// Time after boot in nanoseconds corresponding to the event.
optional uint64 timestamp = 10;
}
// Next tag: 8
message PerfEventStats {
// Total number of events read from perf data.
optional uint32 num_events_read = 1;
// Total number of various types of events.
optional uint32 num_sample_events = 2;
optional uint32 num_mmap_events = 3;
optional uint32 num_fork_events = 4;
optional uint32 num_exit_events = 5;
// Number of sample events that were successfully mapped by the address
// mapper, a quipper module that is used to obscure addresses and convert
// them to DSO name + offset. Sometimes it fails to process sample events.
// This field allows us to track the success rate of the address mapper.
optional uint32 num_sample_events_mapped = 6;
// Whether address remapping was enabled.
optional bool did_remap = 7;
}
// Next tag: 3
message PerfUint32Metadata {
// Type of metadata, such as nrcpus.
optional uint32 type = 1;
// uint32 data.
repeated uint32 data = 2;
}
// Next tag: 3
message PerfUint64Metadata {
// Type of metadata, such as totalmem.
optional uint32 type = 1;
// uint64 data.
repeated uint64 data = 2;
}
// Next tag: 3
message PerfTracingMetadata {
// The trace event metadata.
optional bytes tracing_data = 1;
// Trace event metedata Md5sum prefix.
// Deprecated as md5prefix of blob data is not useful.
optional uint64 tracing_data_md5_prefix = 2 [deprecated = true];
}
// Next tag: 7
message PerfBuildID {
// Misc field in perf_event_header.
optional uint32 misc = 1;
// Process ID.
optional uint32 pid = 2;
// Build id. Should always contain kBuildIDArraySize bytes of data.
// perf_reader.h defines kBuildIDArraySize = 20.
optional bytes build_id_hash = 3;
// Filename.
optional string filename = 4;
// Filename Md5sum prefix.
optional uint64 filename_md5_prefix = 5;
// Build id size.
optional uint32 size = 6;
}
// Next tag: 6
message PerfCPUTopologyMetadata {
// Core siblings.
repeated string core_siblings = 1;
// Core siblings' md5 prefixes.
repeated uint64 core_siblings_md5_prefix = 2;
// Thread siblings.
repeated string thread_siblings = 3;
// Thread siblings' md5 prefixes.
repeated uint64 thread_siblings_md5_prefix = 4;
// Core ID and Socket ID per CPU.
message CPU {
// Core ID
optional uint32 core_id = 1;
// Socket ID
optional uint32 socket_id = 2;
}
repeated CPU available_cpus = 5;
}
// Next tag: 6
message PerfNodeTopologyMetadata {
// Node id.
optional uint32 id = 1;
// Total memory of the node.
optional uint64 total_memory = 2;
// Free memory of the node.
optional uint64 free_memory = 3;
// List of CPUs in the node.
optional string cpu_list = 4;
// CPU list's md5 prefix.
optional uint64 cpu_list_md5_prefix = 5;
}
// Next tag: 4
message PerfPMUMappingsMetadata {
// Mapping type.
optional uint32 type = 1;
// Mapping name.
optional string name = 2;
// Mapping name's md5 prefix.
optional uint64 name_md5_prefix = 3;
}
// Next tag: 5
message PerfGroupDescMetadata {
// Group name.
optional string name = 1;
// Group name's md5 prefix.
optional uint64 name_md5_prefix = 2;
// Group's leader index.
optional uint32 leader_idx = 3;
// Number of members in the group.
optional uint32 num_members = 4;
}
repeated PerfFileAttr file_attrs = 1;
repeated PerfEvent events = 2;
repeated PerfEventType event_types = 10;
// Time when quipper generated this perf data / protobuf, given as seconds
// since the epoch.
optional uint64 timestamp_sec = 3;
// Records some stats about the serialized perf events.
optional PerfEventStats stats = 4;
// Bit mask used to determine what metadata has been included.
// At the moment, only the first number is actually used.
// See adds_features in perf_reader.cc
repeated uint64 metadata_mask = 5;
optional PerfTracingMetadata tracing_data = 14;
repeated PerfBuildID build_ids = 7;
repeated PerfUint32Metadata uint32_metadata = 8;
repeated PerfUint64Metadata uint64_metadata = 9;
optional PerfCPUTopologyMetadata cpu_topology = 11;
repeated PerfNodeTopologyMetadata numa_topology = 12;
repeated PerfPMUMappingsMetadata pmu_mappings = 15;
repeated PerfGroupDescMetadata group_desc = 16;
// Next tag: 9
message StringMetadata {
// Next tag: 3
message StringAndMd5sumPrefix {
// The string value.
optional string value = 1;
// The string value's md5sum prefix.