From f2923fb2ab6ecc36c74e7845b7b07fe96d3d6d67 Mon Sep 17 00:00:00 2001 From: compudj Date: Sat, 17 Dec 2005 04:02:41 +0000 Subject: [PATCH] fix process names git-svn-id: http://ltt.polymtl.ca/svn@1414 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/ltt/event.c | 8 ++++++++ ltt/branches/poly/ltt/event.h | 1 + ltt/branches/poly/lttv/lttv/state.c | 6 ++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ltt/branches/poly/ltt/event.c b/ltt/branches/poly/ltt/event.c index 6265f7fb..cf0b21f5 100644 --- a/ltt/branches/poly/ltt/event.c +++ b/ltt/branches/poly/ltt/event.c @@ -489,6 +489,14 @@ LttField *ltt_event_field_element_select(LttEvent *e, LttField *f, gulong i) return field; } + +off_t ltt_event_field_offset(LttEvent *e, LttField *f) +{ + return f->offset_root; +} + + + /***************************************************************************** * These functions extract data from an event after architecture specific * conversions diff --git a/ltt/branches/poly/ltt/event.h b/ltt/branches/poly/ltt/event.h index f243851f..ac3244a5 100644 --- a/ltt/branches/poly/ltt/event.h +++ b/ltt/branches/poly/ltt/event.h @@ -98,6 +98,7 @@ guint64 ltt_event_field_element_number(LttEvent *e, LttField *f); LttField *ltt_event_field_element_select(LttEvent *e, LttField *f, gulong i); +off_t ltt_event_field_offset(LttEvent *e, LttField *f); /* A union is like a structure except that only a single member at a time is present depending on the specific event instance. This function tells diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index 728e5899..22c1d3bf 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -1382,13 +1382,15 @@ static gboolean process_exec(void *hook_data, void *call_data) /* PID of the process to release */ 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); + LttField *child = ltt_event_field_element_select(e, thf->f1, 0); + gchar *name_begin = + (gchar*)(ltt_event_data(e)+ltt_event_field_offset(e, child)); 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); - + g_free(null_term_name); return FALSE; } -- 2.34.1