[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171018153949.GC512@krava>
Date: Wed, 18 Oct 2017 17:39:49 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: kan.liang@...el.com
Cc: acme@...nel.org, mingo@...hat.com, linux-kernel@...r.kernel.org,
peterz@...radead.org, jolsa@...nel.org, wangnan0@...wei.com,
hekuang@...wei.com, namhyung@...nel.org,
alexander.shishkin@...ux.intel.com, adrian.hunter@...el.com,
ak@...ux.intel.com
Subject: Re: [PATCH V2 4/5] perf record: synthesize event multithreading
support
On Wed, Oct 18, 2017 at 07:29:32AM -0700, kan.liang@...el.com wrote:
SNIP
> +static int record__multithread_synthesize(struct record *rec,
> + struct machine *machine,
> + struct perf_tool *tool,
> + struct record_opts *opts)
> +{
> + int i, err, nr_thread = sysconf(_SC_NPROCESSORS_ONLN);
> + char name[PATH_MAX];
> + struct stat st;
> +
> + if (nr_thread <= 1)
> + return __machine__synthesize_threads(machine, tool,
> + &opts->target,
> + rec->evlist->threads,
> + process_synthesized_event,
> + opts->sample_address,
> + opts->proc_map_timeout,
> + 1);
^^^^^^^^^^^^^^^^^^
> +
> static int record__synthesize(struct record *rec, bool tail)
> {
> struct perf_session *session = rec->session;
> @@ -766,9 +856,16 @@ static int record__synthesize(struct record *rec, bool tail)
> perf_event__synthesize_guest_os, tool);
> }
>
> - err = __machine__synthesize_threads(machine, tool, &opts->target, rec->evlist->threads,
> - process_synthesized_event, opts->sample_address,
> - opts->proc_map_timeout, 1);
> + /* multithreading synthesize is only available for cpu monitoring */
> + if (target__has_cpu(&opts->target))
> + err = record__multithread_synthesize(rec, machine, tool, opts);
> + else
> + err = __machine__synthesize_threads(machine, tool,
> + &opts->target,
> + rec->evlist->threads,
> + process_synthesized_event,
> + opts->sample_address,
> + opts->proc_map_timeout, 1);
hum, this could be checked together with nr_thread in record__multithread_synthesize
jirka
Powered by blists - more mailing lists