Skip to contentSkip to conversation

perf evlist: Add suggestion of how to set perf_event_paranoid sysctl

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Jun 25, 2014 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  5229e366ee6baeb58b77e09643d2e11cbbd29950
Gitweb:     http://git.kernel.org/tip/5229e366ee6baeb58b77e09643d2e11cbbd29950
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Tue, 10 Jun 2014 17:18:54 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 19 Jun 2014 16:13:12 -0300

perf evlist: Add suggestion of how to set perf_event_paranoid sysctl

Minor hint to speed up problem resolution and get 'trace' working for non root users.

Cc Adrian Hunter <[email protected]>
Cc David Ahern <[email protected]>
Cc Don Zickus <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/util/evlist.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/perf/util/evlist.c +3 -2
index 59ef280..c51223a 100644
@@ -1214,10 +1214,11 @@ int perf_evlist__strerror_open(struct perf_evlist *evlist __maybe_unused,
 					     "For your workloads it needs to be <= 1\nHint:\t");
 		}
 		printed += scnprintf(buf + printed, size - printed,
-				     "For system wide tracing it needs to be set to -1");
+				     "For system wide tracing it needs to be set to -1.\n");
 
 		printed += scnprintf(buf + printed, size - printed,
-				    ".\nHint:\tThe current value is %d.", value);
+				    "Hint:\tTry: 'sudo sh -c \"echo -1 > /proc/sys/kernel/perf_event_paranoid\"'\n"
+				    "Hint:\tThe current value is %d.", value);
 		break;
 	default:
 		scnprintf(buf, size, "%s", emsg);