[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALcN6mgr8cAo7=OQscXc6kUKR69LBR3Csooxdj-5DyOaqEwD-w@mail.gmail.com>
Date: Sun, 4 Jun 2017 18:50:49 -0700
From: David Carrillo-Cisneros <davidcc@...gle.com>
To: Jiri Olsa <jolsa@...hat.com>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Andi Kleen <ak@...ux.intel.com>, Simon Que <sque@...omium.org>,
Wang Nan <wangnan0@...wei.com>, Jiri Olsa <jolsa@...nel.org>,
He Kuang <hekuang@...wei.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
David Ahern <dsa@...ulusnetworks.com>,
Namhyung Kim <namhyung@...nel.org>,
Stephane Eranian <eranian@...gle.com>,
Paul Turner <pjt@...gle.com>
Subject: Re: [PATCH v2 06/13] perf header: add struct feat_fd for write
On Thu, May 25, 2017 at 1:07 AM, Jiri Olsa <jolsa@...hat.com> wrote:
> On Tue, May 23, 2017 at 12:48:46AM -0700, David Carrillo-Cisneros wrote:
>
> SNIP
>
>> @@ -2211,18 +2214,18 @@ static int do_write_feat(int fd, struct perf_header *h, int type,
>> if (!feat_ops[type].write)
>> return -1;
>>
>> - (*p)->offset = lseek(fd, 0, SEEK_CUR);
>> + (*p)->offset = lseek(fd->fd, 0, SEEK_CUR);
>>
>> - err = feat_ops[type].write(fd, h, evlist);
>> + err = feat_ops[type].write(fd, evlist);
>> if (err < 0) {
>> pr_debug("failed to write feature %s\n", feat_ops[type].name);
>>
>> /* undo anything written */
>> - lseek(fd, (*p)->offset, SEEK_SET);
>> + lseek(fd->fd, (*p)->offset, SEEK_SET);
>>
>> return -1;
>> }
>> - (*p)->size = lseek(fd, 0, SEEK_CUR) - (*p)->offset;
>> + (*p)->size = lseek(fd->fd, 0, SEEK_CUR) - (*p)->offset;
>> (*p)++;
>> }
>> return ret;
>> @@ -2232,12 +2235,18 @@ static int perf_header__adds_write(struct perf_header *header,
>> struct perf_evlist *evlist, int fd)
>> {
>> int nr_sections;
>> + struct feat_fd fdd;
>> struct perf_file_section *feat_sec, *p;
>> int sec_size;
>> u64 sec_start;
>> int feat;
>> int err;
>>
>> + fdd = (struct feat_fd){
>> + .fd = fd,
>> + .ph = header,
>> + };
>
> could you unite the naming for struct feat_fd variables?
>
> it's slightly confusing, especialy when you keep the 'fd'
> name in some cases.. ff? ;-)
>
Thank you for the review :) . I'll do the rename.
> jirka
Powered by blists - more mailing lists