- lttv_attributes *a;
- lttv_hooks *before, *after;
-
- a = lttv_global_attributes();
- before = (lttv_hooks *)lttv_attributes_get_pointer_pathname(a,
- "hooks/trace_set/before");
- after = (lttv_hooks *)lttv_attributes_get_pointer_pathname(a,
- "hooks/trace_set/after");
- lttv_hooks_add(before, textDump_trace_set_before, NULL);
- lttv_hooks_add(after, textDump_trace_set_after, NULL);
+ LttvAttribute_value *value;
+
+ LttvIAttributes *attributes = LTTV_IATTRIBUTES(lttv_global_attributes());
+
+ 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);