Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753468AbbG2PMw (ORCPT ); Wed, 29 Jul 2015 11:12:52 -0400 Received: from mail.kernel.org ([198.145.29.136]:47317 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752012AbbG2PMv (ORCPT ); Wed, 29 Jul 2015 11:12:51 -0400 Date: Wed, 29 Jul 2015 12:12:46 -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: <20150729151246.GH575@kernel.org> References: <1438082975-47730-1-git-send-email-kan.liang@intel.com> <1438082975-47730-4-git-send-email-kan.liang@intel.com> <20150729125220.GG9606@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150729125220.GG9606@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 Content-Length: 2244 Lines: 54 Em Wed, Jul 29, 2015 at 02:52:20PM +0200, Jiri Olsa escreveu: > On Tue, Jul 28, 2015 at 07:29:33AM -0400, kan.liang@intel.com wrote: > > SNIP > > > -static void dump_sample(struct perf_evsel *evsel, union perf_event *event, > > +static void dump_sample(struct perf_session *session, struct perf_evlist *evlist, > > + struct perf_evsel *evsel, union perf_event *event, > > struct perf_sample *sample) > > { > > u64 sample_type; > > @@ -938,7 +963,7 @@ static void dump_sample(struct perf_evsel *evsel, union perf_event *event, > > printf("... transaction: %" PRIx64 "\n", sample->transaction); > > > > if (sample_type & PERF_SAMPLE_READ) > > - sample_read__printf(sample, evsel->attr.read_format); > > + sample_read__printf(session, evlist, sample, evsel->attr.read_format); > > } > > > > static struct machine *machines__find_for_cpumode(struct machines *machines, > > @@ -1036,12 +1061,13 @@ static int > > &sample->read.one, machine); > > } > > > > -static int machines__deliver_event(struct machines *machines, > > +static int machines__deliver_event(struct perf_session *session, > > struct perf_evlist *evlist, > > you can cut the evlist argument as well, because it's always from session->evlist Well, perf_session is about saving/restoring from a perf.data file, and there are tools that don't deal with perf.data files. So I think that this running environment information, that is associated with the evlist, should be accessible from there, i.e. when reading the perf.data file you get it from there, when running a live tool, you get it from the system. I saw code in this patchkit that reads it from the system and writes it to the perf.data header, that could sould instead get it into a data structure accessible from the evlist and when writing a perf.data file, get it from there. I.e. trying not to entangle session stuff into places that don't touch it. Reading a bit more to see if I can come with more suggestions... - Arnaldo -- 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/