aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2011-03-18 15:02:35 -0400
committerSteven Rostedt <rostedt@goodmis.org>2011-03-18 15:02:35 -0400
commitce457d3364f1db3b0dbab9b2744d10e6be1d80c2 (patch)
tree2c6541e6a0418d55e27cf4ff015c819f144059a9
parent9c894c507392ee73628548ad832b008f296b16d6 (diff)
parse-events: Add names for plugin options
Add PEVENT_PLUGIN_ALIAS and PEVENT_PLUGIN_OPTIONS for plugins to use. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--parse-events.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/parse-events.h b/parse-events.h
index 5c58b62..ac34bad 100644
--- a/parse-events.h
+++ b/parse-events.h
@@ -98,12 +98,57 @@ typedef int (*pevent_event_handler_func)(struct trace_seq *s,
98typedef int (*pevent_plugin_load_func)(struct pevent *pevent); 98typedef int (*pevent_plugin_load_func)(struct pevent *pevent);
99typedef int (*pevent_plugin_unload_func)(void); 99typedef int (*pevent_plugin_unload_func)(void);
100 100
101struct plugin_option {
102 struct plugin_option *next;
103 void *handle;
104 char *file;
105 char *name;
106 char *plugin_alias;
107 char *description;
108 char *value;
109 void *private;
110 int set;
111};
112
113/*
114 * Plugin hooks that can be called:
115 *
116 * PEVENT_PLUGIN_LOADER: (required)
117 * The function name to initialized the plugin.
118 *
119 * int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
120 *
121 * PEVENT_PLUGIN_UNLOADER: (optional)
122 * The function called just before unloading
123 *
124 * int PEVENT_PLUGIN_UNLOADER(void)
125 *
126 * PEVENT_PLUGIN_OPTIONS: (optional)
127 * Plugin options that can be set before loading
128 *
129 * struct plugin_option PEVENT_PLUGIN_OPTIONS[] = {
130 * {
131 * .name = "option-name",
132 * .plugin_alias = "overide-file-name", (optional)
133 * .description = "description of option to show users",
134 * },
135 *
136 * .plugin_alias is used to give a shorter name to access
137 * the vairable. Useful if a plugin handles more than one event.
138 *
139 * PEVENT_PLUGIN_ALIAS: (optional)
140 * The name to use for finding options (uses filename if not defined)
141 */
101#define PEVENT_PLUGIN_LOADER pevent_plugin_loader 142#define PEVENT_PLUGIN_LOADER pevent_plugin_loader
102#define PEVENT_PLUGIN_UNLOADER pevent_plugin_unloader 143#define PEVENT_PLUGIN_UNLOADER pevent_plugin_unloader
144#define PEVENT_PLUGIN_OPTIONS pevent_plugin_options
145#define PEVENT_PLUGIN_ALIAS pevent_plugin_alias
103#define _MAKE_STR(x) #x 146#define _MAKE_STR(x) #x
104#define MAKE_STR(x) _MAKE_STR(x) 147#define MAKE_STR(x) _MAKE_STR(x)
105#define PEVENT_PLUGIN_LOADER_NAME MAKE_STR(PEVENT_PLUGIN_LOADER) 148#define PEVENT_PLUGIN_LOADER_NAME MAKE_STR(PEVENT_PLUGIN_LOADER)
106#define PEVENT_PLUGIN_UNLOADER_NAME MAKE_STR(PEVENT_PLUGIN_UNLOADER) 149#define PEVENT_PLUGIN_UNLOADER_NAME MAKE_STR(PEVENT_PLUGIN_UNLOADER)
150#define PEVENT_PLUGIN_OPTIONS_NAME MAKE_STR(PEVENT_PLUGIN_OPTIONS)
151#define PEVENT_PLUGIN_ALIAS_NAME MAKE_STR(PEVENT_PLUGIN_ALIAS)
107 152
108#define NSECS_PER_SEC 1000000000ULL 153#define NSECS_PER_SEC 1000000000ULL
109#define NSECS_PER_USEC 1000ULL 154#define NSECS_PER_USEC 1000ULL