Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932125AbbLNJXt (ORCPT ); Mon, 14 Dec 2015 04:23:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58527 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752612AbbLNJXr (ORCPT ); Mon, 14 Dec 2015 04:23:47 -0500 Date: Mon, 14 Dec 2015 10:23:43 +0100 From: Jiri Olsa To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , LKML , David Ahern , Frederic Weisbecker , Andi Kleen , Stephane Eranian , Adrian Hunter Subject: Re: [PATCH/RFC 11/16] perf top: Implement basic parallel processing Message-ID: <20151214092343.GB17701@krava.brq.redhat.com> References: <1449734015-9148-1-git-send-email-namhyung@kernel.org> <1449734015-9148-12-git-send-email-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1449734015-9148-12-git-send-email-namhyung@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1671 Lines: 56 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, ¶m)) { > - 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/