Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4781173imm; Mon, 25 Jun 2018 23:58:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfZpWL0E0bVNb8VUel2G9Hs8xdOOUm/zbMdLdduiPissvKJDYhXyOYt5MfyBeAwv44k/pVR X-Received: by 2002:a62:9bc5:: with SMTP id e66-v6mr338228pfk.84.1529996329700; Mon, 25 Jun 2018 23:58:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529996329; cv=none; d=google.com; s=arc-20160816; b=CkUGL6Buj4jJ9zsQV/JOsKm/qd7vis9eLdP22kIF5Vc0Hx6R75ObRFgJfWAh+59Qk/ 0Hdlz6H9/YARbBB7aeIY3dOezps0J1rZD4ZpgXRkBQ13WPPYuUJdJnlDDZcJ53lL83iZ tFfZjchXOinL9J62keojT88k9kp+T4rUQqH8HuIQx/sms2abh2D6q69/JzjI+cQx2rLO 9Zhc+CijJvRWxjfYF0ZSvClU6Msezo+yvZWQCfsjG8zZz7HS7Na2dx1vp3937493pG6y TZJnjVJWvuZO/psUYhUwUBiewsR/ncjZ3/mXYi7dekYZga7RwY+FCdwRAZooTJYZU4Xq myUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=OwHkbaP20v7XBSbGPyarrNsFC5QVp9NQuLZQqQ6H4Bs=; b=TCgLHOJanAgmaBnUPIuwW52F49Hq0TFndLczo2vJHce+RqgOHNadK4Uh/HYSJfKiXK XZTzsXRqTUn31ew6dPQCKJ9HX2retq7zeSNKCDTrNQDLQ5EN60eVlL/CtGzSab51Ai4Y zMTr/EKYW3JgH+jsMancvzJuLNr4FpK4iUHkouRP3kcaYOgFxG4FtRrU6zCaGEFwpiUD FofRWKt5emnObS0Ser0lxD6gwM+qDRnsFE8ys9sPKNvX2zBo+1xc4edN14Ex7FLecHCj bJFPqiwB86d5v+n0eKFE1ALA9B8+a6hrIF1gpQ7YmefSGZIxIW3p536kTmAKrKoFbGRT ftng== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e129-v6si985533pfg.112.2018.06.25.23.58.35; Mon, 25 Jun 2018 23:58:49 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752402AbeFZG6B (ORCPT + 99 others); Tue, 26 Jun 2018 02:58:01 -0400 Received: from terminus.zytor.com ([198.137.202.136]:44907 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751869AbeFZG56 (ORCPT ); Tue, 26 Jun 2018 02:57:58 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w5Q6vpI01591816 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 25 Jun 2018 23:57:51 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w5Q6voun1591811; Mon, 25 Jun 2018 23:57:50 -0700 Date: Mon, 25 Jun 2018 23:57:50 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Thomas Richter Message-ID: Cc: linux-kernel@vger.kernel.org, tmricht@linux.ibm.com, jolsa@redhat.com, hpa@zytor.com, acme@redhat.com, heiko.carstens@de.ibm.com, schwidefsky@de.ibm.com, tglx@linutronix.de, brueckner@linux.ibm.com, mingo@kernel.org Reply-To: tglx@linutronix.de, brueckner@linux.ibm.com, mingo@kernel.org, hpa@zytor.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, acme@redhat.com, tmricht@linux.ibm.com, linux-kernel@vger.kernel.org, jolsa@redhat.com In-Reply-To: <20180615101105.47047-1-tmricht@linux.ibm.com> References: <20180615101105.47047-1-tmricht@linux.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf alias: Remove trailing newline when reading sysfs files Git-Commit-ID: ea23ac73085743a4f1682d6605fe019577c82e1e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: ea23ac73085743a4f1682d6605fe019577c82e1e Gitweb: https://git.kernel.org/tip/ea23ac73085743a4f1682d6605fe019577c82e1e Author: Thomas Richter AuthorDate: Fri, 15 Jun 2018 12:11:03 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 25 Jun 2018 11:59:37 -0300 perf alias: Remove trailing newline when reading sysfs files 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: Heiko Carstens Cc: Jiri Olsa Cc: Martin Schwidefsky Link: http://lkml.kernel.org/r/20180615101105.47047-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- 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 d2fb597c9a8c..2738fc8d200d 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); }