Hector Dearman | bc8368e | 2018-01-25 17:34:11 +0000 | [diff] [blame] | 1 | // Copyright (C) 2018 The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | #include "benchmark/benchmark.h" |
| 16 | |
| 17 | #include "cpu_reader.h" |
| 18 | |
| 19 | #include "perfetto/protozero/scattered_stream_writer.h" |
| 20 | |
| 21 | #include "perfetto/trace/ftrace/ftrace_event_bundle.pbzero.h" |
| 22 | #include "test/cpu_reader_support.h" |
| 23 | #include "test/scattered_stream_null_delegate.h" |
| 24 | |
| 25 | namespace { |
| 26 | |
| 27 | const size_t kPageSize = 4096; |
| 28 | |
| 29 | perfetto::ExamplePage g_full_page_sched_switch{ |
| 30 | "synthetic", |
| 31 | R"( |
| 32 | 00000000: 31f2 7622 1a00 0000 b40f 0000 0000 0000 1.v"............ |
| 33 | 00000010: 1e00 0000 0000 0000 1000 0000 2f00 0103 ............/... |
| 34 | 00000020: 140d 0000 4a69 7420 7468 7265 6164 2070 ....Jit thread p |
| 35 | 00000030: 6f6f 6c00 140d 0000 8100 0000 0008 0000 ool............. |
| 36 | 00000040: 0000 0000 4576 656e 7454 6872 6561 6400 ....EventThread. |
| 37 | 00000050: 6572 0000 7002 0000 6100 0000 f057 0e00 er..p...a....W.. |
| 38 | 00000060: 2f00 0103 7002 0000 4576 656e 7454 6872 /...p...EventThr |
| 39 | 00000070: 6561 6400 6572 0000 7002 0000 6100 0000 ead.er..p...a... |
| 40 | 00000080: 0100 0000 0000 0000 4a69 7420 7468 7265 ........Jit thre |
| 41 | 00000090: 6164 2070 6f6f 6c00 140d 0000 8100 0000 ad pool......... |
| 42 | 000000a0: 50c2 0910 2f00 0103 140d 0000 4a69 7420 P.../.......Jit |
| 43 | 000000b0: 7468 7265 6164 2070 6f6f 6c00 140d 0000 thread pool..... |
| 44 | 000000c0: 8100 0000 0100 0000 0000 0000 7377 6170 ............swap |
| 45 | 000000d0: 7065 722f 3000 0000 0000 0000 0000 0000 per/0........... |
| 46 | 000000e0: 7800 0000 901a c80e 2f00 0103 0000 0000 x......./....... |
| 47 | 000000f0: 7377 6170 7065 722f 3000 0000 0000 0000 swapper/0....... |
| 48 | 00000100: 0000 0000 7800 0000 0000 0000 0000 0000 ....x........... |
| 49 | 00000110: 4469 7370 5379 6e63 0069 6e67 6572 0000 DispSync.inger.. |
| 50 | 00000120: 6f02 0000 6100 0000 1064 1e00 2f00 0103 o...a....d../... |
| 51 | 00000130: 6f02 0000 4469 7370 5379 6e63 0069 6e67 o...DispSync.ing |
| 52 | 00000140: 6572 0000 6f02 0000 6100 0000 0100 0000 er..o...a....... |
| 53 | 00000150: 0000 0000 7377 6170 7065 722f 3000 0000 ....swapper/0... |
| 54 | 00000160: 0000 0000 0000 0000 7800 0000 9074 8600 ........x....t.. |
| 55 | 00000170: 2f00 0103 0000 0000 7377 6170 7065 722f /.......swapper/ |
| 56 | 00000180: 3000 0000 0000 0000 0000 0000 7800 0000 0...........x... |
| 57 | 00000190: 0000 0000 0000 0000 4576 656e 7454 6872 ........EventThr |
| 58 | 000001a0: 6561 6400 6572 0000 7002 0000 6100 0000 ead.er..p...a... |
| 59 | 000001b0: d071 0b00 2f00 0103 7002 0000 4576 656e .q../...p...Even |
| 60 | 000001c0: 7454 6872 6561 6400 6572 0000 7002 0000 tThread.er..p... |
| 61 | 000001d0: 6100 0000 0100 0000 0000 0000 7377 6170 a...........swap |
| 62 | 000001e0: 7065 722f 3000 0000 0000 0000 0000 0000 per/0........... |
| 63 | 000001f0: 7800 0000 10cd 4504 2f00 0103 0000 0000 x.....E./....... |
| 64 | 00000200: 7377 6170 7065 722f 3000 0000 0000 0000 swapper/0....... |
| 65 | 00000210: 0000 0000 7800 0000 0000 0000 0000 0000 ....x........... |
| 66 | 00000220: 7375 676f 763a 3000 0000 0000 0000 0000 sugov:0......... |
| 67 | 00000230: 3802 0000 3100 0000 30d6 1300 2f00 0103 8...1...0.../... |
| 68 | 00000240: 3802 0000 7375 676f 763a 3000 0000 0000 8...sugov:0..... |
| 69 | 00000250: 0000 0000 3802 0000 3100 0000 0100 0000 ....8...1....... |
| 70 | 00000260: 0000 0000 7377 6170 7065 722f 3000 0000 ....swapper/0... |
| 71 | 00000270: 0000 0000 0000 0000 7800 0000 3049 a202 ........x...0I.. |
| 72 | 00000280: 2f00 0103 0000 0000 7377 6170 7065 722f /.......swapper/ |
| 73 | 00000290: 3000 0000 0000 0000 0000 0000 7800 0000 0...........x... |
| 74 | 000002a0: 0000 0000 0000 0000 4469 7370 5379 6e63 ........DispSync |
| 75 | 000002b0: 0069 6e67 6572 0000 6f02 0000 6100 0000 .inger..o...a... |
| 76 | 000002c0: d07a 1000 2f00 0103 6f02 0000 4469 7370 .z../...o...Disp |
| 77 | 000002d0: 5379 6e63 0069 6e67 6572 0000 6f02 0000 Sync.inger..o... |
| 78 | 000002e0: 6100 0000 0100 0000 0000 0000 7377 6170 a...........swap |
| 79 | 000002f0: 7065 722f 3000 0000 0000 0000 0000 0000 per/0........... |
| 80 | 00000300: 7800 0000 d085 1100 2f00 0103 0000 0000 x......./....... |
| 81 | 00000310: 7377 6170 7065 722f 3000 0000 0000 0000 swapper/0....... |
| 82 | 00000320: 0000 0000 7800 0000 0000 0000 0000 0000 ....x........... |
| 83 | 00000330: 7375 7266 6163 6566 6c69 6e67 6572 0000 surfaceflinger.. |
| 84 | 00000340: 4b02 0000 6200 0000 907a f000 2f00 0103 K...b....z../... |
| 85 | 00000350: 4b02 0000 7375 7266 6163 6566 6c69 6e67 K...surfacefling |
| 86 | 00000360: 6572 0000 4b02 0000 6200 0000 0100 0000 er..K...b....... |
| 87 | 00000370: 0000 0000 7377 6170 7065 722f 3000 0000 ....swapper/0... |
| 88 | 00000380: 0000 0000 0000 0000 7800 0000 305a 6400 ........x...0Zd. |
| 89 | 00000390: 2f00 0103 0000 0000 7377 6170 7065 722f /.......swapper/ |
| 90 | 000003a0: 3000 0000 0000 0000 0000 0000 7800 0000 0...........x... |
| 91 | 000003b0: 0000 0000 0000 0000 6d64 7373 5f66 6230 ........mdss_fb0 |
| 92 | 000003c0: 0000 0000 0000 0000 5714 0000 5300 0000 ........W...S... |
| 93 | 000003d0: 10b1 9e03 2f00 0103 5714 0000 6d64 7373 ..../...W...mdss |
| 94 | 000003e0: 5f66 6230 0000 0000 0000 0000 5714 0000 _fb0........W... |
| 95 | 000003f0: 5300 0000 0200 0000 0000 0000 6b73 6f66 S...........ksof |
| 96 | 00000400: 7469 7271 642f 3000 0000 0000 0300 0000 tirqd/0......... |
| 97 | 00000410: 7800 0000 90bb 9900 2f00 0103 0300 0000 x......./....... |
| 98 | 00000420: 6b73 6f66 7469 7271 642f 3000 0000 0000 ksoftirqd/0..... |
| 99 | 00000430: 0300 0000 7800 0000 0100 0000 0000 0000 ....x........... |
| 100 | 00000440: 7377 6170 7065 722f 3000 0000 0000 0000 swapper/0....... |
| 101 | 00000450: 0000 0000 7800 0000 701e 5305 2f00 0103 ....x...p.S./... |
| 102 | 00000460: 0000 0000 7377 6170 7065 722f 3000 0000 ....swapper/0... |
| 103 | 00000470: 0000 0000 0000 0000 7800 0000 0000 0000 ........x....... |
| 104 | 00000480: 0000 0000 6b77 6f72 6b65 722f 7531 363a ....kworker/u16: |
| 105 | 00000490: 3600 0000 6401 0000 7800 0000 90a1 2900 6...d...x.....). |
| 106 | 000004a0: 2f00 0103 6401 0000 6b77 6f72 6b65 722f /...d...kworker/ |
| 107 | 000004b0: 7531 363a 3600 0000 6401 0000 7800 0000 u16:6...d...x... |
| 108 | 000004c0: 0200 0000 0000 0000 7377 6170 7065 722f ........swapper/ |
| 109 | 000004d0: 3000 0000 0000 0000 0000 0000 7800 0000 0...........x... |
| 110 | 000004e0: b0e5 4f04 2f00 0103 0000 0000 7377 6170 ..O./.......swap |
| 111 | 000004f0: 7065 722f 3000 0000 0000 0000 0000 0000 per/0........... |
| 112 | 00000500: 7800 0000 0000 0000 0000 0000 4269 6e64 x...........Bind |
| 113 | 00000510: 6572 3a32 3136 385f 3135 0000 e614 0000 er:2168_15...... |
| 114 | 00000520: 7800 0000 b0bd 7c00 2f00 0103 e614 0000 x.....|./....... |
| 115 | 00000530: 4269 6e64 6572 3a32 3136 385f 3135 0000 Binder:2168_15.. |
| 116 | 00000540: e614 0000 7800 0000 0100 0000 0000 0000 ....x........... |
| 117 | 00000550: 7377 6170 7065 722f 3000 0000 0000 0000 swapper/0....... |
| 118 | 00000560: 0000 0000 7800 0000 d0bd 7e01 2f00 0103 ....x.....~./... |
| 119 | 00000570: 0000 0000 7377 6170 7065 722f 3000 0000 ....swapper/0... |
| 120 | 00000580: 0000 0000 0000 0000 7800 0000 0000 0000 ........x....... |
| 121 | 00000590: 0000 0000 6b77 6f72 6b65 722f 7531 363a ....kworker/u16: |
| 122 | 000005a0: 3900 0000 e204 0000 7800 0000 7016 0800 9.......x...p... |
| 123 | 000005b0: 2f00 0103 e204 0000 6b77 6f72 6b65 722f /.......kworker/ |
| 124 | 000005c0: 7531 363a 3900 0000 e204 0000 7800 0000 u16:9.......x... |
| 125 | 000005d0: 0100 0000 0000 0000 7377 6170 7065 722f ........swapper/ |
| 126 | 000005e0: 3000 0000 0000 0000 0000 0000 7800 0000 0...........x... |
| 127 | 000005f0: 1004 5200 2f00 0103 0000 0000 7377 6170 ..R./.......swap |
| 128 | 00000600: 7065 722f 3000 0000 0000 0000 0000 0000 per/0........... |
| 129 | 00000610: 7800 0000 0000 0000 0000 0000 6b77 6f72 x...........kwor |
| 130 | 00000620: 6b65 722f 7531 363a 3900 0000 e204 0000 ker/u16:9....... |
| 131 | 00000630: 7800 0000 d0db 0700 2f00 0103 e204 0000 x......./....... |
| 132 | 00000640: 6b77 6f72 6b65 722f 7531 363a 3900 0000 kworker/u16:9... |
| 133 | 00000650: e204 0000 7800 0000 0100 0000 0000 0000 ....x........... |
| 134 | 00000660: 7377 6170 7065 722f 3000 0000 0000 0000 swapper/0....... |
| 135 | 00000670: 0000 0000 7800 0000 b0a2 8c00 2f00 0103 ....x......./... |
| 136 | 00000680: 0000 0000 7377 6170 7065 722f 3000 0000 ....swapper/0... |
| 137 | 00000690: 0000 0000 0000 0000 7800 0000 0000 0000 ........x....... |
| 138 | 000006a0: 0000 0000 6b77 6f72 6b65 722f 7531 363a ....kworker/u16: |
| 139 | 000006b0: 3900 0000 e204 0000 7800 0000 d02b 0400 9.......x....+.. |
| 140 | 000006c0: 2f00 0103 e204 0000 6b77 6f72 6b65 722f /.......kworker/ |
| 141 | 000006d0: 7531 363a 3900 0000 e204 0000 7800 0000 u16:9.......x... |
| 142 | 000006e0: 0100 0000 0000 0000 7377 6170 7065 722f ........swapper/ |
| 143 | 000006f0: 3000 0000 0000 0000 0000 0000 7800 0000 0...........x... |
| 144 | 00000700: d064 ef05 2f00 0103 0000 0000 7377 6170 .d../.......swap |
| 145 | 00000710: 7065 722f 3000 0000 0000 0000 0000 0000 per/0........... |
| 146 | 00000720: 7800 0000 0000 0000 0000 0000 4469 7370 x...........Disp |
| 147 | 00000730: 5379 6e63 0069 6e67 6572 0000 6f02 0000 Sync.inger..o... |
| 148 | 00000740: 6100 0000 f07d 1b00 2f00 0103 6f02 0000 a....}../...o... |
| 149 | 00000750: 4469 7370 5379 6e63 0069 6e67 6572 0000 DispSync.inger.. |
| 150 | 00000760: 6f02 0000 6100 0000 0100 0000 0000 0000 o...a........... |
| 151 | 00000770: 6b73 6f66 7469 7271 642f 3000 0000 0000 ksoftirqd/0..... |
| 152 | 00000780: 0300 0000 7800 0000 304c 2000 2f00 0103 ....x...0L ./... |
| 153 | 00000790: 0300 0000 6b73 6f66 7469 7271 642f 3000 ....ksoftirqd/0. |
| 154 | 000007a0: 0000 0000 0300 0000 7800 0000 0100 0000 ........x....... |
| 155 | 000007b0: 0000 0000 6465 7832 6f61 7400 3935 5f33 ....dex2oat.95_3 |
| 156 | 000007c0: 0000 0000 341f 0000 8200 0000 700b 0700 ....4.......p... |
| 157 | 000007d0: 2f00 0103 341f 0000 6465 7832 6f61 7400 /...4...dex2oat. |
| 158 | 000007e0: 3935 5f33 0000 0000 341f 0000 8200 0000 95_3....4....... |
| 159 | 000007f0: 0000 0000 0000 0000 7375 676f 763a 3000 ........sugov:0. |
| 160 | 00000800: 0000 0000 0000 0000 3802 0000 3100 0000 ........8...1... |
| 161 | 00000810: 50b0 0600 2f00 0103 3802 0000 7375 676f P.../...8...sugo |
| 162 | 00000820: 763a 3000 0000 0000 0000 0000 3802 0000 v:0.........8... |
| 163 | 00000830: 3100 0000 0008 0000 0000 0000 6d69 6772 1...........migr |
| 164 | 00000840: 6174 696f 6e2f 3000 0000 0000 0d00 0000 ation/0......... |
| 165 | 00000850: 0000 0000 d09c 0600 2f00 0103 0d00 0000 ......../....... |
| 166 | 00000860: 6d69 6772 6174 696f 6e2f 3000 0000 0000 migration/0..... |
| 167 | 00000870: 0d00 0000 0000 0000 0100 0000 0000 0000 ................ |
| 168 | 00000880: 7375 676f 763a 3000 0000 0000 0000 0000 sugov:0......... |
| 169 | 00000890: 3802 0000 3100 0000 7061 1900 2f00 0103 8...1...pa../... |
| 170 | 000008a0: 3802 0000 7375 676f 763a 3000 0000 0000 8...sugov:0..... |
| 171 | 000008b0: 0000 0000 3802 0000 3100 0000 0100 0000 ....8...1....... |
| 172 | 000008c0: 0000 0000 6465 7832 6f61 7400 3935 5f33 ....dex2oat.95_3 |
| 173 | 000008d0: 0000 0000 341f 0000 8200 0000 f03c 5600 ....4........<V. |
| 174 | 000008e0: 2f00 0103 341f 0000 6465 7832 6f61 7400 /...4...dex2oat. |
| 175 | 000008f0: 3935 5f33 0000 0000 341f 0000 8200 0000 95_3....4....... |
| 176 | 00000900: 0200 0000 0000 0000 7377 6170 7065 722f ........swapper/ |
| 177 | 00000910: 3000 0000 0000 0000 0000 0000 7800 0000 0...........x... |
| 178 | 00000920: 5013 c400 2f00 0103 0000 0000 7377 6170 P.../.......swap |
| 179 | 00000930: 7065 722f 3000 0000 0000 0000 0000 0000 per/0........... |
| 180 | 00000940: 7800 0000 0000 0000 0000 0000 616e 6472 x...........andr |
| 181 | 00000950: 6f69 642e 6861 7264 7761 7200 d20a 0000 oid.hardwar..... |
| 182 | 00000960: 7800 0000 30c9 1300 2f00 0103 d20a 0000 x...0.../....... |
| 183 | 00000970: 616e 6472 6f69 642e 6861 7264 7761 7200 android.hardwar. |
| 184 | 00000980: d20a 0000 7800 0000 0100 0000 0000 0000 ....x........... |
| 185 | 00000990: 7377 6170 7065 722f 3000 0000 0000 0000 swapper/0....... |
| 186 | 000009a0: 0000 0000 7800 0000 7097 c000 2f00 0103 ....x...p.../... |
| 187 | 000009b0: 0000 0000 7377 6170 7065 722f 3000 0000 ....swapper/0... |
| 188 | 000009c0: 0000 0000 0000 0000 7800 0000 0000 0000 ........x....... |
| 189 | 000009d0: 0000 0000 616e 6472 6f69 642e 6861 7264 ....android.hard |
| 190 | 000009e0: 7761 7200 d20a 0000 7800 0000 305c 0c00 war.....x...0\.. |
| 191 | 000009f0: 2f00 0103 d20a 0000 616e 6472 6f69 642e /.......android. |
| 192 | 00000a00: 6861 7264 7761 7200 d20a 0000 7800 0000 hardwar.....x... |
| 193 | 00000a10: 0100 0000 0000 0000 7377 6170 7065 722f ........swapper/ |
| 194 | 00000a20: 3000 0000 0000 0000 0000 0000 7800 0000 0...........x... |
| 195 | 00000a30: d0aa 1401 2f00 0103 0000 0000 7377 6170 ..../.......swap |
| 196 | 00000a40: 7065 722f 3000 0000 0000 0000 0000 0000 per/0........... |
| 197 | 00000a50: 7800 0000 0000 0000 0000 0000 616e 6472 x...........andr |
| 198 | 00000a60: 6f69 642e 6861 7264 7761 7200 d20a 0000 oid.hardwar..... |
| 199 | 00000a70: 7800 0000 903b 0c00 2f00 0103 d20a 0000 x....;../....... |
| 200 | 00000a80: 616e 6472 6f69 642e 6861 7264 7761 7200 android.hardwar. |
| 201 | 00000a90: d20a 0000 7800 0000 0100 0000 0000 0000 ....x........... |
| 202 | 00000aa0: 7377 6170 7065 722f 3000 0000 0000 0000 swapper/0....... |
| 203 | 00000ab0: 0000 0000 7800 0000 f024 5401 2f00 0103 ....x....$T./... |
| 204 | 00000ac0: 0000 0000 7377 6170 7065 722f 3000 0000 ....swapper/0... |
| 205 | 00000ad0: 0000 0000 0000 0000 7800 0000 0000 0000 ........x....... |
| 206 | 00000ae0: 0000 0000 616e 6472 6f69 642e 6861 7264 ....android.hard |
| 207 | 00000af0: 7761 7200 d20a 0000 7800 0000 f0f3 0b00 war.....x....... |
| 208 | 00000b00: 2f00 0103 d20a 0000 616e 6472 6f69 642e /.......android. |
| 209 | 00000b10: 6861 7264 7761 7200 d20a 0000 7800 0000 hardwar.....x... |
| 210 | 00000b20: 0100 0000 0000 0000 7377 6170 7065 722f ........swapper/ |
| 211 | 00000b30: 3000 0000 0000 0000 0000 0000 7800 0000 0...........x... |
| 212 | 00000b40: d0b5 bf02 2f00 0103 0000 0000 7377 6170 ..../.......swap |
| 213 | 00000b50: 7065 722f 3000 0000 0000 0000 0000 0000 per/0........... |
| 214 | 00000b60: 7800 0000 0000 0000 0000 0000 4469 7370 x...........Disp |
| 215 | 00000b70: 5379 6e63 0069 6e67 6572 0000 6f02 0000 Sync.inger..o... |
| 216 | 00000b80: 6100 0000 90cd 1400 2f00 0103 6f02 0000 a......./...o... |
| 217 | 00000b90: 4469 7370 5379 6e63 0069 6e67 6572 0000 DispSync.inger.. |
| 218 | 00000ba0: 6f02 0000 6100 0000 0100 0000 0000 0000 o...a........... |
| 219 | 00000bb0: 7377 6170 7065 722f 3000 0000 0000 0000 swapper/0....... |
| 220 | 00000bc0: 0000 0000 7800 0000 50a6 1100 2f00 0103 ....x...P.../... |
| 221 | 00000bd0: 0000 0000 7377 6170 7065 722f 3000 0000 ....swapper/0... |
| 222 | 00000be0: 0000 0000 0000 0000 7800 0000 0000 0000 ........x....... |
| 223 | 00000bf0: 0000 0000 7375 7266 6163 6566 6c69 6e67 ....surfacefling |
| 224 | 00000c00: 6572 0000 4b02 0000 6200 0000 b04c 4200 er..K...b....LB. |
| 225 | 00000c10: 2f00 0103 4b02 0000 7375 7266 6163 6566 /...K...surfacef |
| 226 | 00000c20: 6c69 6e67 6572 0000 4b02 0000 6200 0000 linger..K...b... |
| 227 | 00000c30: 0100 0000 0000 0000 7377 6170 7065 722f ........swapper/ |
| 228 | 00000c40: 3000 0000 0000 0000 0000 0000 7800 0000 0...........x... |
| 229 | 00000c50: b025 060a 2f00 0103 0000 0000 7377 6170 .%../.......swap |
| 230 | 00000c60: 7065 722f 3000 0000 0000 0000 0000 0000 per/0........... |
| 231 | 00000c70: 7800 0000 0000 0000 0000 0000 6b77 6f72 x...........kwor |
| 232 | 00000c80: 6b65 722f 7531 363a 3600 0000 6401 0000 ker/u16:6...d... |
| 233 | 00000c90: 7800 0000 d0b6 0600 2f00 0103 6401 0000 x......./...d... |
| 234 | 00000ca0: 6b77 6f72 6b65 722f 7531 363a 3600 0000 kworker/u16:6... |
| 235 | 00000cb0: 6401 0000 7800 0000 0100 0000 0000 0000 d...x........... |
| 236 | 00000cc0: 7377 6170 7065 722f 3000 0000 0000 0000 swapper/0....... |
| 237 | 00000cd0: 0000 0000 7800 0000 f0a0 5800 2f00 0103 ....x.....X./... |
| 238 | 00000ce0: 0000 0000 7377 6170 7065 722f 3000 0000 ....swapper/0... |
| 239 | 00000cf0: 0000 0000 0000 0000 7800 0000 0000 0000 ........x....... |
| 240 | 00000d00: 0000 0000 6b77 6f72 6b65 722f 7531 363a ....kworker/u16: |
| 241 | 00000d10: 3600 0000 6401 0000 7800 0000 f07a 1300 6...d...x....z.. |
| 242 | 00000d20: 2f00 0103 6401 0000 6b77 6f72 6b65 722f /...d...kworker/ |
| 243 | 00000d30: 7531 363a 3600 0000 6401 0000 7800 0000 u16:6...d...x... |
| 244 | 00000d40: 0100 0000 0000 0000 7377 6170 7065 722f ........swapper/ |
| 245 | 00000d50: 3000 0000 0000 0000 0000 0000 7800 0000 0...........x... |
| 246 | 00000d60: b080 b101 2f00 0103 0000 0000 7377 6170 ..../.......swap |
| 247 | 00000d70: 7065 722f 3000 0000 0000 0000 0000 0000 per/0........... |
| 248 | 00000d80: 7800 0000 0000 0000 0000 0000 6b77 6f72 x...........kwor |
| 249 | 00000d90: 6b65 722f 7531 363a 3600 0000 6401 0000 ker/u16:6...d... |
| 250 | 00000da0: 7800 0000 103c 1200 2f00 0103 6401 0000 x....<../...d... |
| 251 | 00000db0: 6b77 6f72 6b65 722f 7531 363a 3600 0000 kworker/u16:6... |
| 252 | 00000dc0: 6401 0000 7800 0000 0100 0000 0000 0000 d...x........... |
| 253 | 00000dd0: 7377 6170 7065 722f 3000 0000 0000 0000 swapper/0....... |
| 254 | 00000de0: 0000 0000 7800 0000 50ea 3800 2f00 0103 ....x...P.8./... |
| 255 | 00000df0: 0000 0000 7377 6170 7065 722f 3000 0000 ....swapper/0... |
| 256 | 00000e00: 0000 0000 0000 0000 7800 0000 0000 0000 ........x....... |
| 257 | 00000e10: 0000 0000 6b77 6f72 6b65 722f 7531 363a ....kworker/u16: |
| 258 | 00000e20: 3600 0000 6401 0000 7800 0000 5032 0400 6...d...x...P2.. |
| 259 | 00000e30: 2f00 0103 6401 0000 6b77 6f72 6b65 722f /...d...kworker/ |
| 260 | 00000e40: 7531 363a 3600 0000 6401 0000 7800 0000 u16:6...d...x... |
| 261 | 00000e50: 0100 0000 0000 0000 7377 6170 7065 722f ........swapper/ |
| 262 | 00000e60: 3000 0000 0000 0000 0000 0000 7800 0000 0...........x... |
| 263 | 00000e70: 70f5 9000 2f00 0103 0000 0000 7377 6170 p.../.......swap |
| 264 | 00000e80: 7065 722f 3000 0000 0000 0000 0000 0000 per/0........... |
| 265 | 00000e90: 7800 0000 0000 0000 0000 0000 6b77 6f72 x...........kwor |
| 266 | 00000ea0: 6b65 722f 7531 363a 3600 0000 6401 0000 ker/u16:6...d... |
| 267 | 00000eb0: 7800 0000 10d7 0300 2f00 0103 6401 0000 x......./...d... |
| 268 | 00000ec0: 6b77 6f72 6b65 722f 7531 363a 3600 0000 kworker/u16:6... |
| 269 | 00000ed0: 6401 0000 7800 0000 0100 0000 0000 0000 d...x........... |
| 270 | 00000ee0: 7377 6170 7065 722f 3000 0000 0000 0000 swapper/0....... |
| 271 | 00000ef0: 0000 0000 7800 0000 907c 0900 2f00 0103 ....x....|../... |
| 272 | 00000f00: 0000 0000 7377 6170 7065 722f 3000 0000 ....swapper/0... |
| 273 | 00000f10: 0000 0000 0000 0000 7800 0000 0000 0000 ........x....... |
| 274 | 00000f20: 0000 0000 6b77 6f72 6b65 722f 7531 363a ....kworker/u16: |
| 275 | 00000f30: 3600 0000 6401 0000 7800 0000 7082 0300 6...d...x...p... |
| 276 | 00000f40: 2f00 0103 6401 0000 6b77 6f72 6b65 722f /...d...kworker/ |
| 277 | 00000f50: 7531 363a 3600 0000 6401 0000 7800 0000 u16:6...d...x... |
| 278 | 00000f60: 0100 0000 0000 0000 7377 6170 7065 722f ........swapper/ |
| 279 | 00000f70: 3000 0000 0000 0000 0000 0000 7800 0000 0...........x... |
| 280 | 00000f80: f0ec 2100 2f00 0103 0000 0000 7377 6170 ..!./.......swap |
| 281 | 00000f90: 7065 722f 3000 0000 0000 0000 0000 0000 per/0........... |
| 282 | 00000fa0: 7800 0000 0000 0000 0000 0000 6b77 6f72 x...........kwor |
| 283 | 00000fb0: 6b65 722f 7531 363a 3600 0000 6401 0000 ker/u16:6...d... |
| 284 | 00000fc0: 7800 0000 0000 0000 0000 0000 0000 0000 x............... |
| 285 | 00000fd0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ |
| 286 | 00000fe0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ |
| 287 | 00000ff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ |
| 288 | )", |
| 289 | }; |
| 290 | |
| 291 | } // namespace |
| 292 | |
| 293 | using perfetto::ExamplePage; |
| 294 | using perfetto::EventFilter; |
| 295 | using perfetto::ProtoTranslationTable; |
| 296 | using perfetto::ScatteredStreamNullDelegate; |
| 297 | using perfetto::GetTable; |
| 298 | using perfetto::PageFromXxd; |
| 299 | using perfetto::protos::pbzero::FtraceEventBundle; |
| 300 | using perfetto::CpuReader; |
| 301 | |
| 302 | static void BM_ParsePageFullOfSchedSwitch(benchmark::State& state) { |
| 303 | const ExamplePage* test_case = &g_full_page_sched_switch; |
| 304 | |
| 305 | ScatteredStreamNullDelegate delegate(kPageSize); |
| 306 | protozero::ScatteredStreamWriter stream(&delegate); |
| 307 | FtraceEventBundle writer; |
| 308 | |
| 309 | ProtoTranslationTable* table = GetTable(test_case->name); |
| 310 | auto page = PageFromXxd(test_case->data); |
| 311 | |
| 312 | EventFilter filter(*table, std::set<std::string>({"sched_switch"})); |
| 313 | |
| 314 | while (state.KeepRunning()) { |
| 315 | writer.Reset(&stream); |
| 316 | CpuReader::ParsePage(42 /* cpu number */, page.get(), &filter, &writer, |
| 317 | table); |
| 318 | } |
| 319 | } |
| 320 | BENCHMARK(BM_ParsePageFullOfSchedSwitch); |