[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <159de73b-fdd6-6df8-4f77-73c628fe641f@huawei.com>
Date: Mon, 12 Jun 2023 18:26:10 +0800
From: Yang Jihong <yangjihong1@...wei.com>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
linux-perf-users <linux-perf-users@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>
CC: Yang Jihong <yangjihong1@...wei.com>
Subject: [RFC] Adding support for setting the affinity of the recording
process
Hello everyone,
Currently, perf-record supports profiling an existing process, thread,
or a specified command.
Sometimes we may need to set CPU affinity of the target process before
recording:
# taskset -pc <cpus> <pid>
# perf record -p <pid> -- sleep 10
or:
# perf record -- `taskset -c <cpus> COMMAND`
I'm thinking about getting perf to support setting the affinity of the
recording process, for example:
1. set the CPU affinity of the <pid1> process to <cpus1>, <pid2> process
to <cpus2>, and record:
# perf record -p <pid1>/<cpus1>:<pid2>/<cpus2> -- sleep 10
and
2. set CPU affinity of the COMMAND and record:
# perf record --taskset-command <cpus> COMMAND
In doing so, perf, as an observer, actually changes some of the
properties of the target process, which may be contrary to the purpose
of perf tool.
Will we consider accepting this approach?
Thanks,
Yang.
Powered by blists - more mailing lists