mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: "Liang, Kan" <kan.liang@intel.com>
Cc: "a.p.zijlstra@chello.nl" <a.p.zijlstra@chello.nl>,
	"acme@kernel.org" <acme@kernel.org>,
	"luto@kernel.org" <luto@kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"eranian@google.com" <eranian@google.com>,
	"ak@linux.intel.com" <ak@linux.intel.com>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"Hunter, Adrian" <adrian.hunter@intel.com>,
	"jolsa@kernel.org" <jolsa@kernel.org>,
	"namhyung@kernel.org" <namhyung@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2 5/6] perf,tools: caculate and save freq/CPU%/CORE_BUSY% in he_stat
Date: Mon, 27 Jul 2015 19:27:45 +0200	[thread overview]
Message-ID: <20150727172745.GC20509@krava.brq.redhat.com> (raw)
In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F077018CCDE5@SHSMSX103.ccr.corp.intel.com>

On Mon, Jul 27, 2015 at 05:19:23PM +0000, Liang, Kan wrote:
> 
> 
> > > -481,6 +486,32 @@ iter_add_next_nop_entry(struct hist_entry_iter
> > *iter
> > > __maybe_unused,  }
> > >
> > >  static int
> > > +iter_add_single_freq_perf_entry(struct hist_entry_iter *iter, struct
> > > +addr_location *al) {
> > > +	struct perf_evsel *evsel = iter->evsel;
> > > +	struct perf_sample *sample = iter->sample;
> > > +	struct hist_entry *he;
> > > +	struct freq_perf_info info = {0};
> > > +	u64 *data = sample->freq_perf_data;
> > > +
> > > +	if (data[FREQ_PERF_REF_CYCLES] > 0)
> > > +		info.freq = (data[FREQ_PERF_CYCLES] * cpu_max_freq) /
> > data[FREQ_PERF_REF_CYCLES];
> > > +	if (data[FREQ_PERF_TSC] > 0)
> > > +		info.cpu_u = (100 * data[FREQ_PERF_REF_CYCLES]) /
> > data[FREQ_PERF_TSC];
> > > +	if (data[FREQ_PERF_MPERF] > 0)
> > > +		info.core_busy = (100 * data[FREQ_PERF_APERF]) /
> > > +data[FREQ_PERF_MPERF];
> > 
> > seems to me the new iterator is too big gun for this, why not initialize
> > 'struct freq_perf_info' in iter_prepare_normal_entry ?
> > 
> 
> Yes, we can initialize it in normal process.
> But we only need the freq_perf_info when "--show-freq-perf" is set.
> For most of the cases, it wastes time to calculate the unused information
> for each sample. That could impact the performance for processing. 

hum, it could fill in freq_perf_info only when --show-freq-perf is set,
other time it'd pass NULL

jirka

  reply	other threads:[~2015-07-27 17:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-24 13:48 [PATCH V2 0/6] Freq/CPU%/CORE_BUSY% support kan.liang
2015-07-24 13:48 ` [PATCH V2 1/6] perf,tools: save cpu max freq in perf header kan.liang
2015-07-26 16:31   ` Jiri Olsa
2015-07-26 16:32   ` Jiri Olsa
2015-07-24 13:48 ` [PATCH V2 2/6] perf,tools: read cpu max freq and msr type from header kan.liang
2015-07-24 13:48 ` [PATCH V2 3/6] perf,tools: Dump per-sample freq/CPU%/CORE_BUSY% in report -D kan.liang
2015-07-26 16:31   ` Jiri Olsa
2015-07-24 13:48 ` [PATCH V2 4/6] perf,tools: save misc sample read value in struct perf_sample kan.liang
2015-07-26 16:31   ` Jiri Olsa
2015-07-27 22:24     ` Liang, Kan
2015-07-28 13:55       ` Jiri Olsa
2015-07-24 13:48 ` [PATCH V2 5/6] perf,tools: caculate and save freq/CPU%/CORE_BUSY% in he_stat kan.liang
2015-07-26 16:31   ` Jiri Olsa
2015-07-27 17:19     ` Liang, Kan
2015-07-27 17:27       ` Jiri Olsa [this message]
2015-07-27 22:34     ` Liang, Kan
2015-07-28 13:50       ` Jiri Olsa
2015-07-26 16:31   ` Jiri Olsa
2015-07-27 17:11     ` Liang, Kan
2015-07-27 17:16       ` Jiri Olsa
2015-07-24 13:48 ` [PATCH V2 6/6] perf,tools: Show freq/CPU%/CORE_BUSY% in perf report --stdio kan.liang
2015-07-26 16:32   ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150727172745.GC20509@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=eranian@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®