Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751898AbdFORSs (ORCPT ); Thu, 15 Jun 2017 13:18:48 -0400 Received: from mga01.intel.com ([192.55.52.88]:6415 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750835AbdFORSr (ORCPT ); Thu, 15 Jun 2017 13:18:47 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,343,1493708400"; d="scan'208";a="113643538" From: "Liang, Kan" To: Stephane Eranian CC: "linux-kernel@vger.kernel.org" , "acme@redhat.com" , "peterz@infradead.org" , "mingo@elte.hu" , "ak@linux.intel.com" , "jolsa@redhat.com" Subject: RE: [PATCH 2/5] perf/x86: add PERF_SAMPLE_SKID_IP support for X86 PEBS Thread-Topic: [PATCH 2/5] perf/x86: add PERF_SAMPLE_SKID_IP support for X86 PEBS Thread-Index: AQHS5d9QkR1P9EpkpkGksCWnOcBxc6ImDj8A//+L2ACAAI0YAA== Date: Thu, 15 Jun 2017 17:18:39 +0000 Message-ID: <37D7C6CF3E00A74B8858931C1DB2F0775370DD61@SHSMSX103.ccr.corp.intel.com> References: <1497534989-29231-1-git-send-email-eranian@google.com> <1497534989-29231-3-git-send-email-eranian@google.com> <37D7C6CF3E00A74B8858931C1DB2F0775370DC74@SHSMSX103.ccr.corp.intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGFiZGNlZjItYzk0YS00YWQzLWJjNzMtYjc2MTg4YWYzYWQ5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Ikh3M2hsb2Rqb1BMQWE2RitpbWNSNTJMUGNpaGw1b2hVN25JMWVwMWZxdW89In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v5FHIrXv010815 Content-Length: 1704 Lines: 49 > On Thu, Jun 15, 2017 at 8:40 AM, Liang, Kan wrote: > > > > > >> This patch adds support for SKID_IP to Intel x86 processors in PEBS > >> mode. In that case, the off-by-1 IP from PEBS is returned in the SKID_IP > field. > > > > It looks we can only get different skid_ip and ip with :pp event (attr.precise > = 2). > > With the :p event (attr.precise = 1), the skid_ip and ip are the same. Right? > > > Correct, because skid_ip would be equal to the pebs->ip. I think it's better to make it clear for user by adding a check in perf tool. If --skid-ip is applied with :p event/non-PEBS event, the tool may suggest them to use :pp event instead. Thanks, Kan > > > >> > >> Signed-off-by: Stephane Eranian > >> --- > >> arch/x86/events/intel/ds.c | 7 +++++++ > >> 1 file changed, 7 insertions(+) > >> > >> diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c > >> index c6d23ffe422d..ee17de5d6b8d 100644 > >> --- a/arch/x86/events/intel/ds.c > >> +++ b/arch/x86/events/intel/ds.c > >> @@ -1169,6 +1169,13 @@ static void setup_pebs_sample_data(struct > >> perf_event *event, > >> x86_pmu.intel_cap.pebs_format >= 1) > >> data->addr = pebs->dla; > >> > >> + /* > >> + * unmodified, skid IP which is guaranteed to be the next > >> + * dyanmic instruction > >> + */ > >> + if (sample_type & PERF_SAMPLE_SKID_IP) > >> + data->skid_ip = pebs->ip; > >> + > >> if (x86_pmu.intel_cap.pebs_format >= 2) { > >> /* Only set the TSX weight when no memory weight. */ > >> if ((sample_type & PERF_SAMPLE_WEIGHT) && !fll) > >> -- > >> 2.13.1.518.g3df882009-goog > >