Message ID | 20230123161114.261255-1-james.clark@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1699138wrn; Mon, 23 Jan 2023 08:29:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXs1wKosyvv1gX5giUoatTq6iC1SpdbKIaYfdz/qRYE6WLyZ1PH+ODD+lZmY3EjUQ8SsdHbx X-Received: by 2002:a17:907:1107:b0:870:e329:5f2f with SMTP id qu7-20020a170907110700b00870e3295f2fmr25494062ejb.51.1674491394294; Mon, 23 Jan 2023 08:29:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674491394; cv=none; d=google.com; s=arc-20160816; b=T6YPQOlawIUo+5mlQEL4XOGAchh84o9AcCehXV3W8QqUgLo8F/VZ3dzymd4zCFrMFm +vEYLDSxBDw8xEkxmQRNiw/9A4rbX7VNKqSMNYM9+hcRM5vtGuf0gow1BlQBOGHsARk9 z2JpigdCKNLr14jM/Vd70/6hja9GIMRmzLH9+/zh7/POMQRiewCgPUCMj8ZZqlkgLNgr u0i3+14gXAq4w/GzJK6tFlrgxsh3f7ZDtRDLtWviw7KlRLRbIvBZtdKJ2YpKGA7NpKhH yFawfZ/a5TwehT34Strn1WNtW9VepWkTjuJLF5xW5szTIJSp53i4qRRz3/ce91tXf2Y1 vDpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=2VZfM1hgqGnqtAjIyr9pMzeLSlkOGkAcMwkvfbtwclo=; b=zSnwWhOUurhG/QFD0oNtHNZCe976hOAjkj6LbgZNMasL+M3VlCft4zHmyarLxUAWzg Fzw95ULDzGlWl9N5RCAO+K+cbO/hda8HOujdKS1p/xbqq+yIfX9+LiHT8d1Y7Lxtnoz7 oR1zsVYNTiOkwSBNA/UlFSPF95P0/ii/DomeOLIgvfCh/FvkJ+jGvO0Cbt8yMXDaOagZ 0Ct2MjNm7gv3IAEhFvKyolq8MGNPHVsAalSyO3621Cf6tI4/W79MxBMZi2vEBPM7ZqXz 16yPB8WX4ndUsUGnudb/XyPcjOOUhegmyIZp9ixtJbUoicGyVpIRmY3800nbquNjh/nq +fvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb38-20020a170907162600b00877611b71a2si4416516ejc.580.2023.01.23.08.29.29; Mon, 23 Jan 2023 08:29:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233049AbjAWQLm (ORCPT <rfc822;liningstudo@gmail.com> + 99 others); Mon, 23 Jan 2023 11:11:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233072AbjAWQLj (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 23 Jan 2023 11:11:39 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7A9732B2AF; Mon, 23 Jan 2023 08:11:29 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DCFCEC14; Mon, 23 Jan 2023 08:12:10 -0800 (PST) Received: from e126815.warwick.arm.com (e126815.arm.com [10.32.32.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BFD903F5A1; Mon, 23 Jan 2023 08:11:26 -0800 (PST) From: James Clark <james.clark@arm.com> To: linux-perf-users@vger.kernel.org, acme@kernel.org Cc: linux-kernel@vger.kernel.org, James Clark <james.clark@arm.com>, Mathieu Poirier <mathieu.poirier@linaro.org>, Suzuki K Poulose <suzuki.poulose@arm.com>, Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>, John Garry <john.g.garry@oracle.com>, Will Deacon <will@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] perf: cs-etm: Improve missing sink warning message Date: Mon, 23 Jan 2023 16:11:14 +0000 Message-Id: <20230123161114.261255-1-james.clark@arm.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755831488102812273?= X-GMAIL-MSGID: =?utf-8?q?1755831488102812273?= |
Series |
perf: cs-etm: Improve missing sink warning message
|
|
Commit Message
James Clark
Jan. 23, 2023, 4:11 p.m. UTC
Make the sink error message more similar to the event error message that
reminds about missing kernel support. The available sinks are also
determined by the hardware so mention that too.
Also, usually it's not necessary to specify the sink, so add that as a
hint.
Now the error for a made up sink looks like this:
$ perf record -e cs_etm/@abc/
Couldn't find sink "abc" on event cs_etm/@abc/.
Missing kernel or device support? Errno: 2 (No such file or directory)
Hint: An appropriate sink will picked automatically if none is specified.
Signed-off-by: James Clark <james.clark@arm.com>
---
tools/perf/arch/arm/util/cs-etm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
base-commit: 5670ebf54bd26482f57a094c53bdc562c106e0a9
Comments
On 23/01/2023 16:11, James Clark wrote: > Make the sink error message more similar to the event error message that > reminds about missing kernel support. The available sinks are also > determined by the hardware so mention that too. > > Also, usually it's not necessary to specify the sink, so add that as a > hint. > > Now the error for a made up sink looks like this: > > $ perf record -e cs_etm/@abc/ > Couldn't find sink "abc" on event cs_etm/@abc/. > Missing kernel or device support? Errno: 2 (No such file or directory) > > Hint: An appropriate sink will picked automatically if none is specified. > > Signed-off-by: James Clark <james.clark@arm.com> > --- > tools/perf/arch/arm/util/cs-etm.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c > index 481e170cd3f1..c6195a7a3cbf 100644 > --- a/tools/perf/arch/arm/util/cs-etm.c > +++ b/tools/perf/arch/arm/util/cs-etm.c > @@ -283,7 +283,9 @@ static int cs_etm_set_sink_attr(struct perf_pmu *pmu, > > ret = perf_pmu__scan_file(pmu, path, "%x", &hash); > if (ret != 1) { > - pr_err("failed to set sink \"%s\" on event %s with %d (%s)\n", > + pr_err("Couldn't find sink \"%s\" on event %s\n" Could this be tied to "errno == ENOENT" ? Otherwise, this could be guiding the user to wrong direction. > + "Missing kernel or device support? errno: %d (%s)\n\n" > + "Hint: An appropriate sink will picked automatically if one isn't specified.\n", minor nit: "... sink will *be* picked.." ? Otherwise, looks good to me. Suzuki > sink, evsel__name(evsel), errno, > str_error_r(errno, msg, sizeof(msg))); > return ret; > > base-commit: 5670ebf54bd26482f57a094c53bdc562c106e0a9
diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c index 481e170cd3f1..c6195a7a3cbf 100644 --- a/tools/perf/arch/arm/util/cs-etm.c +++ b/tools/perf/arch/arm/util/cs-etm.c @@ -283,7 +283,9 @@ static int cs_etm_set_sink_attr(struct perf_pmu *pmu, ret = perf_pmu__scan_file(pmu, path, "%x", &hash); if (ret != 1) { - pr_err("failed to set sink \"%s\" on event %s with %d (%s)\n", + pr_err("Couldn't find sink \"%s\" on event %s\n" + "Missing kernel or device support? errno: %d (%s)\n\n" + "Hint: An appropriate sink will picked automatically if one isn't specified.\n", sink, evsel__name(evsel), errno, str_error_r(errno, msg, sizeof(msg))); return ret;