On 26/10/15 14:39, Wangnan (F) wrote:
That would work although it looks like a kludge.
On 2015/10/26 20:24, Adrian Hunter wrote:
On 26/10/15 13:41, Wang Nan wrote:Currently the only user of evsel->system_wide is IPT:
evsel->system_wide is introduced by commit bf8e8f4b832972c76d64ab2e2837Well that breaks the way evsel->system_wide is used i.e. it is a parameter
(perf evlist: Add 'system_wide' option), which is used for mixing evsels
that aren't system-wide with ones that are . However, for global
system wide recording (perf record -a ...), evsel->system_wide is set
to false, which is confusion.
This patch set evsel->system_wide to true if the target.system_wide is
set, which makes evsel->system_wide a reliable way to describe whether
itself is system_wide or not.
Signed-off-by: Wang Nan <wangnan0@xxxxxxxxxx>
Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Alexei Starovoitov <ast@xxxxxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Li Zefan <lizefan@xxxxxxxxxx>
tools/perf/util/evsel.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 3ac4ee9c..36ecf0e 100644
@@ -734,6 +734,7 @@ void perf_evsel__config(struct perf_evsel *evsel,
struct record_opts *opts)
int track = evsel->tracking;
bool per_cpu = opts->target.default_per_cpu &&
+ evsel->system_wide = opts->target.system_wide;
to the evsel and here you just overwrote it.
auxtrace_record__options -> intel_pt_recording_options
and it only set it to true.
So I think changing to this should make it safe:
evsel->system_wide = (evsel->system_wide || opt->target.system_wide);
Have you looked at properly validating opts->no_inherit ?
Also, aren't you neglecting target->cpu_list ?