Initial commit for control flow view
[lttv.git] / lttv / lttv / print.c
index 5707175c3ee92627c5bbe568f42a3bc58fb64cad..6ad93419db09fdc28de9f98fff1be751c8fbd668 100644 (file)
@@ -323,7 +323,7 @@ int getProcessInfosFromEvent(LttvEvent *event, GString* processInfos)
        }
 #endif
        if (noError||1) {
-               g_string_append_printf(processInfos, "%u, %u, %s, %u", pid, tid, procname, ppid);
+               g_string_append_printf(processInfos, "%u, %u, %s, %u. %s, %s", pid, tid, procname, ppid, g_quark_to_string(process->state->t), g_quark_to_string(process->state->s));
        }
        else {
                ret = -1;
@@ -430,7 +430,8 @@ int getFieldsFromEvent(struct bt_ctf_event *ctf_event, GString* fields, gboolean
        return ret;
 }
 
-void lttv_event_to_string(LttvEvent *event, GString *a_string, gboolean field_names)
+void lttv_event_to_string(LttvEvent *event, GString *a_string,
+                               gboolean field_names, gboolean long_version)
 {
        GString* processInfos = g_string_new("");
        GString* fields = g_string_new("");
@@ -441,8 +442,13 @@ void lttv_event_to_string(LttvEvent *event, GString *a_string, gboolean field_na
        getCPUIdFromEvent(event, cpuId_str);
 
        g_string_set_size(a_string,0);
-
-       g_string_append_printf(a_string, "%llu %s: { %s }", bt_ctf_get_timestamp(event->bt_event), bt_ctf_event_name(event->bt_event), cpuId_str->str);
+       if(long_version){
+               g_string_append_printf(a_string, "%llu %s: ", 
+                                      bt_ctf_get_timestamp_raw(event->bt_event), 
+                                      bt_ctf_event_name(event->bt_event));
+       }
+       g_string_append_printf(a_string, "{ %s }", cpuId_str->str);
+       
        if (strcmp("", processInfos->str) < 0) {
                g_string_append_printf(a_string, ", { %s }", processInfos->str);
        }
@@ -454,7 +460,11 @@ void lttv_event_to_string(LttvEvent *event, GString *a_string, gboolean field_na
        g_string_free(processInfos, TRUE);
        g_string_free(cpuId_str, TRUE);
 }
-
+void lttv_event_get_name(LttvEvent *event,GString *a_string)
+{
+       g_string_set_size(a_string,0);
+       g_string_append_printf(a_string, " %s", bt_ctf_event_name(event->bt_event));
+}
 #ifdef BABEL_CLEANUP
 void lttv_event_to_string(LttEvent *e, GString *s, gboolean mandatory_fields,
                gboolean field_names, LttvTracefileState *tfs)
This page took 0.023272 seconds and 4 git commands to generate.