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("");
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(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);
}
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)
void lttv_event_to_string(LttEvent *e, GString *s, gboolean mandatory_fields,
gboolean field_names, LttvTracefileState *tfs);
#endif
-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);
+void lttv_event_get_name(LttvEvent *event,GString *a_string);
enum
{
TRACE_NAME_COLUMN,
- TRACEFILE_NAME_COLUMN,
CPUID_COLUMN,
EVENT_COLUMN,
TIME_S_COLUMN,
event_viewer_data->store_m = gtk_list_store_new (
N_COLUMNS, /* Total number of columns */
G_TYPE_STRING, /* Trace name */
- G_TYPE_STRING, /* Tracefile name */
G_TYPE_UINT, /* CPUID */
G_TYPE_STRING, /* Event */
G_TYPE_UINT, /* Time s */
G_CALLBACK(header_size_allocate),
(gpointer)event_viewer_data);
-
-
- renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes ("Tracefile",
- renderer,
- "text", TRACEFILE_NAME_COLUMN,
- NULL);
- gtk_tree_view_column_set_alignment (column, 0.0);
- gtk_tree_view_column_set_fixed_width (column, 120);
- gtk_tree_view_append_column (GTK_TREE_VIEW (event_viewer_data->tree_v),
- column);
-
-
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("CPUID",
renderer,
GtkTreeIter iter;
GString *desc = g_string_new("");
+ GString *name = g_string_new("");
LttvTracesetPosition *pos = lttv_traceset_create_position(traceState->trace->traceset);
- lttv_event_to_string(e, desc, TRUE);
+ lttv_event_to_string(e, desc, TRUE, FALSE);
+ lttv_event_get_name(e,name);
g_info("detail : %s", desc->str);
gtk_list_store_set (event_viewer_data->store_m, &iter,
TRACE_NAME_COLUMN, "TraceName",
- TRACEFILE_NAME_COLUMN,"TraceFile" /*traceState->trace->traceset->filename*/,
CPUID_COLUMN, cpu,
- EVENT_COLUMN,"EventName" /*bt_ctf_event_name(e->bt_event)*/,
+ EVENT_COLUMN,name->str,
TIME_S_COLUMN, time.tv_sec,
TIME_NS_COLUMN, time.tv_nsec,
PID_COLUMN, process->pid,
g_ptr_array_add(event_viewer_data->pos, pos);
g_string_free(desc, TRUE);
+ g_string_free(name, TRUE);
if(event_viewer_data->update_cursor) {
if(lttv_traceset_position_compare(pos,