mirror of
https://github.com/89luca89/distrobox.git
synced 2026-08-19 01:14:49 -05:00
bench: fix perf_stat_metric to handle :u event-name suffixes
perf stat appends user/kernel/hypervisor modifiers (:u/:k/:h) to event names when paranoid >= 2, which is the documented configuration. Strip that suffix before comparison so 'instructions' matches 'instructions:u'. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
3d79bd9ad0
commit
fca1abfb18
+5
-1
@@ -26,7 +26,11 @@ perf_stat_metric() {
|
||||
awk -F',' -v ev="$event" '
|
||||
# skip comment/header lines starting with #
|
||||
/^#/ { next }
|
||||
$3 == ev { print $1; found=1; exit }
|
||||
{
|
||||
e = $3
|
||||
sub(/:[ukh]+$/, "", e)
|
||||
if (e == ev) { print $1; found=1; exit }
|
||||
}
|
||||
END { if (!found) print "null" }
|
||||
' "$csv"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user