[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130225183932.GA7352@redhat.com>
Date: Mon, 25 Feb 2013 19:39:32 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Jiri Olsa <jolsa@...hat.com>
Cc: linux-kernel@...r.kernel.org,
Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...e.hu>, Paul Mackerras <paulus@...ba.org>,
Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Namhyung Kim <namhyung@...nel.org>,
David Ahern <dsahern@...il.com>
Subject: Re: [PATCH 1/5] perf tools: Fix -C option for record command
To clarify, I am not trying to review this patch, I'd like to ask
the question...
On 02/25, Jiri Olsa wrote:
>
> Currently the -C option does not work for record command,
> because of the targets mismatch when synthesizing threads.
>
> Fixing this by using proper target interface for the
> synthesize decision.
OK, but my fix had the different goal. I thought that
$ perf ... record -C0 sleep 1
should attach the counter to the child process (workload) and set
event->cpu = 0 (instead of -1). With this patch we create the cpu
counter and event->task == NULL (thanks for your private explanations
btw ;).
But note that (iirc, I didn't even try to read this code again)
$ perf ... record -a sleep 1
attaches the counter to the task, and I think that -a/C should be
consistent.
However,
> @@ -573,13 +573,15 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
> perf_event__synthesize_guest_os, tool);
> }
>
> - if (!opts->target.system_wide)
> + if (perf_target__has_task(&opts->target))
> err = perf_event__synthesize_thread_map(tool, evsel_list->threads,
> process_synthesized_event,
> machine);
> - else
> + else if (perf_target__has_cpu(&opts->target))
> err = perf_event__synthesize_threads(tool, process_synthesized_event,
I do agree, this should be changed too, because "-a sleep 1"
sets ->target.system_wide.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists