Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EXPERIMENT] perf: use PROCFS_PROCMAP_QUERY API
Teach perf to use binary ioctl-based API to fetch all VMAs for a process. BENCHMARK RESULTS ================= TEXT-BASED ---------- # ./perf-parse bench internals synthesize # Running 'internals/synthesize' benchmark: Computing performance of single threaded perf event synthesis by synthesizing events on the perf process itself: Average synthesis took: 80.311 usec (+- 0.077 usec) Average num. events: 32.000 (+- 0.000) Average time per event 2.510 usec Average data synthesis took: 84.429 usec (+- 0.066 usec) Average num. events: 179.000 (+- 0.000) Average time per event 0.472 usec # ./perf-parse bench internals synthesize # Running 'internals/synthesize' benchmark: Computing performance of single threaded perf event synthesis by synthesizing events on the perf process itself: Average synthesis took: 79.900 usec (+- 0.077 usec) Average num. events: 32.000 (+- 0.000) Average time per event 2.497 usec Average data synthesis took: 84.832 usec (+- 0.074 usec) Average num. events: 180.000 (+- 0.000) Average time per event 0.471 usec # ./perf-parse bench internals synthesize --mt -M 8 # Running 'internals/synthesize' benchmark: Computing performance of multi threaded perf event synthesis by synthesizing events on CPU 0: Number of synthesis threads: 1 Average synthesis took: 36338.100 usec (+- 406.091 usec) Average num. events: 14091.300 (+- 7.433) Average time per event 2.579 usec Number of synthesis threads: 2 Average synthesis took: 37071.200 usec (+- 746.498 usec) Average num. events: 14085.900 (+- 1.900) Average time per event 2.632 usec Number of synthesis threads: 3 Average synthesis took: 33932.300 usec (+- 626.861 usec) Average num. events: 14085.900 (+- 1.900) Average time per event 2.409 usec Number of synthesis threads: 4 Average synthesis took: 33822.700 usec (+- 506.290 usec) Average num. events: 14099.200 (+- 8.761) Average time per event 2.399 usec Number of synthesis threads: 5 Average synthesis took: 33348.200 usec (+- 389.771 usec) Average num. events: 14085.900 (+- 1.900) Average time per event 2.367 usec Number of synthesis threads: 6 Average synthesis took: 33269.600 usec (+- 350.341 usec) Average num. events: 14084.000 (+- 0.000) Average time per event 2.362 usec Number of synthesis threads: 7 Average synthesis took: 32663.900 usec (+- 338.870 usec) Average num. events: 14085.900 (+- 1.900) Average time per event 2.319 usec Number of synthesis threads: 8 Average synthesis took: 32748.400 usec (+- 285.450 usec) Average num. events: 14085.900 (+- 1.900) Average time per event 2.325 usec IOCTL-BASED ----------- # ./perf-ioctl bench internals synthesize # Running 'internals/synthesize' benchmark: Computing performance of single threaded perf event synthesis by synthesizing events on the perf process itself: Average synthesis took: 72.996 usec (+- 0.076 usec) Average num. events: 31.000 (+- 0.000) Average time per event 2.355 usec Average data synthesis took: 79.067 usec (+- 0.074 usec) Average num. events: 178.000 (+- 0.000) Average time per event 0.444 usec # ./perf-ioctl bench internals synthesize # Running 'internals/synthesize' benchmark: Computing performance of single threaded perf event synthesis by synthesizing events on the perf process itself: Average synthesis took: 73.921 usec (+- 0.073 usec) Average num. events: 31.000 (+- 0.000) Average time per event 2.385 usec Average data synthesis took: 80.545 usec (+- 0.070 usec) Average num. events: 178.000 (+- 0.000) Average time per event 0.453 usec # ./perf-ioctl bench internals synthesize --mt -M 8 # Running 'internals/synthesize' benchmark: Computing performance of multi threaded perf event synthesis by synthesizing events on CPU 0: Number of synthesis threads: 1 Average synthesis took: 35609.500 usec (+- 428.576 usec) Average num. events: 14040.700 (+- 1.700) Average time per event 2.536 usec Number of synthesis threads: 2 Average synthesis took: 34293.800 usec (+- 453.811 usec) Average num. events: 14040.700 (+- 1.700) Average time per event 2.442 usec Number of synthesis threads: 3 Average synthesis took: 32385.200 usec (+- 363.106 usec) Average num. events: 14040.700 (+- 1.700) Average time per event 2.307 usec Number of synthesis threads: 4 Average synthesis took: 33113.100 usec (+- 553.931 usec) Average num. events: 14054.500 (+- 11.469) Average time per event 2.356 usec Number of synthesis threads: 5 Average synthesis took: 31600.600 usec (+- 297.349 usec) Average num. events: 14012.500 (+- 4.590) Average time per event 2.255 usec Number of synthesis threads: 6 Average synthesis took: 32309.900 usec (+- 472.225 usec) Average num. events: 14004.000 (+- 0.000) Average time per event 2.307 usec Number of synthesis threads: 7 Average synthesis took: 31400.100 usec (+- 206.261 usec) Average num. events: 14004.800 (+- 0.800) Average time per event 2.242 usec Number of synthesis threads: 8 Average synthesis took: 31601.400 usec (+- 303.350 usec) Average num. events: 14005.700 (+- 1.700) Average time per event 2.256 usec Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
- Loading branch information