Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp598243imm; Fri, 15 Jun 2018 03:12:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK3xNQlUn27jaijNK65sMwGN14rtPCEVjd6icxJmGOScXFYKMUjA+jMVYpVkPS4SuQRthR/ X-Received: by 2002:a62:8a83:: with SMTP id o3-v6mr1235141pfk.12.1529057537317; Fri, 15 Jun 2018 03:12:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529057537; cv=none; d=google.com; s=arc-20160816; b=D2eapEU6EIBpx+wyzcoZqt7no8usygdc+vBgfmFFT57X3u6YkhIyWoA/zZ2OgPVCi/ +5Zio+k6DKCf2Gz/ZIQk4BpOhQ0wo6ERez+rZ1PEFiojQiZ+7kEdykWkJZgr18Y7NuQ0 8HMHLsnzNDSijgs1ruGkSStCgLahdTC+Wo4st37phtYm1EWd4mT5I2IWqv/oLU6nL0FX P3wtTHtA4B9XmPxGy2VI/kk1hKh3smp3bsslwJ5ItbtKKI5IJoLUmAtnlFRM0+oeGjhj 6cCdM/ShyuRoaIOYBTWlO+PbPjUBcIMWOz/VIzZwmHFaXP2aBOXzS0uKRHGAl6ZYsGxZ UtWQ== 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=7bZEyjufSPZwcAVAngeb7pnFMGP6IE2yIxHo7+vpniI=; b=aY8r2aFhUpofnJvISVuZM2p21BJbCcnfpALM1WGXI6O8s5CI6a8CJhluuMA3Ia+Dqh 0NNNXc8we3D3aGxnkVg+Iz7BzQ1W8QP3YF+7e1Kq8XkcIf7bLERB4WmctOn80JL3xrta 8LkyH5lv3c3+qGU3oGkZGIhY4jzlAADerrUFSCbeyUKwwyVIuCWUC4sLKOwdPoztXVs9 JbGbGxYGeuWNWKh1uVC/207/dAQnZ8Yip1IPWVN/XP3gpTzHZ+soXynze1LjJs2anroq Q8h01p7w+v8SByN3TE5KRF28FZqDDUsO/AdZGhaWb4rUsXTuhrq29vl8UnmzDb9OjkGh we0A== 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 s5-v6si6011104pgp.246.2018.06.15.03.12.00; Fri, 15 Jun 2018 03:12:17 -0700 (PDT) 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 S965601AbeFOKL1 (ORCPT + 99 others); Fri, 15 Jun 2018 06:11:27 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:60142 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965581AbeFOKLX (ORCPT ); Fri, 15 Jun 2018 06:11:23 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5FAB7B1052762 for ; Fri, 15 Jun 2018 06:11:23 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jm7ymrmvn-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 15 Jun 2018 06:11:20 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 15 Jun 2018 11:11:14 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 15 Jun 2018 11:11:10 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w5FAB9IJ23855208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 15 Jun 2018 10:11:09 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 05F5E5204B; Fri, 15 Jun 2018 10:00:35 +0100 (BST) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id A872F52041; Fri, 15 Jun 2018 10:00:34 +0100 (BST) From: Thomas Richter To: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org Cc: brueckner@linux.vnet.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, Thomas Richter , Jiri Olsa Subject: [PATCH 1/3 v2] perf alias: Remove trailing newline when reading sysfs files Date: Fri, 15 Jun 2018 12:11:03 +0200 X-Mailer: git-send-email 2.16.4 X-TM-AS-GCONF: 00 x-cbid: 18061510-0028-0000-0000-000002D12178 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18061510-0029-0000-0000-000023884E1E Message-Id: <20180615101105.47047-1-tmricht@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-15_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806150110 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove a trailing newline when reading sysfs file contents such as /sys/devices/cpum_cf/events/TX_NC_TEND. This shows when verbose option -v is used. Output before: tx_nc_tend -> 'cpum_cf'/'event=0x008d '/ Output after: tx_nc_tend -> 'cpum_cf'/'event=0x8d'/ Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Cc: Jiri Olsa --- tools/perf/util/pmu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 7878934ebb23..6d2012405f2b 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -303,6 +303,9 @@ static int perf_pmu__new_alias(struct list_head *list, char *dir, char *name, FI buf[ret] = 0; + /* Remove trailing newline from sysfs file */ + rtrim(buf); + return __perf_pmu__new_alias(list, dir, name, NULL, buf, NULL, NULL, NULL, NULL, NULL, NULL); } -- 2.14.3