Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932747AbdCUOQC (ORCPT ); Tue, 21 Mar 2017 10:16:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32806 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932430AbdCUOQA (ORCPT ); Tue, 21 Mar 2017 10:16:00 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B6D9D624B0 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=acme@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B6D9D624B0 Date: Tue, 21 Mar 2017 11:08:07 -0300 From: Arnaldo Carvalho de Melo To: Masami Hiramatsu Cc: Ravi Bangoria , alexis.berlemont@gmail.com, linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, mpe@ellerman.id.au, naveen.n.rao@linux.vnet.ibm.com, maddy@linux.vnet.ibm.com Subject: Re: [PATCH 2/5] perf/sdt/x86: Add renaming logic for rNN and other registers Message-ID: <20170321140807.GB2531@redhat.com> References: <20161214000732.1710-1-alexis.berlemont@gmail.com> <20170202111143.14319-1-ravi.bangoria@linux.vnet.ibm.com> <20170202111143.14319-3-ravi.bangoria@linux.vnet.ibm.com> <20170207121159.b276b0a7383400a9d2452eee@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170207121159.b276b0a7383400a9d2452eee@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.20 (2009-12-10) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 21 Mar 2017 14:08:11 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2934 Lines: 95 Em Tue, Feb 07, 2017 at 12:11:59PM +0900, Masami Hiramatsu escreveu: > On Thu, 2 Feb 2017 16:41:40 +0530 > Ravi Bangoria wrote: > > > 'perf probe' is failing for sdt markers whose arguments has rNN > > (with postfix b/w/d), %rsp, %esp, %sil etc. registers. Add renaming > > logic for these registers. > > > > Looks good to me. > > Acked-by: Masami Hiramatsu Thanks, applied right after that v5 series from Alexis. > Thanks! > > > Signed-off-by: Ravi Bangoria > > --- > > tools/perf/arch/x86/util/perf_regs.c | 44 ++++++++++++++++++++++++++---------- > > 1 file changed, 32 insertions(+), 12 deletions(-) > > > > diff --git a/tools/perf/arch/x86/util/perf_regs.c b/tools/perf/arch/x86/util/perf_regs.c > > index 09a7f55..d8a8dcf 100644 > > --- a/tools/perf/arch/x86/util/perf_regs.c > > +++ b/tools/perf/arch/x86/util/perf_regs.c > > @@ -48,10 +48,42 @@ static const struct sdt_name_reg sdt_reg_renamings[] = { > > SDT_NAME_REG(rdx, dx), > > SDT_NAME_REG(esi, si), > > SDT_NAME_REG(rsi, si), > > + SDT_NAME_REG(sil, si), > > SDT_NAME_REG(edi, di), > > SDT_NAME_REG(rdi, di), > > + SDT_NAME_REG(dil, di), > > SDT_NAME_REG(ebp, bp), > > SDT_NAME_REG(rbp, bp), > > + SDT_NAME_REG(bpl, bp), > > + SDT_NAME_REG(rsp, sp), > > + SDT_NAME_REG(esp, sp), > > + SDT_NAME_REG(spl, sp), > > + > > + /* rNN registers */ > > + SDT_NAME_REG(r8b, r8), > > + SDT_NAME_REG(r8w, r8), > > + SDT_NAME_REG(r8d, r8), > > + SDT_NAME_REG(r9b, r9), > > + SDT_NAME_REG(r9w, r9), > > + SDT_NAME_REG(r9d, r9), > > + SDT_NAME_REG(r10b, r10), > > + SDT_NAME_REG(r10w, r10), > > + SDT_NAME_REG(r10d, r10), > > + SDT_NAME_REG(r11b, r11), > > + SDT_NAME_REG(r11w, r11), > > + SDT_NAME_REG(r11d, r11), > > + SDT_NAME_REG(r12b, r12), > > + SDT_NAME_REG(r12w, r12), > > + SDT_NAME_REG(r12d, r12), > > + SDT_NAME_REG(r13b, r13), > > + SDT_NAME_REG(r13w, r13), > > + SDT_NAME_REG(r13d, r13), > > + SDT_NAME_REG(r14b, r14), > > + SDT_NAME_REG(r14w, r14), > > + SDT_NAME_REG(r14d, r14), > > + SDT_NAME_REG(r15b, r15), > > + SDT_NAME_REG(r15w, r15), > > + SDT_NAME_REG(r15d, r15), > > SDT_NAME_REG_END, > > }; > > > > @@ -88,18 +120,6 @@ int sdt_rename_register(char **pdesc, char *old_name) > > > > /* Copy the chars after the register name (if need be) */ > > offset = prefix_len + sdt_len; > > - if (offset < old_desc_len) { > > - /* > > - * The orginal register name can be suffixed by 'b', > > - * 'w' or 'd' to indicate its size; so, we need to > > - * skip this char if we met one. > > - */ > > - char sfx = old_desc[offset]; > > - > > - if (sfx == 'b' || sfx == 'w' || sfx == 'd') > > - offset++; > > - } > > - > > if (offset < old_desc_len) > > memcpy(new_desc + prefix_len + uprobe_len, > > old_desc + offset, old_desc_len - offset); > > -- > > 2.9.3 > > > > > -- > Masami Hiramatsu