lkml.org 
[lkml]   [2014]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 6/8] perf data: Switch to multiple cpu stream files
On Thu, Dec 4, 2014 at 1:24 AM, Jiri Olsa <jolsa@kernel.org> wrote:
> +static int setup_streams(struct ctf_writer *cw, struct perf_session *session)
> +{
> + struct ctf_stream **stream;
> + struct perf_header *ph = &session->header;
> + int ncpus;
> +
> + /*
> + * Try to get the number of cpus used in the data file,
> + * if not present fallback to the MAX_CPUS.
> + */
> + if (!ph)

I think this check is meaningless since perf_header struct is embedded
in perf_session so it shouldn't be NULL when refered from a session..

Thanks,
Namhyung


> + ncpus = MAX_CPUS;
> + else
> + ncpus = ph->env.nr_cpus_avail;
> +
> + stream = zalloc(sizeof(*stream) * ncpus);
> + if (!stream) {
> + pr_err("Failed to allocate streams.\n");
> + return -ENOMEM;
> + }
> +
> + cw->stream = stream;
> + cw->stream_cnt = ncpus;
> + return 0;
> +}


\
 
 \ /
  Last update: 2014-12-08 10:01    [W:0.107 / U:1.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site