Re: [PATCH] perf/tools : remove default system_wide in sched record

From: chengjian (D)
Date: Wed Oct 25 2017 - 07:07:39 EST




On 2017/10/25 10:23, Namhyung Kim wrote:
On Tue, Oct 24, 2017 at 10:46:44AM -0300, Arnaldo Carvalho de Melo wrote:
Em Tue, Oct 24, 2017 at 03:45:34PM +0800, Cheng Jian escreveu:
When running perf sched record, there is a bug.

It's system_wide when we specify a command line.
Humm, isn't this because if you trace just a workload you will miss the
sched-in events?

Perhaps with PERF_RECORD_SWITCH we can solve that... I.e. still get the
sched-in events while tracing just one workload, not requiring
system_wide like it is the case now, right?
Yes, but it will lose other task's comm, also (at least) sched-wakeup
(from other task) events are still needed.

Thanks,
Namhyung


I found that if the parameters -p and -a were specified at the same time,
PID/TID(-p/-t) would overwrite SYSTEM_WIDE (-a) in target__validate( ).

If we don't specify a process(-p) or a workload, it will make system wide (-a)
as the default target.

/* Make system wide (-a) the default target. */
if (!argc && target__none(&rec->opts.target))
rec->opts.target.system_wide = true;

So don't -a and -p should have the same operation and feedback?

It also lose some events when use -p.