Commit 21a2ed5
committed
perf parse-events: Set default GH modifier properly
JIRA: https://issues.redhat.com/browse/RHEL-78200
upstream
========
commit dcbe6e5
Author: Namhyung Kim <namhyung@kernel.org>
Date: Fri Jun 6 15:54:31 2025 -0700
description
===========
Commit 7b10098 ("perf evlist: Remove __evlist__add_default")
changed to use "cycles:P" as a default event. But the problem is it
cannot set other default modifiers correctly.
perf kvm needs to set attr.exclude_host by default but it didn't work
because of the logic in the parse_events__modifier_list(). Also the
exclude_GH_default was applied only if ":u" modifier was specified -
which is strange. Move it out after handling the ":GH" and check
perf_host and perf_guest properly.
Before:
$ ./perf kvm record -vv true |& grep exclude
(nothing)
But specifying an event (without a modifier) works:
$ ./perf kvm record -vv -e cycles true |& grep exclude
exclude_host 1
After:
It now works for the both cases:
$ ./perf kvm record -vv true |& grep exclude
exclude_host 1
$ ./perf kvm record -vv -e cycles true |& grep exclude
exclude_host 1
Reviewed-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250606225431.2109754-1-namhyung@kernel.org
Fixes: 35c8d21 ("perf tools: Don't set attr.exclude_guest by default")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Anubhav Shelat <ashelat@redhat.com>1 parent ae1b605 commit 21a2ed5
1 file changed
+8
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1825 | 1825 | | |
1826 | 1826 | | |
1827 | 1827 | | |
1828 | | - | |
| 1828 | + | |
1829 | 1829 | | |
1830 | 1830 | | |
1831 | 1831 | | |
1832 | 1832 | | |
1833 | | - | |
1834 | | - | |
1835 | 1833 | | |
1836 | 1834 | | |
1837 | 1835 | | |
| |||
1854 | 1852 | | |
1855 | 1853 | | |
1856 | 1854 | | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
1857 | 1862 | | |
1858 | 1863 | | |
1859 | 1864 | | |
| |||
0 commit comments