From: dagenais Date: Mon, 9 Jun 2003 20:47:46 +0000 (+0000) Subject: The code to print events is now part of textDump.c. If part of it is useful X-Git-Tag: v0.12.20~3397 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4d39e621d4dc65e7712c3308cb4d093464ae38e0;p=lttv.git The code to print events is now part of textDump.c. If part of it is useful graohical tools, it could be placed in a library instead. git-svn-id: http://ltt.polymtl.ca/svn@92 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/lttv/event.c b/ltt/branches/poly/lttv/event.c deleted file mode 100644 index 87c90ce7..00000000 --- a/ltt/branches/poly/lttv/event.c +++ /dev/null @@ -1,79 +0,0 @@ - -void lttv_event_to_string(ltt_event *e, lttv_string *s, bool mandatory_fields) -{ - ltt_facility *facility; - ltt_eventtype *eventtype; - ltt_type *type; - ltt_field *field; - ltt_time time; - - g_string_set_size(s,0); - - facility = lttv_event_facility(e); - eventtype = ltt_event_eventtype(e); - field = ltt_event_field(e); - - if(mandatory_fields) { - time = ltt_event_time(e); - g_string_append_printf(s,"%s.%s: %ld.%ld",ltt_facility_name(facility), - ltt_eventtype_name(eventtype), (long)time.tv_sec, time.tv_nsec); - } - - print_field(e,f,s); -} - -void print_field(ltt_event *e, ltt_field *f, lttv_string *s) { - ltt_type *type; - ltt_field *element; - - int nb, i; - - type = ltt_field_type(f); - switch(ltt_type_class(type)) { - case LTT_INT: - g_string_append_printf(s, " %ld", ltt_event_get_long_int(e,f)); - break; - - case LTT_UINT: - g_string_append_printf(s, " %lu", ltt_event_get_long_unsigned(e,f)); - break; - - case LTT_FLOAT: - g_string_append_printf(s, " %g", ltt_event_get_double(e,f)); - break; - - case LTT_STRING: - g_string_append_printf(s, " \"%s\"", ltt_event_get_string(e,f)); - break; - - case LTT_ENUM: - g_string_append_printf(s, " %s", ltt_enum_string_get(type, - event_get_unsigned(e,f)); - break; - - case LTT_ARRAY: - case LTT_SEQUENCE: - g_string_append_printf(s, " {"); - nb = ltt_event_field_element_number(e,f); - element = ltt_field_element(f); - for(i = 0 ; i < nb ; i++) { - ltt_event_field_element_select(e,f,i); - print_field(e,element,s); - } - g_string_append_printf(s, " }"); - break; - - case LTT_STRUCT: - g_string_append_printf(s, " {"); - nb = ltt_type_member_number(type); - for(i = 0 ; i < nb ; i++) { - element = ltt_field_member(f,i); - print_field(e,element,s); - } - g_string_append_printf(s, " }"); - break; - } -} - - -