lkml.org 
[lkml]   [2017]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [PATCH V2 4/5] perf record: synthesize event multithreading support
    On Wed, Oct 18, 2017 at 07:29:32AM -0700, kan.liang@intel.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

    \
     
     \ /
      Last update: 2017-10-22 17:15    [W:4.898 / U:2.092 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site