From patchwork Mon Jan 11 13:48:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wangnan (F)" X-Patchwork-Id: 565842 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 188F41402D9 for ; Tue, 12 Jan 2016 00:54:24 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760103AbcAKNty (ORCPT ); Mon, 11 Jan 2016 08:49:54 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:41433 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760020AbcAKNtw (ORCPT ); Mon, 11 Jan 2016 08:49:52 -0500 Received: from 172.24.1.51 (EHLO szxeml422-hub.china.huawei.com) ([172.24.1.51]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BUI71836; Mon, 11 Jan 2016 21:49:37 +0800 (CST) Received: from linux-4hy3.site (10.107.193.248) by szxeml422-hub.china.huawei.com (10.82.67.152) with Microsoft SMTP Server id 14.3.235.1; Mon, 11 Jan 2016 21:49:30 +0800 From: Wang Nan To: CC: , , , , , Wang Nan , He Kuang , "Arnaldo Carvalho de Melo" , Jiri Olsa , Masami Hiramatsu , Namhyung Kim Subject: [PATCH 49/53] perf tools: Consider TAILSIZE bit when caclulate is_pos Date: Mon, 11 Jan 2016 13:48:40 +0000 Message-ID: <1452520124-2073-50-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1452520124-2073-1-git-send-email-wangnan0@huawei.com> References: <1452520124-2073-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.107.193.248] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090203.5693B2F1.025C, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: d59260d2ff8f5555f7414dfdd5f064f9 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org evsel->is_pos indicates event id location in a event (count backward). It is used to find id for tracking events (mmap, exit...). If TAILSIZE is selected, this location should be changed accordingly. Signed-off-by: Wang Nan Signed-off-by: He Kuang Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Zefan Li Cc: pi3orama@163.com --- tools/perf/util/evsel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 6932b8b..c59ea34 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -144,10 +144,10 @@ static int __perf_evsel__calc_id_pos(u64 sample_type) */ static int __perf_evsel__calc_is_pos(u64 sample_type) { - int idx = 1; + int idx = 1 + (sample_type & PERF_SAMPLE_TAILSIZE ? 1 : 0); if (sample_type & PERF_SAMPLE_IDENTIFIER) - return 1; + return idx; if (!(sample_type & PERF_SAMPLE_ID)) return -1;