lkml.org 
[lkml]   [2015]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3 3/5] perf,tools: Dump per-sample freq/CPU%/CORE_BUSY% in report -D
On Tue, Jul 28, 2015 at 07:29:33AM -0400, kan.liang@intel.com wrote:

SNIP

>
> -static void sample_read__printf(struct perf_sample *sample, u64 read_format)
> +static void sample_read__printf(struct perf_session *session,
> + struct perf_evlist *evlist,
> + struct perf_sample *sample,
> + u64 read_format)
> {
> + struct perf_evsel *evsel;
> + struct perf_sample_id *sid;
> + u64 data[FREQ_PERF_MAX] = { 0 };
> + u64 cpu_max_freq = session->header.env.cpu_attr[PERF_HEADER_CPU_MAX_FREQ];
> +
> printf("... sample_read:\n");
>
> if (read_format & PERF_FORMAT_TOTAL_TIME_ENABLED)
> @@ -875,10 +883,26 @@ static void sample_read__printf(struct perf_sample *sample, u64 read_format)
> printf("..... id %016" PRIx64
> ", value %016" PRIx64 "\n",
> value->id, value->value);

should 2 hunks hunk below go under symbol_conf.show_freq_perf condition ?

jirka

> +
> + sid = perf_evlist__id2sid(evlist, value->id);
> + evsel = sid->evsel;
> + if (evsel != NULL)
> + SET_FREQ_PERF_VALUE(session->header.env.msr_pmu_type,
> + evsel, data, value->value);
> }
> } else
> printf("..... id %016" PRIx64 ", value %016" PRIx64 "\n",
> sample->read.one.id, sample->read.one.value);
> +
> + if (HAS_FREQ(data))
> + printf("..... Freq %lu MHz\n",
> + GET_FREQ(data, cpu_max_freq/1000));
> + if (HAS_CPU_UTIL(data))
> + printf("..... CPU%% %lu%%\n",
> + GET_CPU_UTIL(data));
> + if (HAS_CORE_BUSY(data))
> + printf("..... CORE_BUSY%% %lu%%\n",
> + GET_CORE_BUSY(data));
> }
>

SNIP


\
 
 \ /
  Last update: 2015-07-29 21:11    [W:0.276 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site