+//void init(int argc, char **argv)
+G_MODULE_EXPORT void init(LttvModule *self, int argc, char **argv)
+{
+ LttvAttributeValue value;
+
+ LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
+
+ a_string = g_string_new("");
+
+ a_file_name = NULL;
+ lttv_option_add("output", 'o',
+ "output file where the text is written",
+ "file name",
+ LTTV_OPT_STRING, &a_file_name, NULL, NULL);
+
+ a_field_names = FALSE;
+ lttv_option_add("field_names", 'l',
+ "write the field names for each event",
+ "",
+ LTTV_OPT_NONE, &a_field_names, NULL, NULL);
+
+ a_state = FALSE;
+ lttv_option_add("process_state", 's',
+ "write the pid and state for each event",
+ "",
+ LTTV_OPT_NONE, &a_state, NULL, NULL);
+
+ g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/before",
+ LTTV_POINTER, &value));
+ g_assert((before_event = *(value.v_pointer)) != NULL);
+ lttv_hooks_add(before_event, write_event_content, NULL);
+
+ g_assert(lttv_iattribute_find_by_path(attributes, "hooks/trace/before",
+ LTTV_POINTER, &value));
+ g_assert((before_trace = *(value.v_pointer)) != NULL);
+ lttv_hooks_add(before_trace, write_trace_header, NULL);
+
+ g_assert(lttv_iattribute_find_by_path(attributes, "hooks/traceset/before",
+ LTTV_POINTER, &value));
+ g_assert((before_traceset = *(value.v_pointer)) != NULL);
+ lttv_hooks_add(before_traceset, write_traceset_header, NULL);
+
+ g_assert(lttv_iattribute_find_by_path(attributes, "hooks/traceset/after",
+ LTTV_POINTER, &value));
+ g_assert((after_traceset = *(value.v_pointer)) != NULL);
+ lttv_hooks_add(after_traceset, write_traceset_footer, NULL);
+}