aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/traceevent/event-parse.h
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2013-12-12 02:36:17 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-12-18 12:47:58 -0500
commitbf19b82e7cf033319525a9eab12216b59c41c519 (patch)
tree9bd8cd68ac548688e4291340110e3433a66aae34 /tools/lib/traceevent/event-parse.h
parentf1cbf78d175e6202a29f53a7f915520e40a37baf (diff)
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 {
851 struct filter_arg *filter; 851 struct filter_arg *filter;
852}; 852};
853 853
854#define PEVENT_FILTER_ERROR_BUFSZ 1024
855
854struct event_filter { 856struct event_filter {
855 struct pevent *pevent; 857 struct pevent *pevent;
856 int filters; 858 int filters;
857 struct filter_type *event_filters; 859 struct filter_type *event_filters;
860 char error_buffer[PEVENT_FILTER_ERROR_BUFSZ];
858}; 861};
859 862
860struct event_filter *pevent_filter_alloc(struct pevent *pevent); 863struct event_filter *pevent_filter_alloc(struct pevent *pevent);
@@ -874,10 +877,12 @@ enum filter_trivial_type {
874enum pevent_errno pevent_filter_add_filter_str(struct event_filter *filter, 877enum pevent_errno pevent_filter_add_filter_str(struct event_filter *filter,
875 const char *filter_str); 878 const char *filter_str);
876 879
877
878enum pevent_errno pevent_filter_match(struct event_filter *filter, 880enum pevent_errno pevent_filter_match(struct event_filter *filter,
879 struct pevent_record *record); 881 struct pevent_record *record);
880 882
883int pevent_filter_strerror(struct event_filter *filter, enum pevent_errno err,
884 char *buf, size_t buflen);
885
881int pevent_event_filtered(struct event_filter *filter, 886int pevent_event_filtered(struct event_filter *filter,
882 int event_id); 887 int event_id);
883 888