lkml.org 
[lkml]   [2015]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V7 1/8] perf,tools: introduce generic FEAT for CPU attributes
On Fri, Aug 28, 2015 at 05:48:02AM -0400, Kan Liang wrote:

SNIP

>
> +static int process_cpu_attributes(struct perf_file_section *section __maybe_unused,
> + struct perf_header *ph, int fd,
> + void *data __maybe_unused)
> +{
> + ssize_t ret;
> + u32 i, tag_id;
> + u64 nr;
> +
> + for (i = 0; i < PERF_HEADER_CPU_ATTR_MAX; i++) {
> +
> + ret = readn(fd, &tag_id, sizeof(tag_id));
> + if (ret != sizeof(tag_id))
> + return -1;
> +
> + if (ph->needs_swap)
> + nr = bswap_32(tag_id);
> +
> + if (tag_id >= PERF_HEADER_CPU_ATTR_MAX) {
> + pr_debug("The number of cpu attributes is not expected. "
> + "You may need to upgrade the perf tool.\n");
> + return -1;
> + }

I wonder we should let it pass to be able to read new data
with older perf.. but IMO the error is specific enough to
find & fix it if it ever happens

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka


\
 
 \ /
  Last update: 2015-08-31 12:01    [W:2.036 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site