linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Adding support for setting the affinity of the recording process
@ 2023-06-12 10:26 Yang Jihong
  2023-06-12 14:24 ` Arnaldo Carvalho de Melo
  2023-06-12 15:27 ` James Clark
  0 siblings, 2 replies; 9+ messages in thread
From: Yang Jihong @ 2023-06-12 10:26 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Ian Rogers, Adrian Hunter, linux-perf-users, linux-kernel
  Cc: Yang Jihong

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-06-13  7:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-12 10:26 [RFC] Adding support for setting the affinity of the recording process Yang Jihong
2023-06-12 14:24 ` Arnaldo Carvalho de Melo
2023-06-12 15:05   ` Peter Zijlstra
2023-06-13  2:11     ` Yang Jihong
2023-06-13  2:03   ` Yang Jihong
2023-06-12 15:27 ` James Clark
2023-06-13  2:28   ` Yang Jihong
2023-06-13  5:50     ` Namhyung Kim
2023-06-13  7:03       ` Yang Jihong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).