aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/traceevent/event-parse.h
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2014-06-03 18:41:54 -0400
committerJiri Olsa <jolsa@kernel.org>2014-06-07 17:33:36 -0400
commit5827f2faabe40cc285cc67b697277547a19b6c9a (patch)
tree92396ee4eca5ac380cb23db6499137b8d5e454ad /tools/lib/traceevent/event-parse.h
parenta7c3196c79051f9e1a498f5be8fe6870bde5e55d (diff)
tools lib traceevent: Add options to plugins
The traceevent plugins allows developers to have their events print out information that is more advanced than what can be achieved by the trace event format files. As these plugins are used on the userspace side of the tracing tools, it is only logical that the tools should be able to produce different types of output for the events. The types of events still need to be defined by the plugins thus we need a way to pass information from the tool to the plugin to specify what type of information to be shown. Not only does the information need to be passed by the tool to plugin, but the plugin also requires a way to notify the tool of what options it can provide. This builds the plugin option infrastructure that is taken from trace-cmd that is used to allow plugins to produce different output based on the options specified by the tool. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/20140603184154.0a4c031c@gandalf.local.home Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools/lib/traceevent/event-parse.h')
-rw-r--r--tools/lib/traceevent/event-parse.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index a68ec3d8289f..56e0e6c12411 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -107,8 +107,8 @@ typedef int (*pevent_event_handler_func)(struct trace_seq *s,
107typedef int (*pevent_plugin_load_func)(struct pevent *pevent); 107typedef int (*pevent_plugin_load_func)(struct pevent *pevent);
108typedef int (*pevent_plugin_unload_func)(struct pevent *pevent); 108typedef int (*pevent_plugin_unload_func)(struct pevent *pevent);
109 109
110struct plugin_option { 110struct pevent_plugin_option {
111 struct plugin_option *next; 111 struct pevent_plugin_option *next;
112 void *handle; 112 void *handle;
113 char *file; 113 char *file;
114 char *name; 114 char *name;
@@ -135,7 +135,7 @@ struct plugin_option {
135 * PEVENT_PLUGIN_OPTIONS: (optional) 135 * PEVENT_PLUGIN_OPTIONS: (optional)
136 * Plugin options that can be set before loading 136 * Plugin options that can be set before loading
137 * 137 *
138 * struct plugin_option PEVENT_PLUGIN_OPTIONS[] = { 138 * struct pevent_plugin_option PEVENT_PLUGIN_OPTIONS[] = {
139 * { 139 * {
140 * .name = "option-name", 140 * .name = "option-name",
141 * .plugin_alias = "overide-file-name", (optional) 141 * .plugin_alias = "overide-file-name", (optional)
@@ -412,9 +412,19 @@ enum pevent_errno {
412 412
413struct plugin_list; 413struct plugin_list;
414 414
415#define INVALID_PLUGIN_LIST_OPTION ((char **)((unsigned long)-1))
416
415struct plugin_list *traceevent_load_plugins(struct pevent *pevent); 417struct plugin_list *traceevent_load_plugins(struct pevent *pevent);
416void traceevent_unload_plugins(struct plugin_list *plugin_list, 418void traceevent_unload_plugins(struct plugin_list *plugin_list,
417 struct pevent *pevent); 419 struct pevent *pevent);
420char **traceevent_plugin_list_options(void);
421void traceevent_plugin_free_options_list(char **list);
422int traceevent_plugin_add_options(const char *name,
423 struct pevent_plugin_option *options);
424void traceevent_plugin_remove_options(struct pevent_plugin_option *options);
425void traceevent_print_plugins(struct trace_seq *s,
426 const char *prefix, const char *suffix,
427 const struct plugin_list *list);
418 428
419struct cmdline; 429struct cmdline;
420struct cmdline_list; 430struct cmdline_list;