Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933061AbeAKV10 convert rfc822-to-8bit (ORCPT + 1 other); Thu, 11 Jan 2018 16:27:26 -0500 Received: from mga04.intel.com ([192.55.52.120]:60516 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932744AbeAKV1X (ORCPT ); Thu, 11 Jan 2018 16:27:23 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,346,1511856000"; d="scan'208";a="20906404" From: "Liang, Kan" To: Jiri Olsa CC: "acme@kernel.org" , "peterz@infradead.org" , "mingo@redhat.com" , "linux-kernel@vger.kernel.org" , "wangnan0@huawei.com" , "jolsa@kernel.org" , "namhyung@kernel.org" , "ak@linux.intel.com" , "yao.jin@linux.intel.com" Subject: RE: [PATCH V3 04/12] perf mmap: introduce perf_mmap__read_done Thread-Topic: [PATCH V3 04/12] perf mmap: introduce perf_mmap__read_done Thread-Index: AQHTeohYrimX7dZHdEuV9/3GZ9+T6KNuVPCAgADgbIA= Date: Thu, 11 Jan 2018 21:27:20 +0000 Message-ID: <37D7C6CF3E00A74B8858931C1DB2F077537FFBF7@SHSMSX103.ccr.corp.intel.com> References: <1513879734-237492-1-git-send-email-kan.liang@intel.com> <1513879734-237492-5-git-send-email-kan.liang@intel.com> <20180111142541.GC16655@krava> In-Reply-To: <20180111142541.GC16655@krava> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTYzMGFlYTEtNjM3Mi00MmVkLWE1NzYtZGIyNzAyYmQzOGM5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkM5OE5WRUxXbW1LY2lsQmJGckd3YUc4V1Jsd0t3b2hVRjFtZ1lISkhrN0k9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: > On Thu, Dec 21, 2017 at 10:08:46AM -0800, kan.liang@intel.com wrote: > > From: Kan Liang > > > > The direction of overwrite mode is backward. The last mmap__read_event > > will set tail to map->prev. Need to correct the map->prev to head which > > is the end of next read. > > > > It will be used later. > > > > Signed-off-by: Kan Liang > > --- > > tools/perf/util/mmap.c | 11 +++++++++++ > > tools/perf/util/mmap.h | 1 + > > 2 files changed, 12 insertions(+) > > > > diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c > > index a844a2f..4aaeb64 100644 > > --- a/tools/perf/util/mmap.c > > +++ b/tools/perf/util/mmap.c > > @@ -343,3 +343,14 @@ int perf_mmap__push(struct perf_mmap *md, > bool overwrite, > > out: > > return rc; > > } > > + > > +/* > > + * Mandatory for overwrite mode > > + * The direction of overwrite mode is backward. > > + * The last mmap__read_event will set tail to map->prev. > > you mean perf_mmap__read function in this comment, right? > Right. Will fix it in V4. Thanks, Kan > jirka > > > + * Need to correct the map->prev to head which is the end of next read. > > + */ > > +void perf_mmap__read_done(struct perf_mmap *map) > > +{ > > + map->prev = perf_mmap__read_head(map); > > +} > > diff --git a/tools/perf/util/mmap.h b/tools/perf/util/mmap.h > > index abe9b9f..2df27c1 100644 > > --- a/tools/perf/util/mmap.h > > +++ b/tools/perf/util/mmap.h > > @@ -96,4 +96,5 @@ size_t perf_mmap__mmap_len(struct perf_mmap > *map); > > > > int perf_mmap__read_init(struct perf_mmap *map, bool overwrite, > > u64 *start, u64 *end); > > +void perf_mmap__read_done(struct perf_mmap *map); > > #endif /*__PERF_MMAP_H */ > > -- > > 2.5.5 > >