summaryrefslogtreecommitdiff
path: root/scripts/gdb
diff options
context:
space:
mode:
authorKan Liang <kan.liang@linux.intel.com>2024-11-19 05:55:04 -0800
committerPeter Zijlstra <peterz@infradead.org>2024-12-02 12:01:34 +0100
commitae55e308bde2267df79c4475daa85e174b7ab4c8 (patch)
treeaf57aaf7bc0f7320f52e13a591baad0369937994 /scripts/gdb
parent3c00ed344cef4dbb57d8769b961af414132a173a (diff)
perf/x86/intel/ds: Simplify the PEBS records processing for adaptive PEBS
The current code may iterate all the PEBS records in the DS area several times. The first loop is to find all active events and calculate the available records for each event. Then iterate the whole buffer again and again to process available records until all active events are processed. The algorithm is inherited from the old generations. The old PEBS hardware does not deal well with the situation when events happen near each other. SW has to drop the error records. Multiple iterations are required. The hardware limit has been addressed on newer platforms with adaptive PEBS. A simple one-iteration algorithm is introduced. The samples are output by record order with the patch, rather than the event order. It doesn't impact the post-processing. The perf tool always sorts the records by time before presenting them to the end user. In an NMI, the last record has to be specially handled. Add a last[] variable to track the last unprocessed record of each event. Test: 11 PEBS events are used in the perf test. Only the basic information is collected. perf record -e instructions:up,...,instructions:up -c 2000003 benchmark The ftrace is used to record the duration of the intel_pmu_drain_pebs_icl(). The average duration reduced from 62.04us to 57.94us. A small improvement can be observed with the new algorithm. Also, the implementation becomes simpler and more straightforward. Suggested-by: Stephane Eranian <eranian@google.com> Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com> Link: https://lore.kernel.org/r/20241119135504.1463839-5-kan.liang@linux.intel.com
Diffstat (limited to 'scripts/gdb')
0 files changed, 0 insertions, 0 deletions