Re: [PATCH] perf: make perf.data more self-descriptive (v8)

From: Robert Richter
Date: Tue Nov 29 2011 - 13:22:38 EST


On 30.09.11 09:40:40, Stephane Eranian wrote:
> @@ -385,36 +1433,69 @@ static int perf_header__adds_write(struct perf_header *header,
> sec_start = header->data_offset + header->data_size;
> lseek(fd, sec_start + sec_size, SEEK_SET);
>
> - if (perf_header__has_feat(header, HEADER_TRACE_INFO)) {
> - struct perf_file_section *trace_sec;
> -
> - trace_sec = &feat_sec[idx++];
> + err = do_write_feat(fd, header, HEADER_TRACE_INFO, &p, evlist);
> + if (err)
> + goto out_free;
>
> - /* Write trace info */
> - trace_sec->offset = lseek(fd, 0, SEEK_CUR);
> - read_tracing_data(fd, &evlist->entries);
> - trace_sec->size = lseek(fd, 0, SEEK_CUR) - trace_sec->offset;
> + err = do_write_feat(fd, header, HEADER_BUILD_ID, &p, evlist);
> + if (err) {
> + perf_header__clear_feat(header, HEADER_BUILD_ID);
> + goto out_free;
> }

Stephane,

I am just looking at the code and got a question:

Is there a reason for the different error handling for
HEADER_TRACE_INFO and HEADER_BUILD_ID? All other types simply disable
the feature and go on without returning an error (goto out_free).

-Robert

--
Advanced Micro Devices, Inc.
Operating System Research Center

--
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/