Received: by 10.223.164.202 with SMTP id h10csp40497wrb; Mon, 13 Nov 2017 19:26:45 -0800 (PST) X-Google-Smtp-Source: AGs4zMbr40DKqaQfVY+VOfRDD8/YydAz0DRiouiPn/6MWQupSDRG1GHpvo+1e7w57tbBL4I6kK1T X-Received: by 10.84.253.15 with SMTP id z15mr858408pll.401.1510630005410; Mon, 13 Nov 2017 19:26:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510630005; cv=none; d=google.com; s=arc-20160816; b=eMw4q1MpyxiHmSbrD8so8zX+3c6cohLuQJRFcuBm6xyyvhwtkPc1j2hTlzpNLy22cT ayNMY3IBB1B7t1kJQCXQGSQUrkPbVAKDkD/eDnHGn0UIaWnJHa7a4WyIji/7HvkThyx2 4QjHLJhekE87Bl/Wp+OpUshgUfr8uhQaERf3MKeZEjzKDlQXxLhXT94iAzknsWFCcD7i jajz4IhR9peDvP6YhI68MjwUo/CEEWmdivOcfH/jmYS1A9dNzgjZXhSKuUQHVGcMlyvJ giMFd8vBGW0h/PEl4x4av1LpDbkz8qXr8B3sr/f+FN6AzQypL5xDmfKRHHVDp06gSqGt VSIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=4iZDZEtb7XlDD02CeNG8P4KVfvnZPIZSOZAuyyCv0zE=; b=I0J5+3PpPaJ05B0QHy2BblbGc83DrwPt4B8ysjpsIcSuft4PG+yXMk78ZV7gLkDpWF 3GyQvEpkpwdGfG6HOWFX+XsFz8TOa8k6gT++woXkK1eHK9U5hFhPrgmqysh9WdbW7KF6 FsR/oKrW07hN7KHxyIysLDg+hUjiifnM9v927z1ZBRrGMfS2SbmzWBRBcEifLOxXhTYR WXLdbkMiczUKlcD59VZtElwyV67aep+JaEY0/q/NtQ9Eskyw1u6oz1H9B7vZQIAOWC5v CNJYtoSWAteSzVXB/xq5twBGDlpRdfdtSJcIbuP2KmlLjBD1JSE6l3gLHUnoMVywHM7t F+mw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 60si15225922plc.104.2017.11.13.19.26.31; Mon, 13 Nov 2017 19:26:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753069AbdKNDZx (ORCPT + 89 others); Mon, 13 Nov 2017 22:25:53 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:38276 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750806AbdKNDZw (ORCPT ); Mon, 13 Nov 2017 22:25:52 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAE3O8G8063833 for ; Mon, 13 Nov 2017 22:25:52 -0500 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0b-001b2d01.pphosted.com with ESMTP id 2e7rfjr757-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 13 Nov 2017 22:25:51 -0500 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 14 Nov 2017 03:25:50 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 14 Nov 2017 03:25:45 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vAE3PjMv36962422; Tue, 14 Nov 2017 03:25:45 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B472EA4051; Tue, 14 Nov 2017 03:20:38 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 03432A4040; Tue, 14 Nov 2017 03:20:37 +0000 (GMT) Received: from bangoria.in.ibm.com (unknown [9.124.35.198]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 14 Nov 2017 03:20:36 +0000 (GMT) From: Ravi Bangoria To: acme@kernel.org Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, treeze.taeung@gmail.com, linux-kernel@vger.kernel.org, dstence@us.ibm.com, Ravi Bangoria Subject: [PATCH] perf annotate: Remove precision for mnemonics Date: Tue, 14 Nov 2017 08:55:40 +0530 X-Mailer: git-send-email 2.13.6 X-TM-AS-GCONF: 00 x-cbid: 17111403-0016-0000-0000-00000500ED7E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17111403-0017-0000-0000-0000283CA2D2 Message-Id: <20171114032540.4564-1-ravi.bangoria@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-14_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=4 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711140044 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are many instructions, esp on powerpc, whose mnemonics are longer than 6 characters. Using precision limit causes truncation of such mnemonics. Fix this by removing precision limit. Note that, 'width' is still 6, so alignment won't get affected for length <= 6. Before: li r11,-1 xscvdp vs1,vs1 add. r10,r10,r11 After: li r11,-1 xscvdpsxds vs1,vs1 add. r10,r10,r11 Reported-by: Donald Stence Signed-off-by: Ravi Bangoria --- tools/perf/util/annotate.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 54321b947de8..6462a7423beb 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -165,7 +165,7 @@ static void ins__delete(struct ins_operands *ops) static int ins__raw_scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops) { - return scnprintf(bf, size, "%-6.6s %s", ins->name, ops->raw); + return scnprintf(bf, size, "%-6s %s", ins->name, ops->raw); } int ins__scnprintf(struct ins *ins, char *bf, size_t size, @@ -230,12 +230,12 @@ static int call__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops) { if (ops->target.name) - return scnprintf(bf, size, "%-6.6s %s", ins->name, ops->target.name); + return scnprintf(bf, size, "%-6s %s", ins->name, ops->target.name); if (ops->target.addr == 0) return ins__raw_scnprintf(ins, bf, size, ops); - return scnprintf(bf, size, "%-6.6s *%" PRIx64, ins->name, ops->target.addr); + return scnprintf(bf, size, "%-6s *%" PRIx64, ins->name, ops->target.addr); } static struct ins_ops call_ops = { @@ -299,7 +299,7 @@ static int jump__scnprintf(struct ins *ins, char *bf, size_t size, c++; } - return scnprintf(bf, size, "%-6.6s %.*s%" PRIx64, + return scnprintf(bf, size, "%-6s %.*s%" PRIx64, ins->name, c ? c - ops->raw : 0, ops->raw, ops->target.offset); } @@ -372,7 +372,7 @@ static int lock__scnprintf(struct ins *ins, char *bf, size_t size, if (ops->locked.ins.ops == NULL) return ins__raw_scnprintf(ins, bf, size, ops); - printed = scnprintf(bf, size, "%-6.6s ", ins->name); + printed = scnprintf(bf, size, "%-6s ", ins->name); return printed + ins__scnprintf(&ops->locked.ins, bf + printed, size - printed, ops->locked.ops); } @@ -448,7 +448,7 @@ static int mov__parse(struct arch *arch, struct ins_operands *ops, struct map *m static int mov__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops) { - return scnprintf(bf, size, "%-6.6s %s,%s", ins->name, + return scnprintf(bf, size, "%-6s %s,%s", ins->name, ops->source.name ?: ops->source.raw, ops->target.name ?: ops->target.raw); } @@ -488,7 +488,7 @@ static int dec__parse(struct arch *arch __maybe_unused, struct ins_operands *ops static int dec__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops) { - return scnprintf(bf, size, "%-6.6s %s", ins->name, + return scnprintf(bf, size, "%-6s %s", ins->name, ops->target.name ?: ops->target.raw); } @@ -500,7 +500,7 @@ static struct ins_ops dec_ops = { static int nop__scnprintf(struct ins *ins __maybe_unused, char *bf, size_t size, struct ins_operands *ops __maybe_unused) { - return scnprintf(bf, size, "%-6.6s", "nop"); + return scnprintf(bf, size, "%-6s", "nop"); } static struct ins_ops nop_ops = { @@ -990,7 +990,7 @@ void disasm_line__free(struct disasm_line *dl) int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw) { if (raw || !dl->ins.ops) - return scnprintf(bf, size, "%-6.6s %s", dl->ins.name, dl->ops.raw); + return scnprintf(bf, size, "%-6s %s", dl->ins.name, dl->ops.raw); return ins__scnprintf(&dl->ins, bf, size, &dl->ops); } -- 2.13.6 From 1583344371342108548@xxx Mon Nov 06 19:01:00 +0000 2017 X-GM-THRID: 1582987475292587563 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread