lkml.org 
[lkml]   [2017]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/5] perf/sdt: Show proper hint
Date
All events from 'perf list', except SDT events, can be directly
recorded with 'perf record'. But, the flow is little different
for SDT events. User has to probe on SDT events before recording
them. Perf is showing misleading message when user tries to
record SDT event without probing it. Show proper hint there.

Before patch:
$ perf record -a -e sdt_glib:idle__add
event syntax error: 'sdt_glib:idle__add'
\___ unknown tracepoint

Error: File /sys/kernel/debug/tracing/events/sdt_glib/idle__add ...
Hint: Perhaps this kernel misses some CONFIG_ setting to enable...
...

After patch:
$ perf record -e sdt_glib:main__after_check
event syntax error: 'sdt_glib:idle__add'
\___ unknown tracepoint

Error: File /sys/kernel/debug/tracing/events/sdt_glib/idle__add ...
Hint: SDT event has to be probed before recording it.

Suggested-by: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
---
tools/lib/api/fs/tracing_path.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/tools/lib/api/fs/tracing_path.c b/tools/lib/api/fs/tracing_path.c
index 251b7c3..a0e85df 100644
--- a/tools/lib/api/fs/tracing_path.c
+++ b/tools/lib/api/fs/tracing_path.c
@@ -99,10 +99,18 @@ static int strerror_open(int err, char *buf, size_t size, const char *filename)
* - jirka
*/
if (debugfs__configured() || tracefs__configured()) {
- snprintf(buf, size,
- "Error:\tFile %s/%s not found.\n"
- "Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n",
- tracing_events_path, filename);
+ /* sdt markers */
+ if (!strncmp(filename, "sdt_", 4)) {
+ snprintf(buf, size,
+ "Error:\tFile %s/%s not found.\n"
+ "Hint:\tSDT event has to be probed before recording it.\n",
+ tracing_events_path, filename);
+ } else {
+ snprintf(buf, size,
+ "Error:\tFile %s/%s not found.\n"
+ "Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n",
+ tracing_events_path, filename);
+ }
break;
}
snprintf(buf, size, "%s",
--
2.9.3
\
 
 \ /
  Last update: 2017-02-02 12:13    [W:0.405 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site