Re: [PATCH V2 1/6] perf,tools: save cpu max freq in perf header

From: Jiri Olsa
Date: Sun Jul 26 2015 - 12:32:20 EST


On Fri, Jul 24, 2015 at 09:48:27AM -0400, kan.liang@xxxxxxxxx wrote:

SNIP

> diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h
> index 0af9cec..6784677 100644
> --- a/tools/perf/util/cpumap.h
> +++ b/tools/perf/util/cpumap.h
> @@ -58,6 +58,7 @@ int max_node_num;
> int *cpunode_map;
>
> int cpu__setup_cpunode_map(void);
> +unsigned int get_cpu_max_freq(void);
>
> static inline int cpu__max_node(void)
> {
> diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
> index 03ace57..287a488 100644
> --- a/tools/perf/util/header.c
> +++ b/tools/perf/util/header.c
> @@ -862,6 +862,16 @@ write_it:
> return do_write_string(fd, buffer);
> }
>
> +static int write_cpu_max_freq(int fd, struct perf_header *h __maybe_unused,
> + struct perf_evlist *evlist __maybe_unused)
> +{
> + u32 freq;
> +
> + freq = get_cpu_max_freq() / 1000;

why dont you store it as u64 ?

jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/