From: tip-bot for Namhyung Kim <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: rostedt@goodmis.org, linux-kernel@vger.kernel.org,
fweisbec@gmail.com, peterz@infradead.org, mhiramat@kernel.org,
namhyung@kernel.org, mingo@kernel.org, acme@redhat.com,
hpa@zytor.com, tglx@linutronix.de, jolsa@kernel.org
Subject: [tip:perf/core] perf ftrace: Show error message when fails to set ftrace files
Date: Tue, 20 Jun 2017 02:05:18 -0700 [thread overview]
Message-ID: <tip-e7bd9ba20a9ec7024a0566a93c22b9571a48939a@git.kernel.org> (raw)
In-Reply-To: <20170618142302.25390-1-namhyung@kernel.org>
Commit-ID: e7bd9ba20a9ec7024a0566a93c22b9571a48939a
Gitweb: http://git.kernel.org/tip/e7bd9ba20a9ec7024a0566a93c22b9571a48939a
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Sun, 18 Jun 2017 23:22:59 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 19 Jun 2017 22:05:51 -0300
perf ftrace: Show error message when fails to set ftrace files
It'd be better for debugging to show an error message when it fails to
setup ftrace for some reason.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: kernel-team@lge.com
Link: http://lkml.kernel.org/r/20170618142302.25390-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-ftrace.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
index 9e0b35c..966a94f 100644
--- a/tools/perf/builtin-ftrace.c
+++ b/tools/perf/builtin-ftrace.c
@@ -61,6 +61,7 @@ static int __write_tracing_file(const char *name, const char *val, bool append)
int fd, ret = -1;
ssize_t size = strlen(val);
int flags = O_WRONLY;
+ char errbuf[512];
file = get_tracing_file(name);
if (!file) {
@@ -75,14 +76,16 @@ static int __write_tracing_file(const char *name, const char *val, bool append)
fd = open(file, flags);
if (fd < 0) {
- pr_debug("cannot open tracing file: %s\n", name);
+ pr_debug("cannot open tracing file: %s: %s\n",
+ name, str_error_r(errno, errbuf, sizeof(errbuf)));
goto out;
}
if (write(fd, val, size) == size)
ret = 0;
else
- pr_debug("write '%s' to tracing/%s failed\n", val, name);
+ pr_debug("write '%s' to tracing/%s failed: %s\n",
+ val, name, str_error_r(errno, errbuf, sizeof(errbuf)));
close(fd);
out:
prev parent reply other threads:[~2017-06-20 9:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-18 14:22 [PATCH 1/4] perf ftrace: Show error message when fails to set ftrace files Namhyung Kim
2017-06-18 14:23 ` [PATCH 2/4] perf ftrace: Move setup_pager before opening trace_pipe Namhyung Kim
2017-06-20 9:05 ` [tip:perf/core] " tip-bot for Namhyung Kim
2017-06-18 14:23 ` [PATCH 3/4] perf ftrace: Add option for function filtering Namhyung Kim
2017-06-20 9:06 ` [tip:perf/core] " tip-bot for Namhyung Kim
2017-06-18 14:23 ` [PATCH 4/4] perf ftrace: Add -D option for depth filter Namhyung Kim
2017-06-20 9:07 ` [tip:perf/core] " tip-bot for Namhyung Kim
2017-06-19 18:24 ` [PATCH 1/4] perf ftrace: Show error message when fails to set ftrace files Arnaldo Carvalho de Melo
2017-06-20 9:05 ` tip-bot for Namhyung Kim [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-e7bd9ba20a9ec7024a0566a93c22b9571a48939a@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox