lkml.org 
[lkml]   [2011]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] perf: make perf.data more self-descriptive (v8)
    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



    \
     
     \ /
      Last update: 2011-11-29 19:25    [W:0.033 / U:61.184 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site