summaryrefslogtreecommitdiff
path: root/tools/perf/python
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2026-08-09 00:14:51 -0700
committerNamhyung Kim <namhyung@kernel.org>2026-08-09 22:02:41 -0700
commitb9514a9a13fc782546df0fae7d5767dadd2094f5 (patch)
treefa9a84ef65ae13a48c8b026c8b082dd0f979e444 /tools/perf/python
parentb3d7c6c1a998c0dd4607558893ba03a374ee343f (diff)
downloadlinux-next-b9514a9a13fc782546df0fae7d5767dadd2094f5.tar.gz
linux-next-b9514a9a13fc782546df0fae7d5767dadd2094f5.zip
perf python: Fix MetricGroup return type in perf.pyi
The metrics() function can return a dictionary where the value is either a string or a list of strings, so the type signature in the stub file should be Union[str, List[str]]. Fixes: 430da3cd03b4 ("perf python: Add perf.pyi stubs file") Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/python')
-rw-r--r--tools/perf/python/perf.pyi4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/python/perf.pyi b/tools/perf/python/perf.pyi
index f266c9baffd0..58b0b3ed819d 100644
--- a/tools/perf/python/perf.pyi
+++ b/tools/perf/python/perf.pyi
@@ -1,5 +1,5 @@
"""Type stubs for the perf Python module."""
-from typing import Callable, Dict, List, Optional, Any, Iterator
+from typing import Callable, Dict, List, Optional, Any, Iterator, Union
def config_get(name: str) -> Optional[str]:
"""Get a configuration value from perf config.
@@ -12,7 +12,7 @@ def config_get(name: str) -> Optional[str]:
"""
...
-def metrics() -> List[Dict[str, str]]:
+def metrics() -> List[Dict[str, Union[str, List[str]]]]:
"""Get a list of available metrics.
Returns: