network.xml \
process.xml \
socket.xml \
+statedump.xml \
timer.xml
facilities_DATA = \
network.xml \
process.xml \
socket.xml \
+statedump.xml \
timer.xml
<event name=fork>
<description>Process fork</description>
- <field name="parent_pid"> <description>PID of the parent process</description> <uint size=4/> </field>
- <field name="child_pid"> <description>PID of the child process</description> <uint size=4/> </field>
+ <field name="parent_pid"> <description>PID of the parent process</description> <uint/> </field>
+ <field name="child_pid"> <description>PID of the child process</description> <uint/> </field>
</event>
<event name=kernel_thread>
<description>Just created a new kernel thread</description>
- <field name="pid"> <description>PID of the kernel thread</description> <uint size=4/> </field>
+ <field name="pid"> <description>PID of the kernel thread</description> <uint/> </field>
<field name="function"> <description>Function called</description> <pointer/> </field>
</event>
<event name=exit>
<description>Process exit</description>
- <field name="pid"> <description>PID of the process</description> <uint size=4/> </field>
+ <field name="pid"> <description>PID of the process</description> <uint/> </field>
</event>
<event name=wait>
<description>Process wait</description>
- <field name="parent_pid"> <description>PID of the waiting process</description> <uint size=4/> </field>
- <field name="child_pid"> <description>PID of the process waited for</description> <uint size=4/> </field>
+ <field name="parent_pid"> <description>PID of the waiting process</description> <uint/> </field>
+ <field name="child_pid"> <description>PID of the process waited for</description> <uint/> </field>
</event>
<event name=free>
<description>Process kernel data structure free (end of life of a zombie)</description>
- <field name="pid"> <description>PID of the freed process</description> <uint size=4/> </field>
+ <field name="pid"> <description>PID of the freed process</description> <uint/> </field>
</event>
<event name=kill>
<description>Process kill system call</description>
- <field name="pid"> <description>PID of the process</description> <uint size=4/> </field>
- <field name="target_pid"> <description>PID of the process to kill</description> <uint size=4/> </field>
+ <field name="pid"> <description>PID of the process</description> <uint/> </field>
+ <field name="target_pid"> <description>PID of the process to kill</description> <uint/> </field>
<field name="signal"> <description>Signal number</description> <typeref name=signal_name/> </field>
</event>
<event name=signal>
<description>Process signal reception</description>
- <field name="pid"> <description>PID of the receiving process</description> <uint size=4/> </field>
+ <field name="pid"> <description>PID of the receiving process</description> <uint/> </field>
<field name="signal"> <description>Signal number</description> <typeref name=signal_name/> </field>
</event>
<event name=wakeup>
<description>Process wakeup</description>
- <field name="pid"> <description>PID of the receiving process</description> <uint size=4/> </field>
- <field name="state"> <description>State of the awakened process. -1 unrunnable, 0 runnable, >0 stopped.</description> <int size=4/> </field>
+ <field name="pid"> <description>PID of the receiving process</description> <uint/> </field>
+ <field name="state"> <description>State of the awakened process. -1 unrunnable, 0 runnable, >0 stopped.</description> <int/> </field>
</event>
<event name=schedchange>
<description>Scheduling change</description>
- <field name="out"> <description>Outgoing process</description> <uint size=4/> </field>
- <field name="in"> <description>Incoming process</description> <uint size=4/> </field>
- <field name="out_state"> <description>Outgoing process' state. -1 unrunnable, 0 runnable, >0 stopped.</description> <int size=4/> </field>
+ <field name="out"> <description>Outgoing process</description> <uint/> </field>
+ <field name="in"> <description>Incoming process</description> <uint/> </field>
+ <field name="out_state"> <description>Outgoing process' state. -1 unrunnable, 0 runnable, >0 stopped.</description> <int/> </field>
</event>
</facility>
-void compute_fields_offsets(LttTracefile *tf, LttField *field, off_t *offset,
- void *root);
-
-
+void compute_fields_offsets(LttTracefile *tf,
+ LttFacility *fac, LttField *field, off_t *offset, void *root);
LttEvent *ltt_event_new()
if(f->field_type.type_class != LTT_ARRAY &&
f->field_type.type_class != LTT_SEQUENCE)
- return ;
+ return NULL;
element_number = ltt_event_field_element_number(e,f);
event_type = ltt_event_eventtype(e);
/* Sanity check for i : 0..n-1 only, and must be lower or equal element_number
*/
- if(i >= element_number) return;
+ if(i >= element_number) return NULL;
if(f->field_type.type_class == LTT_ARRAY) {
field = &g_array_index(f->field_type.fields, LttField, 0);
if(field->field_size != 0) {
if(f->array_offset + (i * field->field_size) == field->offset_root)
- return; /* fixed length child, already at the right offset */
+ return field; /* fixed length child, already at the right offset */
else
new_offset = f->array_offset + (i * field->field_size);
} else {
/* Var. len. child */
new_offset = g_array_index(f->dynamic_offsets, off_t, i);
}
- compute_fields_offsets(e->tracefile, field, &new_offset, e->data);
+ compute_fields_offsets(e->tracefile,
+ ltt_event_facility(e), field, &new_offset, e->data);
return field;
}
g_assert(field->fixed_size == FIELD_FIXED);
size = field->field_size;
align = ltt_align(field->offset_root,
- size, event_type->facility->has_alignment);
+ size, event_type->facility->alignment);
field->offset_root += align;
field->offset_parent += align;
size += align;
*Function name
* compute_fields_offsets : set the precomputable offset of the fields
*Input params
- * tf : tracefile
+ * fac : facility
* field : the field
* offset : pointer to the current offset, must be incremented
****************************************************************************/
-void compute_fields_offsets(LttTracefile *tf, LttField *field, off_t *offset,
- void *root)
+void compute_fields_offsets(LttTracefile *tf,
+ LttFacility *fac, LttField *field, off_t *offset, void *root)
{
LttType *type = &field->field_type;
case LTT_ENUM:
if(field->fixed_root == FIELD_VARIABLE) {
/* Align offset on type size */
- *offset += ltt_align(*offset, get_alignment(tf, field),
- tf->has_alignment);
+ *offset += ltt_align(*offset, get_alignment(field),
+ fac->alignment);
/* remember offset */
field->offset_root = *offset;
/* Increment offset */
*offset += field->field_size;
+ } else {
+ //g_debug("type before offset : %llu %llu %u\n", *offset,
+ // field->offset_root,
+ // field->field_size);
+ *offset = field->offset_root;
+ *offset += field->field_size;
+ //g_debug("type after offset : %llu\n", *offset);
}
- /* None of these types has variable size, so we are sure that if
- * this element has a fixed_root, then the following one will have
- * a fixed root too, so it does not need the *offset at all.
- */
break;
case LTT_STRING:
if(field->fixed_root == FIELD_VARIABLE) {
field->offset_root = *offset;
}
*offset += strlen((gchar*)(root+*offset)) + 1;
+ /* Realign the data */
+ *offset += ltt_align(*offset, fac->pointer_size,
+ fac->alignment);
break;
case LTT_ARRAY:
g_assert(type->fields->len == 1);
off_t local_offset;
LttField *child = &g_array_index(type->fields, LttField, 0);
if(field->fixed_root == FIELD_VARIABLE) {
- *offset += ltt_align(*offset, get_alignment(tf, field),
- tf->has_alignment);
+ *offset += ltt_align(*offset, get_alignment(field),
+ fac->alignment);
/* remember offset */
field->offset_root = *offset;
field->array_offset = *offset;
0);
for(i=0; i<type->size; i++) {
g_array_append_val(field->dynamic_offsets, *offset);
- compute_fields_offsets(tf, child, offset, root);
+ compute_fields_offsets(tf, fac, child, offset, root);
}
}
// local_offset = field->array_offset;
// /* Set the offset at position 0 */
- // compute_fields_offsets(tf, child, &local_offset, root);
+ // compute_fields_offsets(tf, fac, child, &local_offset, root);
}
break;
case LTT_SEQUENCE:
off_t local_offset;
LttField *child;
guint i;
+ guint num_elem;
if(field->fixed_root == FIELD_VARIABLE) {
- *offset += ltt_align(*offset, get_alignment(tf, field),
- tf->has_alignment);
+ *offset += ltt_align(*offset, get_alignment(field),
+ fac->alignment);
/* remember offset */
field->offset_root = *offset;
child = &g_array_index(type->fields, LttField, 0);
- compute_fields_offsets(tf, child, offset, root);
+ compute_fields_offsets(tf, fac, child, offset, root);
child = &g_array_index(type->fields, LttField, 1);
- *offset += ltt_align(*offset, get_alignment(tf, child),
- tf->has_alignment);
+ *offset += ltt_align(*offset, get_alignment(child),
+ fac->alignment);
field->array_offset = *offset;
} else {
*offset = field->array_offset;
field->dynamic_offsets = g_array_set_size(field->dynamic_offsets,
0);
- for(i=0; i<ltt_event_field_element_number(&tf->event, field); i++) {
+ num_elem = ltt_event_field_element_number(&tf->event, field);
+ for(i=0; i<num_elem; i++) {
g_array_append_val(field->dynamic_offsets, *offset);
- compute_fields_offsets(tf, child, offset, root);
+ compute_fields_offsets(tf, fac, child, offset, root);
}
+ g_assert(num_elem == field->dynamic_offsets->len);
+
+ /* Realign the data */
+ *offset += ltt_align(*offset, fac->pointer_size,
+ fac->alignment);
+
// local_offset = field->array_offset;
// /* Set the offset at position 0 */
- // compute_fields_offsets(tf, child, &local_offset, root);
+ // compute_fields_offsets(tf, fac, child, &local_offset, root);
}
break;
case LTT_STRUCT:
guint i;
gint ret=0;
if(field->fixed_root == FIELD_VARIABLE) {
- *offset += ltt_align(*offset, get_alignment(tf, field),
- tf->has_alignment);
+ *offset += ltt_align(*offset, get_alignment(fac, field),
+ fac->alignment);
/* remember offset */
field->offset_root = *offset;
} else {
}
for(i=0; i<type->fields->len; i++) {
child = &g_array_index(type->fields, LttField, i);
- compute_fields_offsets(tf, child, offset, root);
+ compute_fields_offsets(tf, fac, child, offset, root);
}
}
break;
guint i;
gint ret=0;
if(field->fixed_root == FIELD_VARIABLE) {
- *offset += ltt_align(*offset, get_alignment(tf, field),
- tf->has_alignment);
+ *offset += ltt_align(*offset, get_alignment(field),
+ fac->alignment);
/* remember offset */
field->offset_root = *offset;
}
for(i=0; i<type->fields->len; i++) {
*offset = field->offset_root;
child = &g_array_index(type->fields, LttField, i);
- compute_fields_offsets(tf, child, offset, root);
+ compute_fields_offsets(tf, fac, child, offset, root);
}
*offset = field->offset_root + field->field_size;
}
* event : event type
*
****************************************************************************/
-void compute_offsets(LttTracefile *tf, LttEventType *event, off_t *offset,
- void *root)
+void compute_offsets(LttTracefile *tf, LttFacility *fac,
+ LttEventType *event, off_t *offset, void *root)
{
guint i;
- gint ret;
/* compute all variable offsets */
for(i=0; i<event->fields->len; i++) {
+ //g_debug("computing offset %u of %u\n", i, event->fields->len-1);
LttField *field = &g_array_index(event->fields, LttField, i);
- compute_fields_offsets(tf, field, offset, root);
- if(ret) break;
+ compute_fields_offsets(tf, fac, field, offset, root);
}
}
gchar *ltt_event_get_string(LttEvent *e, LttField *f);
-void compute_offsets(LttTracefile *tf, LttEventType *event, off_t *offset,
- void *root);
+void compute_offsets(LttTracefile *tf, LttFacility *fac,
+ LttEventType *event, off_t *offset, void *root);
#endif // EVENT_H
type->enum_map = NULL;
type->fields = NULL;
type->fields_by_name = NULL;
-
+
switch(td->type) {
case INT_FIXED:
type->type_class = LTT_INT_FIXED;
case UCHAR:
type->type_class = LTT_UCHAR;
type->size = td->size;
+ g_assert(type->size != 0);
break;
case SHORT:
type->type_class = LTT_SHORT;
case UINT:
type->type_class = LTT_UINT;
type->size = fac->int_size;
+ g_assert(type->size != 0);
break;
case LONG:
type->type_class = LTT_LONG;
type->size = fac->int_size;
{
guint i;
- type->enum_map = g_hash_table_new(g_int_hash, g_int_equal);
+ type->enum_map = g_hash_table_new(g_direct_hash, g_direct_equal);
for(i=0; i<td->labels.position; i++) {
GQuark value = g_quark_from_string((char*)td->labels.array[i]);
gint key = *(int*)td->labels_values.array[i];
g_hash_table_insert(type->enum_map, (gpointer)key, (gpointer)value);
}
}
+ g_assert(type->size != 0);
break;
case ARRAY:
type->type_class = LTT_ARRAY;
return ((alignment - align_drift) & (alignment-1));
}
-off_t field_align(LttTracefile *tf, LttField *field, off_t offset);
-
#endif /* LTT_PRIVATE_H */
}
else if(strcmp(token,"char") == 0) {
t->type = CHAR;
- t->size = 1;
getTypeAttributes(in, t, unnamed_types, named_types);
+ t->size = 1;
getForwardslash(in);
getRAnglebracket(in);
}
else if(strcmp(token,"uchar") == 0) {
t->type = UCHAR;
- t->size = 1;
getTypeAttributes(in, t, unnamed_types, named_types);
+ t->size = 1;
getForwardslash(in);
getRAnglebracket(in);
}
else if(strcmp(token,"short") == 0) {
t->type = SHORT;
- t->size = 2;
getTypeAttributes(in, t, unnamed_types, named_types);
+ t->size = 2;
getForwardslash(in);
getRAnglebracket(in);
}
else if(strcmp(token,"ushort") == 0) {
t->type = USHORT;
- t->size = 2;
getTypeAttributes(in, t, unnamed_types, named_types);
+ t->size = 2;
getForwardslash(in);
getRAnglebracket(in);
}
flag = 1;
break;
case SEQUENCE:
- sprintf(buf,"%zu", type->size);
- str = appendString("sequence ",buf);
+ str = allocAndCopy("sequence ");
flag = 1;
break;
case STRUCT:
void ltt_update_event_size(LttTracefile *tf);
-void precompute_offsets(LttTracefile *tf, LttEventType *event);
+void precompute_offsets(LttFacility *fac, LttEventType *event);
#if 0
/* Functions to parse system.xml file (using glib xml parser) */
struct LttFacilityLoad *fac_load_data;
struct LttStateDumpFacilityLoad *fac_state_dump_load_data;
char *fac_name;
+ void *pos;
// FIXME align
switch((enum ltt_core_events)tf->event.event_id) {
fac_name = (char*)(tf->event.data);
g_debug("Doing LTT_EVENT_FACILITY_LOAD of facility %s",
fac_name);
- fac_load_data =
- (struct LttFacilityLoad *)
- (tf->event.data + strlen(fac_name) + 1);
+ pos = (tf->event.data + strlen(fac_name) + 1);
+ pos += ltt_align((size_t)pos, sizeof(guint32), tf->has_alignment);
+ fac_load_data = (struct LttFacilityLoad *)pos;
+
fac = &g_array_index (tf->trace->facilities_by_num, LttFacility,
ltt_get_uint32(LTT_GET_BO(tf), &fac_load_data->id));
/* facility may already exist if trace is paused/unpaused */
/* Preset the field offsets */
for(i=0; i<fac->events->len; i++){
et = &g_array_index(fac->events, LttEventType, i);
- precompute_offsets(tf, et);
+ precompute_offsets(fac, et);
}
fac->exists = 1;
fac_name = (char*)(tf->event.data);
g_debug("Doing LTT_EVENT_STATE_DUMP_FACILITY_LOAD of facility %s",
fac_name);
- fac_state_dump_load_data =
- (struct LttStateDumpFacilityLoad *)
- (tf->event.data + strlen(fac_name) + 1);
+ pos = (tf->event.data + strlen(fac_name) + 1);
+ pos += ltt_align((size_t)pos, sizeof(guint32), tf->has_alignment);
+ fac_state_dump_load_data = (struct LttStateDumpFacilityLoad *)pos;
+
fac = &g_array_index (tf->trace->facilities_by_num, LttFacility,
ltt_get_uint32(LTT_GET_BO(tf), &fac_state_dump_load_data->id));
/* facility may already exist if trace is paused/unpaused */
/* Preset the field offsets */
for(i=0; i<fac->events->len; i++){
et = &g_array_index(fac->events, LttEventType, i);
- precompute_offsets(tf, et);
+ precompute_offsets(fac, et);
}
fac->exists = 1;
case LTT_EVENT_FACILITY_LOAD:
size = strlen((char*)tf->event.data) + 1;
//g_debug("Update Event facility load of facility %s", (char*)tf->event.data);
+ size += ltt_align(size, sizeof(guint32), tf->has_alignment);
size += sizeof(struct LttFacilityLoad);
break;
case LTT_EVENT_FACILITY_UNLOAD:
break;
case LTT_EVENT_STATE_DUMP_FACILITY_LOAD:
size = strlen((char*)tf->event.data) + 1;
+ size += ltt_align(size, sizeof(guint32), tf->has_alignment);
//g_debug("Update Event facility load state dump of facility %s",
// (char*)tf->event.data);
size += sizeof(struct LttStateDumpFacilityLoad);
}
/* Compute the dynamic offsets */
- compute_offsets(tf, event_type, &size, tf->event.data);
+ compute_offsets(tf, f, event_type, &size, tf->event.data);
//g_debug("Event root field : f.e %hhu.%hhu size %zd",
// tf->event.facility_id,
*Function name
* get_alignment : Get the alignment needed for a field.
*Input params
- * tf : tracefile
* field : field
*
* returns : The size on which it must be aligned.
*
****************************************************************************/
-off_t get_alignment(LttTracefile *tf, LttField *field)
+off_t get_alignment(LttField *field)
{
LttType *type = &field->field_type;
g_assert(type->fields->len == 1);
{
LttField *child = &g_array_index(type->fields, LttField, 0);
- return get_alignment(tf, child);
+ return get_alignment(child);
}
break;
case LTT_SEQUENCE:
off_t localign = 0;
LttField *child = &g_array_index(type->fields, LttField, 0);
- localign = max(localign, get_alignment(tf, child));
+ localign = max(localign, get_alignment(child));
child = &g_array_index(type->fields, LttField, 1);
- localign = max(localign, get_alignment(tf, child));
+ localign = max(localign, get_alignment(child));
return localign;
}
for(i=0; i<type->fields->len; i++) {
LttField *child = &g_array_index(type->fields, LttField, i);
- localign = max(localign, get_alignment(tf, child));
+ localign = max(localign, get_alignment(child));
}
return localign;
}
*
****************************************************************************/
-void field_compute_static_size(LttTracefile *tf, LttField *field)
+void field_compute_static_size(LttFacility *fac, LttField *field)
{
LttType *type = &field->field_type;
g_assert(type->fields->len == 1);
{
LttField *child = &g_array_index(type->fields, LttField, 0);
- field_compute_static_size(tf, child);
+ field_compute_static_size(fac, child);
if(child->field_size != 0) {
field->field_size = type->size * child->field_size;
{
off_t local_offset = 0;
LttField *child = &g_array_index(type->fields, LttField, 1);
- field_compute_static_size(tf, child);
+ field_compute_static_size(fac, child);
field->field_size = 0;
type->size = 0;
if(child->field_size != 0) {
guint i;
for(i=0;i<type->fields->len;i++) {
LttField *child = &g_array_index(type->fields, LttField, i);
- field_compute_static_size(tf, child);
+ field_compute_static_size(fac, child);
if(child->field_size != 0) {
- type->size += ltt_align(type->size, get_alignment(tf, child),
- tf->has_alignment);
+ type->size += ltt_align(type->size, get_alignment(child),
+ fac->alignment);
type->size += child->field_size;
} else {
/* As soon as we find a child with variable size, we have
*Function name
* precompute_fields_offsets : set the precomputable offset of the fields
*Input params
- * tf : tracefile
+ * fac : facility
* field : the field
* offset : pointer to the current offset, must be incremented
*
****************************************************************************/
-gint precompute_fields_offsets(LttTracefile *tf, LttField *field, off_t *offset)
+gint precompute_fields_offsets(LttFacility *fac, LttField *field, off_t *offset)
{
LttType *type = &field->field_type;
case LTT_OFF_T:
case LTT_FLOAT:
case LTT_ENUM:
+ g_assert(field->field_size != 0);
/* Align offset on type size */
- *offset += ltt_align(*offset, get_alignment(tf, field),
- tf->has_alignment);
+ *offset += ltt_align(*offset, get_alignment(field),
+ fac->alignment);
/* remember offset */
field->offset_root = *offset;
field->fixed_root = FIELD_FIXED;
{
LttField *child = &g_array_index(type->fields, LttField, 0);
- *offset += ltt_align(*offset, get_alignment(tf, field),
- tf->has_alignment);
+ *offset += ltt_align(*offset, get_alignment(field),
+ fac->alignment);
/* remember offset */
field->offset_root = *offset;
LttField *child;
guint ret;
- *offset += ltt_align(*offset, get_alignment(tf, field),
- tf->has_alignment);
+ *offset += ltt_align(*offset, get_alignment(field),
+ fac->alignment);
/* remember offset */
field->offset_root = *offset;
field->fixed_root = FIELD_FIXED;
child = &g_array_index(type->fields, LttField, 0);
- ret = precompute_fields_offsets(tf, child, offset);
+ ret = precompute_fields_offsets(fac, child, offset);
g_assert(ret == 0); /* Seq len cannot have variable len */
child = &g_array_index(type->fields, LttField, 1);
- *offset += ltt_align(*offset, get_alignment(tf, child),
- tf->has_alignment);
+ *offset += ltt_align(*offset, get_alignment(child),
+ fac->alignment);
field->array_offset = *offset;
- /* Set the offset position at position 0 */
- ret = precompute_fields_offsets(tf, child, offset);
+ /* Let the child be variable. */
+ //ret = precompute_fields_offsets(fac, child, offset);
/* Cannot precompute fields offsets of sequence members, and has
* variable length. */
guint i;
gint ret=0;
- *offset += ltt_align(*offset, get_alignment(tf, field),
- tf->has_alignment);
+ *offset += ltt_align(*offset, get_alignment(field),
+ fac->alignment);
/* remember offset */
field->offset_root = *offset;
field->fixed_root = FIELD_FIXED;
for(i=0; i< type->fields->len; i++) {
child = &g_array_index(type->fields, LttField, i);
- ret = precompute_fields_offsets(tf, child, offset);
+ ret = precompute_fields_offsets(fac, child, offset);
if(ret) break;
}
guint i;
gint ret=0;
- *offset += ltt_align(*offset, get_alignment(tf, field),
- tf->has_alignment);
+ *offset += ltt_align(*offset, get_alignment(field),
+ fac->alignment);
/* remember offset */
field->offset_root = *offset;
field->fixed_root = FIELD_FIXED;
for(i=0; i< type->fields->len; i++) {
*offset = field->offset_root;
child = &g_array_index(type->fields, LttField, i);
- ret = precompute_fields_offsets(tf, child, offset);
+ ret = precompute_fields_offsets(fac, child, offset);
if(ret) break;
}
* event : event type
*
****************************************************************************/
-void precompute_offsets(LttTracefile *tf, LttEventType *event)
+void precompute_offsets(LttFacility *fac, LttEventType *event)
{
guint i;
off_t offset = 0;
* arrays, struct and unions, which is not done by the parser */
for(i=0; i<event->fields->len; i++) {
LttField *field = &g_array_index(event->fields, LttField, i);
- field_compute_static_size(tf, field);
+ field_compute_static_size(fac, field);
}
/* Precompute all known offsets */
for(i=0; i<event->fields->len; i++) {
LttField *field = &g_array_index(event->fields, LttField, i);
- ret = precompute_fields_offsets(tf, field, &offset);
+ ret = precompute_fields_offsets(fac, field, &offset);
if(ret) break;
}
}
event_type = ltt_event_eventtype(e);
num_fields = ltt_eventtype_num_fields(event_type);
+ if(num_fields == 0) return;
+ g_string_append_printf(s, " ");
+ g_string_append_printf(s, "{ ");
for(i=0; i<num_fields; i++) {
field = ltt_eventtype_field(event_type, i);
if(field_names) {
g_string_append_printf(s, "%s = ", g_quark_to_string(name));
}
lttv_print_field(e, field, s, field_names);
+ if(i != num_fields-1) g_string_append_printf(s, ", ");
}
+ g_string_append_printf(s, " }");
}
static void init()
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;
}