Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1650267

Re: [PATCH v2 01/13] perf header: encapsulate read and swap

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 01/13] perf header: encapsulate read and swap
Date 2017-05-25 10:10 +0200
Message-ID <tKW0h-5FH-1@gated-at.bofh.it> (permalink)
References <tKcTv-a4-3@gated-at.bofh.it> <tKcTx-a4-45@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

jirka

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/13] perf tool: add meta-data header support for pipe-mode David Carrillo-Cisneros <davidcc@google.com> - 2017-05-23 10:00 +0200
  [PATCH v2 09/13] perf header: use struct feat_fd in read header records David Carrillo-Cisneros <davidcc@google.com> - 2017-05-23 10:00 +0200
  [PATCH v2 12/13] perf tool: add show_feature_header to perf_tool David Carrillo-Cisneros <davidcc@google.com> - 2017-05-23 10:00 +0200
  [PATCH v2 06/13] perf header: add struct feat_fd for write David Carrillo-Cisneros <davidcc@google.com> - 2017-05-23 10:00 +0200
    Re: [PATCH v2 06/13] perf header: add struct feat_fd for write Jiri Olsa <jolsa@redhat.com> - 2017-05-25 10:10 +0200
      Re: [PATCH v2 06/13] perf header: add struct feat_fd for write David Carrillo-Cisneros <davidcc@google.com> - 2017-06-05 04:00 +0200
  [PATCH v2 03/13] perf header: fail on write_padded error David Carrillo-Cisneros <davidcc@google.com> - 2017-05-23 10:00 +0200
  [PATCH v2 11/13] perf header: change FEAT_OP* macros David Carrillo-Cisneros <davidcc@google.com> - 2017-05-23 10:00 +0200
    Re: [PATCH v2 11/13] perf header: change FEAT_OP* macros Jiri Olsa <jolsa@redhat.com> - 2017-05-25 10:10 +0200
    Re: [PATCH v2 11/13] perf header: change FEAT_OP* macros Jiri Olsa <jolsa@redhat.com> - 2017-05-25 10:20 +0200
      Re: [PATCH v2 11/13] perf header: change FEAT_OP* macros David Carrillo-Cisneros <davidcc@google.com> - 2017-06-05 04:20 +0200
  [PATCH v2 01/13] perf header: encapsulate read and swap David Carrillo-Cisneros <davidcc@google.com> - 2017-05-23 10:00 +0200
    Re: [PATCH v2 01/13] perf header: encapsulate read and swap Namhyung Kim <namhyung@kernel.org> - 2017-05-24 17:40 +0200
      Re: [PATCH v2 01/13] perf header: encapsulate read and swap David Carrillo-Cisneros <davidcc@google.com> - 2017-06-05 01:20 +0200
    Re: [PATCH v2 01/13] perf header: encapsulate read and swap Jiri Olsa <jolsa@redhat.com> - 2017-05-25 10:10 +0200
      Re: [PATCH v2 01/13] perf header: encapsulate read and swap David Carrillo-Cisneros <davidcc@google.com> - 2017-06-05 01:30 +0200
  [PATCH v2 05/13] perf header: revamp do_write David Carrillo-Cisneros <davidcc@google.com> - 2017-05-23 10:00 +0200
    Re: [PATCH v2 05/13] perf header: revamp do_write Jiri Olsa <jolsa@redhat.com> - 2017-05-25 10:20 +0200
      Re: [PATCH v2 05/13] perf header: revamp do_write David Carrillo-Cisneros <davidcc@google.com> - 2017-06-05 04:30 +0200

csiph-web