lkml.org 
[lkml]   [2015]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH/RFC 11/16] perf top: Implement basic parallel processing
On Thu, Dec 10, 2015 at 04:53:30PM +0900, Namhyung Kim wrote:

SNIP

>
> - perf_top__mmap_read(top);
> -
> ret = -1;
> - if (pthread_create(&thread, NULL, (use_browser > 0 ? display_thread_tui :
> - display_thread), top)) {
> - ui__error("Could not create display thread.\n");
> + readers = calloc(sizeof(pthread_t), top->evlist->nr_mmaps);
> + if (readers == NULL)
> goto out_delete;
> - }
>
> - if (top->realtime_prio) {
> - struct sched_param param;
> + rargs = calloc(sizeof(*rargs), top->evlist->nr_mmaps);
> + if (rargs == NULL)
> + goto out_free;
>
> - param.sched_priority = top->realtime_prio;
> - if (sched_setscheduler(0, SCHED_FIFO, &param)) {
> - ui__error("Could not set realtime priority.\n");
> - goto out_join;
> - }
> + hists = calloc(sizeof(*hists), top->evlist->nr_mmaps * top->evlist->nr_entries);
> + if (hists == NULL)
> + goto out_free;
> +
> + for (i = 0; i < top->evlist->nr_mmaps * top->evlist->nr_entries; i++)
> + __hists__init(&hists[i]);
> +
> + for (i = 0; i < top->evlist->nr_mmaps; i++) {
> + struct reader_arg *rarg = &rargs[i];
> +
> + rarg->idx = i;
> + rarg->top = top;
> + rarg->hists = &hists[i * top->evlist->nr_entries];
> +
> + perf_top__mmap_read(rarg);
> }
> + collect_hists(top, hists);

hum, what's the reason for calling perf_top__mmap_read
and collect_hists in here?

also calling collect_hists on hists array pointer seems wrong

jirka


\
 
 \ /
  Last update: 2015-12-14 11:01    [W:0.178 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site