[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-hhnbjdo8r67054of9zm2kxtl@git.kernel.org>
Date: Thu, 15 Aug 2019 02:28:32 -0700
From: tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: alexey.budankov@...ux.intel.com, jmorris@...ei.org, hpa@...or.com,
namhyung@...nel.org, suzuki.poulose@....com, mingo@...nel.org,
ilubashe@...mai.com, tglx@...utronix.de, acme@...hat.com,
mathieu.poirier@...aro.org, jolsa@...nel.org,
adrian.hunter@...el.com, peterz@...radead.org,
alexander.shishkin@...ux.intel.com, linux-kernel@...r.kernel.org
Subject: [tip:perf/core] perf ftrace: Improve error message about capability
to use ftrace
Commit-ID: 73e5de70dca00344cb48e018131a4cadec0fabf0
Gitweb: https://git.kernel.org/tip/73e5de70dca00344cb48e018131a4cadec0fabf0
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Mon, 12 Aug 2019 17:27:11 -0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Wed, 14 Aug 2019 10:59:59 -0300
perf ftrace: Improve error message about capability to use ftrace
If we link against libcap, then we can state that CAP_SYS_ADMIN is
needed, if not, fallback to telling the user it needs to be root, as was
before linking against libcap.
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Alexey Budankov <alexey.budankov@...ux.intel.com>
Cc: Igor Lubashev <ilubashe@...mai.com>
Cc: James Morris <jmorris@...ei.org>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Mathieu Poirier <mathieu.poirier@...aro.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Suzuki Poulouse <suzuki.poulose@....com>
Link: https://lkml.kernel.org/n/tip-hhnbjdo8r67054of9zm2kxtl@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/builtin-ftrace.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
index 01a5bb58eb04..1367bb5046a7 100644
--- a/tools/perf/builtin-ftrace.c
+++ b/tools/perf/builtin-ftrace.c
@@ -284,7 +284,13 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv)
};
if (!perf_cap__capable(CAP_SYS_ADMIN)) {
- pr_err("ftrace only works for root!\n");
+ pr_err("ftrace only works for %s!\n",
+#ifdef HAVE_LIBCAP_SUPPORT
+ "users with the SYS_ADMIN capability"
+#else
+ "root"
+#endif
+ );
return -1;
}
Powered by blists - more mailing lists