aboutsummaryrefslogtreecommitdiffstats
path: root/parse-events.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2010-05-14 05:05:16 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-05-17 21:38:28 -0400
commit30cd6e6b43aa5ae667567f7645d1eb4efc9ae875 (patch)
treec1a77619e811f0b71d76ced87030f870fe0d959a /parse-events.h
parent14dea24186809bbe8c0cce696c5f8298c794ae98 (diff)
parse-events: Pass context to callbacks
For the upcoming python plugin, it will be required to pass a context into the callback function so that it can use a single C function to handle everything. Acked-by: Darren Hart <dvhltc@us.ibm.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'parse-events.h')
-rw-r--r--parse-events.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse-events.h b/parse-events.h
index 0283f57..7d1c42e 100644
--- a/parse-events.h
+++ b/parse-events.h
@@ -87,7 +87,8 @@ struct event_format;
87 87
88typedef int (*pevent_event_handler_func)(struct trace_seq *s, 88typedef int (*pevent_event_handler_func)(struct trace_seq *s,
89 struct record *record, 89 struct record *record,
90 struct event_format *event); 90 struct event_format *event,
91 void *context);
91 92
92typedef int (*pevent_plugin_load_func)(struct pevent *pevent); 93typedef int (*pevent_plugin_load_func)(struct pevent *pevent);
93typedef int (*pevent_plugin_unload_func)(void); 94typedef int (*pevent_plugin_unload_func)(void);
@@ -230,6 +231,7 @@ struct event_format {
230 struct print_fmt print_fmt; 231 struct print_fmt print_fmt;
231 char *system; 232 char *system;
232 pevent_event_handler_func handler; 233 pevent_event_handler_func handler;
234 void *context;
233}; 235};
234 236
235enum { 237enum {
@@ -428,7 +430,7 @@ int pevent_parse_header_page(struct pevent *pevent, char *buf, unsigned long siz
428int pevent_parse_event(struct pevent *pevent, char *buf, unsigned long size, char *sys); 430int pevent_parse_event(struct pevent *pevent, char *buf, unsigned long size, char *sys);
429 431
430int pevent_register_event_handler(struct pevent *pevent, int id, char *sys_name, char *event_name, 432int pevent_register_event_handler(struct pevent *pevent, int id, char *sys_name, char *event_name,
431 pevent_event_handler_func func); 433 pevent_event_handler_func func, void *context);
432int pevent_register_print_function(struct pevent *pevent, 434int pevent_register_print_function(struct pevent *pevent,
433 pevent_func_handler func, 435 pevent_func_handler func,
434 enum pevent_func_arg_type ret_type, 436 enum pevent_func_arg_type ret_type,