From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754112AbbG2Pnd (ORCPT ); Wed, 29 Jul 2015 11:43:33 -0400 Received: from mail.kernel.org ([198.145.29.136]:49456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753176AbbG2Pn3 (ORCPT ); Wed, 29 Jul 2015 11:43:29 -0400 Date: Wed, 29 Jul 2015 12:43:22 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: kan.liang@intel.com, a.p.zijlstra@chello.nl, luto@kernel.org, mingo@redhat.com, eranian@google.com, ak@linux.intel.com, mark.rutland@arm.com, adrian.hunter@intel.com, jolsa@kernel.org, namhyung@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V3 3/5] perf,tools: Dump per-sample freq/CPU%/CORE_BUSY% in report -D Message-ID: <20150729154322.GI575@kernel.org> References: <1438082975-47730-1-git-send-email-kan.liang@intel.com> <1438082975-47730-4-git-send-email-kan.liang@intel.com> <20150729125329.GH9606@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150729125329.GH9606@krava.brq.redhat.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Jul 29, 2015 at 02:53:29PM +0200, Jiri Olsa escreveu: > On Tue, Jul 28, 2015 at 07:29:33AM -0400, kan.liang@intel.com wrote: > > SNIP > > > > > -static int machines__deliver_event(struct machines *machines, > > +static int machines__deliver_event(struct perf_session *session, > > struct perf_evlist *evlist, > > union perf_event *event, > > struct perf_sample *sample, > > struct perf_tool *tool, u64 file_offset) > > { > > + struct machines *machines = &session->machines; > > struct perf_evsel *evsel; > > struct machine *machine; > > > > @@ -1053,11 +1079,12 @@ static int machines__deliver_event(struct machines *machines, > > > > switch (event->header.type) { > > case PERF_RECORD_SAMPLE: > > - dump_sample(evsel, event, sample); > > if (evsel == NULL) { > > ++evlist->stats.nr_unknown_id; > > return 0; > > } > > + dump_sample(session, evlist, evsel, event, sample); > > same here, you could pass only session all the way through I'll take a look at how interesting it would be to have a evsel->evlist, that if NULL means the evsel is freestanding, but when it is linked to an evlist, then it will be there. This way we wouldn't have to pass (evlist, evsel) when the main purpose of a function is about an evsel but we need information that is logically associated to all evsels in a list, i.e. that is in evsel->evlist. - Arnaldo