summaryrefslogtreecommitdiffstats
path: root/tools/lib/traceevent/event-parse.h
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2013-12-12 16:36:17 +0900
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-12-18 14:47:58 -0300
commitbf19b82e7cf033319525a9eab12216b59c41c519 (patch)
tree9bd8cd68ac548688e4291340110e3433a66aae34 /tools/lib/traceevent/event-parse.h
parentf1cbf78d175e6202a29f53a7f915520e40a37baf (diff)
downloadlinux-bf19b82e7cf033319525a9eab12216b59c41c519.tar.gz
linux-bf19b82e7cf033319525a9eab12216b59c41c519.tar.bz2
linux-bf19b82e7cf033319525a9eab12216b59c41c519.zip
tools lib traceevent: Introduce pevent_filter_strerror()
The pevent_filter_strerror() function is for receiving actual error message from pevent_errno value. To do that, add a static buffer to event_filter for saving internal error message If a failed function saved other information in the static buffer returns the information, otherwise returns generic error message. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386833777-3790-15-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/traceevent/event-parse.h')
-rw-r--r--tools/lib/traceevent/event-parse.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index 3ad784f5f647..cf5db9013f2c 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -851,10 +851,13 @@ struct filter_type {
struct filter_arg *filter;
};
+#define PEVENT_FILTER_ERROR_BUFSZ 1024
+
struct event_filter {
struct pevent *pevent;
int filters;
struct filter_type *event_filters;
+ char error_buffer[PEVENT_FILTER_ERROR_BUFSZ];
};
struct event_filter *pevent_filter_alloc(struct pevent *pevent);
@@ -874,10 +877,12 @@ enum filter_trivial_type {
enum pevent_errno pevent_filter_add_filter_str(struct event_filter *filter,
const char *filter_str);
-
enum pevent_errno pevent_filter_match(struct event_filter *filter,
struct pevent_record *record);
+int pevent_filter_strerror(struct event_filter *filter, enum pevent_errno err,
+ char *buf, size_t buflen);
+
int pevent_event_filtered(struct event_filter *filter,
int event_id);