]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf tool: Add a delegate_tool that just delegates actions to another tool
authorIan Rogers <irogers@google.com>
Fri, 7 Nov 2025 17:07:12 +0000 (09:07 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Fri, 7 Nov 2025 21:25:05 +0000 (13:25 -0800)
commit6331b266935916bf050149a55bfafb45aa3d9d9e
treef241a1c95c649620f79da831823d5fe739b41016
parent71062e282d6a662b75df9aff65702455563ff7c9
perf tool: Add a delegate_tool that just delegates actions to another tool

Add an ability to be able to compose perf_tools, by having one perform
an action and then calling a delegate. Currently the perf_tools have
if-then-elses setting the callback and then if-then-elses within the
callback. Understanding the behavior is complex as it is in two places
and logic for numerous operations, within things like perf inject, is
interwoven. By chaining perf_tools together based on command line
options this kind of code can be avoided.

Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/tool.c
tools/perf/util/tool.h