X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Flttv%2Fstate.c;h=728e589928657b44f29408c59f1680cb3019ed3c;hb=743e50fd0105daeea4804d68989965399bf3a4d3;hp=5d757e035feb3206fb45bab515b74aac2a876780;hpb=2312de30ce2be53f81c4eaaa772ffff21511b509;p=lttv.git diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index 5d757e03..728e5899 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -1375,14 +1375,19 @@ static gboolean process_exec(void *hook_data, void *call_data) LttvTraceState *ts = (LttvTraceState*)s->parent.t_context; LttEvent *e = ltt_tracefile_get_event(s->parent.tf); LttvTraceHookByFacility *thf = (LttvTraceHookByFacility *)hook_data; - gchar *name; + //gchar *name; guint cpu = ltt_tracefile_num(s->parent.tf); LttvProcessState *process = ts->running_process[cpu]; /* PID of the process to release */ - name = ltt_event_get_string(e, thf->f1); - - process->name = g_quark_from_string(name); + guint64 name_len = ltt_event_field_element_number(e, thf->f1); + //name = ltt_event_get_string(e, thf->f1); + gchar *name_begin = ltt_event_field_element_select(e, thf->f1, 0); + gchar *null_term_name = g_new(gchar, name_len+1); + memcpy(null_term_name, name_begin, name_len); + null_term_name[name_len] = '\0'; + + process->name = g_quark_from_string(null_term_name); return FALSE; }