lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-e7bd9ba20a9ec7024a0566a93c22b9571a48939a@git.kernel.org>
Date:   Tue, 20 Jun 2017 02:05:18 -0700
From:   tip-bot for Namhyung Kim <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     rostedt@...dmis.org, linux-kernel@...r.kernel.org,
        fweisbec@...il.com, peterz@...radead.org, mhiramat@...nel.org,
        namhyung@...nel.org, mingo@...nel.org, acme@...hat.com,
        hpa@...or.com, tglx@...utronix.de, jolsa@...nel.org
Subject: [tip:perf/core] perf ftrace: Show error message when fails to set
 ftrace files

Commit-ID:  e7bd9ba20a9ec7024a0566a93c22b9571a48939a
Gitweb:     http://git.kernel.org/tip/e7bd9ba20a9ec7024a0566a93c22b9571a48939a
Author:     Namhyung Kim <namhyung@...nel.org>
AuthorDate: Sun, 18 Jun 2017 23:22:59 +0900
Committer:  Arnaldo Carvalho de Melo <acme@...hat.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@...nel.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: kernel-team@....com
Link: http://lkml.kernel.org/r/20170618142302.25390-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.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:

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ