lkml.org 
[lkml]   [2017]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 01/13] perf header: encapsulate read and swap
On Thu, May 25, 2017 at 1:07 AM, Jiri Olsa <jolsa@redhat.com> wrote:
> On Tue, May 23, 2017 at 12:48:41AM -0700, David Carrillo-Cisneros wrote:
>
> SNIP
>
>> - if (ph->needs_swap)
>> - nr = bswap_32(nr);
>> -
>> ph->env.nr_sibling_cores = nr;
>> - size += sizeof(u32);
>> if (strbuf_init(&sb, 128) < 0)
>> goto free_cpu;
>>
>> @@ -1820,20 +1812,14 @@ static int process_cpu_topology(struct perf_file_section *section,
>> /* include a NULL character at the end */
>> if (strbuf_add(&sb, str, strlen(str) + 1) < 0)
>> goto error;
>> - size += string_size(str);
>> free(str);
>> }
>
> hum, you disabled the size check logic by removing
> those size calculations, there's following code:
>
> /*
> * The header may be from old perf,
> * which doesn't include core id and socket id information.
> */
> if (section->size <= size) {
> zfree(&ph->env.cpu);
> return 0;
> }
>
>
> that recognize earlier version of the header

True. My bad. Will fix.

>
> jirka

\
 
 \ /
  Last update: 2017-06-05 01:23    [W:0.072 / U:1.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site