summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
81654ff)
Actually, looking back at state.c, I noticed there was a major problem
with name table resizing:
the top level pointers were copied from the name table structure to the
trace context, so when the tables were resized, the trace context was
not updated and still refered to the old tables. This is why we could
not free the old tables upon resizing.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
LttTracefile *tf = tfs->parent.tf;
struct marker_info *info = marker_get_info_from_id(tf->mdata, e->event_id);
LttvTraceState *ts = (LttvTraceState*)(tfs->parent.t_context);
LttTracefile *tf = tfs->parent.tf;
struct marker_info *info = marker_get_info_from_id(tf->mdata, e->event_id);
LttvTraceState *ts = (LttvTraceState*)(tfs->parent.t_context);
+ LttvNameTables *nt = ts->name_tables;
if (tf->name == LTT_CHANNEL_KERNEL) {
if (info->name == LTT_EVENT_SYSCALL_ENTRY
&& f->name == LTT_FIELD_SYSCALL_ID) {
g_string_append_printf(s, " [%s]",
if (tf->name == LTT_CHANNEL_KERNEL) {
if (info->name == LTT_EVENT_SYSCALL_ENTRY
&& f->name == LTT_FIELD_SYSCALL_ID) {
g_string_append_printf(s, " [%s]",
- g_quark_to_string(ts->syscall_names[value]));
+ g_quark_to_string(nt->syscall_names[value]));
} else if ((info->name == LTT_EVENT_SOFT_IRQ_ENTRY
|| info->name == LTT_EVENT_SOFT_IRQ_EXIT
|| info->name == LTT_EVENT_SOFT_IRQ_RAISE)
&& f->name == LTT_FIELD_SOFT_IRQ_ID) {
g_string_append_printf(s, " [%s]",
} else if ((info->name == LTT_EVENT_SOFT_IRQ_ENTRY
|| info->name == LTT_EVENT_SOFT_IRQ_EXIT
|| info->name == LTT_EVENT_SOFT_IRQ_RAISE)
&& f->name == LTT_FIELD_SOFT_IRQ_ID) {
g_string_append_printf(s, " [%s]",
- g_quark_to_string(ts->soft_irq_names[value]));
+ g_quark_to_string(nt->soft_irq_names[value]));
} else if (info->name == LTT_EVENT_KPROBE
&& f->name == LTT_FIELD_IP) {
#if (__SIZEOF_LONG__ == 4)
} else if (info->name == LTT_EVENT_KPROBE
&& f->name == LTT_FIELD_IP) {
#if (__SIZEOF_LONG__ == 4)
- GQuark symbol = (GQuark)g_hash_table_lookup(ts->kprobe_hash,
+ GQuark symbol = (GQuark)g_hash_table_lookup(nt->kprobe_hash,
(gconstpointer)&value);
#else
(gconstpointer)&value);
#else
- GQuark symbol = (GQuark)g_hash_table_lookup(ts->kprobe_hash,
+ GQuark symbol = (GQuark)g_hash_table_lookup(nt->kprobe_hash,
(gconstpointer)value);
#endif
if (symbol)
(gconstpointer)value);
#endif
if (symbol)
GQuark *old_table = *table;
*table = g_new(GQuark, new_nb);
memcpy(*table, old_table, nb * sizeof(GQuark));
GQuark *old_table = *table;
*table = g_new(GQuark, new_nb);
memcpy(*table, old_table, nb * sizeof(GQuark));
}
static void fill_name_table(LttvTraceState *ts, GQuark *table, guint nb,
}
static void fill_name_table(LttvTraceState *ts, GQuark *table, guint nb,
static void expand_syscall_table(LttvTraceState *ts, int id)
{
static void expand_syscall_table(LttvTraceState *ts, int id)
{
- guint new_nb = check_expand(ts->nb_syscalls, id);
- if(likely(new_nb == ts->nb_syscalls))
+ LttvNameTables *nt = ts->name_tables;
+ guint new_nb;
+
+ new_nb = check_expand(nt->nb_syscalls, id);
+ if(likely(new_nb == nt->nb_syscalls))
- expand_name_table(ts, &ts->syscall_names, ts->nb_syscalls, new_nb);
- fill_name_table(ts, ts->syscall_names, ts->nb_syscalls, new_nb, "syscall");
+ expand_name_table(ts, &nt->syscall_names, nt->nb_syscalls, new_nb);
+ fill_name_table(ts, nt->syscall_names, nt->nb_syscalls, new_nb, "syscall");
/* Update the table size */
/* Update the table size */
- ts->nb_syscalls = new_nb;
+ nt->nb_syscalls = new_nb;
}
static void expand_kprobe_table(LttvTraceState *ts, guint64 ip, char *symbol)
{
}
static void expand_kprobe_table(LttvTraceState *ts, guint64 ip, char *symbol)
{
+ LttvNameTables *nt = ts->name_tables;
#if (__SIZEOF_LONG__ == 4)
guint64 *ip_ptr = g_new(guint64, 1);
#if (__SIZEOF_LONG__ == 4)
guint64 *ip_ptr = g_new(guint64, 1);
- g_hash_table_insert(ts->kprobe_hash, ip_ptr,
+ g_hash_table_insert(nt->kprobe_hash, ip_ptr,
(gpointer)(glong)g_quark_from_string(symbol));
#else
(gpointer)(glong)g_quark_from_string(symbol));
#else
- g_hash_table_insert(ts->kprobe_hash, (gpointer)ip,
+ g_hash_table_insert(nt->kprobe_hash, (gpointer)ip,
(gpointer)(glong)g_quark_from_string(symbol));
#endif
}
static void expand_trap_table(LttvTraceState *ts, int id)
{
(gpointer)(glong)g_quark_from_string(symbol));
#endif
}
static void expand_trap_table(LttvTraceState *ts, int id)
{
- guint new_nb = check_expand(ts->nb_traps, id);
- guint i;
- if(likely(new_nb == ts->nb_traps))
+ LttvNameTables *nt = ts->name_tables;
+ LttvTrapState *old_table;
+ guint new_nb, i;
+
+ new_nb = check_expand(nt->nb_traps, id);
+ if(likely(new_nb == nt->nb_traps))
- expand_name_table(ts, &ts->trap_names, ts->nb_traps, new_nb);
- fill_name_table(ts, ts->trap_names, ts->nb_traps, new_nb, "trap");
- /* Update the table size */
- ts->nb_traps = new_nb;
- LttvTrapState *old_table = ts->trap_states;
+ expand_name_table(ts, &nt->trap_names, nt->nb_traps, new_nb);
+ fill_name_table(ts, nt->trap_names, nt->nb_traps, new_nb, "trap");
+
+ old_table = ts->trap_states;
ts->trap_states = g_new(LttvTrapState, new_nb);
ts->trap_states = g_new(LttvTrapState, new_nb);
- memcpy(ts->trap_states, old_table,
- ts->nb_traps * sizeof(LttvTrapState));
- for(i = ts->nb_traps; i < new_nb; i++)
+ memcpy(ts->trap_states, old_table, nt->nb_traps * sizeof(LttvTrapState));
+ g_free(old_table);
+ for(i = nt->nb_traps; i < new_nb; i++)
ts->trap_states[i].running = 0;
ts->trap_states[i].running = 0;
+
+ /* Update the table size */
+ nt->nb_traps = new_nb;
}
static void expand_irq_table(LttvTraceState *ts, int id)
{
}
static void expand_irq_table(LttvTraceState *ts, int id)
{
- guint new_nb = check_expand(ts->nb_irqs, id);
- guint i;
- if(likely(new_nb == ts->nb_irqs))
+ LttvNameTables *nt = ts->name_tables;
+ LttvIRQState *old_table;
+ guint new_nb, i;
+
+ new_nb = check_expand(nt->nb_irqs, id);
+ if(likely(new_nb == nt->nb_irqs))
- expand_name_table(ts, &ts->irq_names, ts->nb_irqs, new_nb);
- fill_name_table(ts, ts->irq_names, ts->nb_irqs, new_nb, "irq");
- LttvIRQState *old_table = ts->irq_states;
+ expand_name_table(ts, &nt->irq_names, nt->nb_irqs, new_nb);
+ fill_name_table(ts, nt->irq_names, nt->nb_irqs, new_nb, "irq");
+
+ old_table = ts->irq_states;
ts->irq_states = g_new(LttvIRQState, new_nb);
ts->irq_states = g_new(LttvIRQState, new_nb);
- memcpy(ts->irq_states, old_table, ts->nb_irqs * sizeof(LttvIRQState));
- for(i = ts->nb_irqs; i < new_nb; i++) {
- ts->irq_states[i].mode_stack = g_array_new(FALSE, FALSE, sizeof(LttvIRQMode));
- }
+ memcpy(ts->irq_states, old_table, nt->nb_irqs * sizeof(LttvIRQState));
+ g_free(old_table);
+ for(i = nt->nb_irqs; i < new_nb; i++)
+ ts->irq_states[i].mode_stack =
+ g_array_new(FALSE, FALSE, sizeof(LttvIRQMode));
/* Update the table size */
/* Update the table size */
}
static void expand_soft_irq_table(LttvTraceState *ts, int id)
{
}
static void expand_soft_irq_table(LttvTraceState *ts, int id)
{
- guint new_nb = check_expand(ts->nb_soft_irqs, id);
- guint i;
- if(likely(new_nb == ts->nb_soft_irqs))
+ LttvNameTables *nt = ts->name_tables;
+ LttvSoftIRQState *old_table;
+ guint new_nb, i;
+
+ new_nb = check_expand(nt->nb_soft_irqs, id);
+ if(likely(new_nb == nt->nb_soft_irqs))
- expand_name_table(ts, &ts->soft_irq_names, ts->nb_soft_irqs, new_nb);
- fill_name_table(ts, ts->soft_irq_names, ts->nb_soft_irqs, new_nb, "softirq");
- LttvSoftIRQState *old_table = ts->soft_irq_states;
+ expand_name_table(ts, &nt->soft_irq_names, nt->nb_soft_irqs, new_nb);
+ fill_name_table(ts, nt->soft_irq_names, nt->nb_soft_irqs, new_nb, "softirq");
+
+ old_table = ts->soft_irq_states;
ts->soft_irq_states = g_new(LttvSoftIRQState, new_nb);
memcpy(ts->soft_irq_states, old_table,
ts->soft_irq_states = g_new(LttvSoftIRQState, new_nb);
memcpy(ts->soft_irq_states, old_table,
- ts->nb_soft_irqs * sizeof(LttvSoftIRQState));
- for(i = ts->nb_soft_irqs; i < new_nb; i++)
+ nt->nb_soft_irqs * sizeof(LttvSoftIRQState));
+ g_free(old_table);
+ for(i = nt->nb_soft_irqs; i < new_nb; i++)
ts->soft_irq_states[i].running = 0;
/* Update the table size */
ts->soft_irq_states[i].running = 0;
/* Update the table size */
- ts->nb_soft_irqs = new_nb;
+ nt->nb_soft_irqs = new_nb;
//lttv_process_trace_seek_time(&self->parent, ltt_time_zero);
nb_cpus = ltt_trace_get_num_cpu(self->parent.t);
//lttv_process_trace_seek_time(&self->parent, ltt_time_zero);
nb_cpus = ltt_trace_get_num_cpu(self->parent.t);
- nb_irqs = self->nb_irqs;
- nb_soft_irqs = self->nb_soft_irqs;
- nb_traps = self->nb_traps;
+ nb_irqs = self->name_tables->nb_irqs;
+ nb_soft_irqs = self->name_tables->nb_soft_irqs;
+ nb_traps = self->name_tables->nb_traps;
/* Put the per cpu running_process to beginning state : process 0. */
for(i=0; i< nb_cpus; i++) {
/* Put the per cpu running_process to beginning state : process 0. */
for(i=0; i< nb_cpus; i++) {
nb_tracefile = tc->tracefiles->len;
nb_cpu = ltt_trace_get_num_cpu(tc->t);
nb_tracefile = tc->tracefiles->len;
nb_cpu = ltt_trace_get_num_cpu(tc->t);
+ nb_irq = tcs->name_tables->nb_irqs;
tcs->processes = NULL;
tcs->usertraces = NULL;
tcs->running_process = g_new(LttvProcessState*, nb_cpu);
tcs->processes = NULL;
tcs->usertraces = NULL;
tcs->running_process = g_new(LttvProcessState*, nb_cpu);
/* init soft irq stuff */
/* the kernel has a statically fixed max of 32 softirqs */
/* init soft irq stuff */
/* the kernel has a statically fixed max of 32 softirqs */
- tcs->soft_irq_states = g_new(LttvSoftIRQState, tcs->nb_soft_irqs);
+ tcs->soft_irq_states = g_new(LttvSoftIRQState, tcs->name_tables->nb_soft_irqs);
- tcs->trap_states = g_new(LttvTrapState, tcs->nb_traps);
+ tcs->trap_states = g_new(LttvTrapState, tcs->name_tables->nb_traps);
/* init bdev resource stuff */
tcs->bdev_states = g_hash_table_new(g_int_hash, g_int_equal);
/* init bdev resource stuff */
tcs->bdev_states = g_hash_table_new(g_int_hash, g_int_equal);
}
/* save the irq state */
}
/* save the irq state */
- nb_irqs = self->nb_irqs;
+ nb_irqs = self->name_tables->nb_irqs;
{
value = lttv_attribute_add(container, LTTV_STATE_RESOURCE_IRQS,
LTTV_POINTER);
{
value = lttv_attribute_add(container, LTTV_STATE_RESOURCE_IRQS,
LTTV_POINTER);
}
/* save the soft irq state */
}
/* save the soft irq state */
- nb_soft_irqs = self->nb_soft_irqs;
+ nb_soft_irqs = self->name_tables->nb_soft_irqs;
{
value = lttv_attribute_add(container, LTTV_STATE_RESOURCE_SOFT_IRQS,
LTTV_POINTER);
{
value = lttv_attribute_add(container, LTTV_STATE_RESOURCE_SOFT_IRQS,
LTTV_POINTER);
}
/* save the trap state */
}
/* save the trap state */
- nb_traps = self->nb_traps;
+ nb_traps = self->name_tables->nb_traps;
{
value = lttv_attribute_add(container, LTTV_STATE_RESOURCE_TRAPS,
LTTV_POINTER);
{
value = lttv_attribute_add(container, LTTV_STATE_RESOURCE_TRAPS,
LTTV_POINTER);
self->cpu_states = lttv_state_copy_cpu_states(*(value.v_pointer), nb_cpus);
/* restore irq resource states */
self->cpu_states = lttv_state_copy_cpu_states(*(value.v_pointer), nb_cpus);
/* restore irq resource states */
- nb_irqs = self->nb_irqs;
+ nb_irqs = self->name_tables->nb_irqs;
type = lttv_attribute_get_by_name(container, LTTV_STATE_RESOURCE_IRQS, &value);
g_assert(type == LTTV_POINTER);
lttv_state_free_irq_states(self->irq_states, nb_irqs);
self->irq_states = lttv_state_copy_irq_states(*(value.v_pointer), nb_irqs);
/* restore soft irq resource states */
type = lttv_attribute_get_by_name(container, LTTV_STATE_RESOURCE_IRQS, &value);
g_assert(type == LTTV_POINTER);
lttv_state_free_irq_states(self->irq_states, nb_irqs);
self->irq_states = lttv_state_copy_irq_states(*(value.v_pointer), nb_irqs);
/* restore soft irq resource states */
- nb_soft_irqs = self->nb_soft_irqs;
+ nb_soft_irqs = self->name_tables->nb_soft_irqs;
type = lttv_attribute_get_by_name(container, LTTV_STATE_RESOURCE_SOFT_IRQS, &value);
g_assert(type == LTTV_POINTER);
lttv_state_free_soft_irq_states(self->soft_irq_states, nb_soft_irqs);
self->soft_irq_states = lttv_state_copy_soft_irq_states(*(value.v_pointer), nb_soft_irqs);
/* restore trap resource states */
type = lttv_attribute_get_by_name(container, LTTV_STATE_RESOURCE_SOFT_IRQS, &value);
g_assert(type == LTTV_POINTER);
lttv_state_free_soft_irq_states(self->soft_irq_states, nb_soft_irqs);
self->soft_irq_states = lttv_state_copy_soft_irq_states(*(value.v_pointer), nb_soft_irqs);
/* restore trap resource states */
- nb_traps = self->nb_traps;
+ nb_traps = self->name_tables->nb_traps;
type = lttv_attribute_get_by_name(container, LTTV_STATE_RESOURCE_TRAPS, &value);
g_assert(type == LTTV_POINTER);
lttv_state_free_trap_states(self->trap_states, nb_traps);
type = lttv_attribute_get_by_name(container, LTTV_STATE_RESOURCE_TRAPS, &value);
g_assert(type == LTTV_POINTER);
lttv_state_free_trap_states(self->trap_states, nb_traps);
static void state_saved_free(LttvTraceState *self, LttvAttribute *container)
{
static void state_saved_free(LttvTraceState *self, LttvAttribute *container)
{
- guint i, nb_tracefile, nb_cpus, nb_irqs, nb_softirqs;
+ guint i, nb_tracefile, nb_cpus, nb_irqs, nb_soft_irqs;
LttvTracefileState *tfcs;
LttvTracefileState *tfcs;
lttv_state_free_cpu_states(*(value.v_pointer), nb_cpus);
/* free irq resource states */
lttv_state_free_cpu_states(*(value.v_pointer), nb_cpus);
/* free irq resource states */
- nb_irqs = self->nb_irqs;
+ nb_irqs = self->name_tables->nb_irqs;
type = lttv_attribute_get_by_name(container, LTTV_STATE_RESOURCE_IRQS, &value);
g_assert(type == LTTV_POINTER);
lttv_state_free_irq_states(*(value.v_pointer), nb_irqs);
/* free softirq resource states */
type = lttv_attribute_get_by_name(container, LTTV_STATE_RESOURCE_IRQS, &value);
g_assert(type == LTTV_POINTER);
lttv_state_free_irq_states(*(value.v_pointer), nb_irqs);
/* free softirq resource states */
- nb_softirqs = self->nb_irqs;
+ nb_soft_irqs = self->name_tables->nb_soft_irqs;
type = lttv_attribute_get_by_name(container, LTTV_STATE_RESOURCE_SOFT_IRQS, &value);
g_assert(type == LTTV_POINTER);
type = lttv_attribute_get_by_name(container, LTTV_STATE_RESOURCE_SOFT_IRQS, &value);
g_assert(type == LTTV_POINTER);
- lttv_state_free_soft_irq_states(*(value.v_pointer), nb_softirqs);
+ lttv_state_free_soft_irq_states(*(value.v_pointer), nb_soft_irqs);
/* free the blkdev states */
type = lttv_attribute_get_by_name(container, LTTV_STATE_RESOURCE_BLKDEVS, &value);
/* free the blkdev states */
type = lttv_attribute_get_by_name(container, LTTV_STATE_RESOURCE_BLKDEVS, &value);
-
-typedef struct _LttvNameTables {
- // FIXME GQuark *eventtype_names;
- GQuark *syscall_names;
- guint nb_syscalls;
- GQuark *trap_names;
- guint nb_traps;
- GQuark *irq_names;
- guint nb_irqs;
- GQuark *soft_irq_names;
- guint nb_softirqs;
- GHashTable *kprobe_hash;
-} LttvNameTables;
-
-
static void
create_name_tables(LttvTraceState *tcs)
{
static void
create_name_tables(LttvTraceState *tcs)
{
*/
/* the kernel is limited to 32 statically defined softirqs */
*/
/* the kernel is limited to 32 statically defined softirqs */
- name_tables->nb_softirqs = 32;
- name_tables->soft_irq_names = g_new(GQuark, name_tables->nb_softirqs);
- for(i = 0 ; i < name_tables->nb_softirqs ; i++) {
+ name_tables->nb_soft_irqs = 32;
+ name_tables->soft_irq_names = g_new(GQuark, name_tables->nb_soft_irqs);
+ for(i = 0 ; i < name_tables->nb_soft_irqs ; i++) {
g_string_printf(fe_name, "softirq %d", i);
name_tables->soft_irq_names[i] = g_quark_from_string(fe_name->str);
}
g_string_printf(fe_name, "softirq %d", i);
name_tables->soft_irq_names[i] = g_quark_from_string(fe_name->str);
}
static void
get_name_tables(LttvTraceState *tcs)
{
static void
get_name_tables(LttvTraceState *tcs)
{
- LttvNameTables *name_tables;
-
LttvAttributeValue v;
lttv_attribute_find(tcs->parent.t_a, LTTV_STATE_NAME_TABLES,
LTTV_POINTER, &v);
g_assert(*(v.v_pointer) != NULL);
LttvAttributeValue v;
lttv_attribute_find(tcs->parent.t_a, LTTV_STATE_NAME_TABLES,
LTTV_POINTER, &v);
g_assert(*(v.v_pointer) != NULL);
- name_tables = (LttvNameTables *)*(v.v_pointer);
- //tcs->eventtype_names = name_tables->eventtype_names;
- tcs->syscall_names = name_tables->syscall_names;
- tcs->nb_syscalls = name_tables->nb_syscalls;
- tcs->trap_names = name_tables->trap_names;
- tcs->nb_traps = name_tables->nb_traps;
- tcs->irq_names = name_tables->irq_names;
- tcs->soft_irq_names = name_tables->soft_irq_names;
- tcs->nb_irqs = name_tables->nb_irqs;
- tcs->nb_soft_irqs = name_tables->nb_softirqs;
- tcs->kprobe_hash = name_tables->kprobe_hash;
+ tcs->name_tables = (LttvNameTables *)*(v.v_pointer);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
struct marker_field *f = lttv_trace_get_hook_field(th, 0);
LttvExecutionSubmode submode;
LttvTraceHook *th = (LttvTraceHook *)hook_data;
struct marker_field *f = lttv_trace_get_hook_field(th, 0);
LttvExecutionSubmode submode;
+ LttvNameTables *nt = ((LttvTraceState *)(s->parent.t_context))->name_tables;
guint syscall = ltt_event_get_unsigned(e, f);
expand_syscall_table(ts, syscall);
guint syscall = ltt_event_get_unsigned(e, f);
expand_syscall_table(ts, syscall);
- submode = ((LttvTraceState *)(s->parent.t_context))->syscall_names[syscall];
+ submode = nt->syscall_names[syscall];
/* There can be no system call from PID 0 : unknown state */
if(process->pid != 0)
push_state(s, LTTV_STATE_SYSCALL, submode);
/* There can be no system call from PID 0 : unknown state */
if(process->pid != 0)
push_state(s, LTTV_STATE_SYSCALL, submode);
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
struct marker_field *f = lttv_trace_get_hook_field(th, 0);
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
struct marker_field *f = lttv_trace_get_hook_field(th, 0);
+ LttvNameTables *nt = ((LttvTraceState *)(s->parent.t_context))->name_tables;
LttvExecutionSubmode submode;
LttvExecutionSubmode submode;
expand_trap_table(ts, trap);
expand_trap_table(ts, trap);
- submode = ((LttvTraceState *)(s->parent.t_context))->trap_names[trap];
+ submode = nt->trap_names[trap];
push_state(s, LTTV_STATE_TRAP, submode);
push_state(s, LTTV_STATE_TRAP, submode);
//guint8 ev_id = ltt_event_eventtype_id(e);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
struct marker_field *f = lttv_trace_get_hook_field(th, 0);
//guint8 ev_id = ltt_event_eventtype_id(e);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
struct marker_field *f = lttv_trace_get_hook_field(th, 0);
+ LttvNameTables *nt = ((LttvTraceState *)(s->parent.t_context))->name_tables;
LttvExecutionSubmode submode;
guint64 irq = ltt_event_get_long_unsigned(e, f);
expand_irq_table(ts, irq);
LttvExecutionSubmode submode;
guint64 irq = ltt_event_get_long_unsigned(e, f);
expand_irq_table(ts, irq);
- submode = ((LttvTraceState *)(s->parent.t_context))->irq_names[irq];
+ submode = nt->irq_names[irq];
/* Do something with the info about being in user or system mode when int? */
push_state(s, LTTV_STATE_IRQ, submode);
/* Do something with the info about being in user or system mode when int? */
push_state(s, LTTV_STATE_IRQ, submode);
//guint8 ev_id = ltt_event_eventtype_id(e);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
struct marker_field *f = lttv_trace_get_hook_field(th, 0);
//guint8 ev_id = ltt_event_eventtype_id(e);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
struct marker_field *f = lttv_trace_get_hook_field(th, 0);
+ LttvNameTables *nt = ((LttvTraceState *)(s->parent.t_context))->name_tables;
LttvExecutionSubmode submode;
guint64 softirq = ltt_event_get_long_unsigned(e, f);
LttvExecutionSubmode submode;
guint64 softirq = ltt_event_get_long_unsigned(e, f);
- guint64 nb_softirqs = ((LttvTraceState *)(s->parent.t_context))->nb_soft_irqs;
+ guint64 nb_softirqs = nt->nb_soft_irqs;
if(softirq < nb_softirqs) {
if(softirq < nb_softirqs) {
- submode = ((LttvTraceState *)(s->parent.t_context))->soft_irq_names[softirq];
+ submode = nt->soft_irq_names[softirq];
} else {
/* Fixup an incomplete irq table */
GString *string = g_string_new("");
} else {
/* Fixup an incomplete irq table */
GString *string = g_string_new("");
LttvExecutionSubmode submode;
guint64 softirq = ltt_event_get_long_unsigned(e, f);
expand_soft_irq_table(ts, softirq);
LttvExecutionSubmode submode;
guint64 softirq = ltt_event_get_long_unsigned(e, f);
expand_soft_irq_table(ts, softirq);
- submode = ((LttvTraceState *)(s->parent.t_context))->soft_irq_names[softirq];
+ LttvNameTables *nt = ((LttvTraceState *)(s->parent.t_context))->name_tables;
+ submode = nt->soft_irq_names[softirq];
/* Do something with the info about being in user or system mode when int? */
push_state(s, LTTV_STATE_SOFT_IRQ, submode);
/* Do something with the info about being in user or system mode when int? */
push_state(s, LTTV_STATE_SOFT_IRQ, submode);
{
LttvTracefileState *s = (LttvTracefileState *)call_data;
LttvTraceState *ts = (LttvTraceState *)s->parent.t_context;
{
LttvTracefileState *s = (LttvTracefileState *)call_data;
LttvTraceState *ts = (LttvTraceState *)s->parent.t_context;
+ LttvNameTables *nt = ts->name_tables;
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
//guint8 ev_id = ltt_event_eventtype_id(e);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
//guint8 ev_id = ltt_event_eventtype_id(e);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
guint irq = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1));
expand_irq_table(ts, irq);
guint irq = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1));
expand_irq_table(ts, irq);
- ts->irq_names[irq] = action;
+ nt->irq_names[irq] = action;
{
LttvTracefileState *s = (LttvTracefileState *)call_data;
LttvTraceState *ts = (LttvTraceState*)s->parent.t_context;
{
LttvTracefileState *s = (LttvTracefileState *)call_data;
LttvTraceState *ts = (LttvTraceState*)s->parent.t_context;
+ LttvNameTables *nt = ts->name_tables;
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
guint id;
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
guint id;
symbol = ltt_event_get_string(e, lttv_trace_get_hook_field(th, 2));
expand_syscall_table(ts, id);
symbol = ltt_event_get_string(e, lttv_trace_get_hook_field(th, 2));
expand_syscall_table(ts, id);
- ts->syscall_names[id] = g_quark_from_string(symbol);
+ nt->syscall_names[id] = g_quark_from_string(symbol);
{
LttvTracefileState *s = (LttvTracefileState *)call_data;
LttvTraceState *ts = (LttvTraceState*)s->parent.t_context;
{
LttvTracefileState *s = (LttvTracefileState *)call_data;
LttvTraceState *ts = (LttvTraceState*)s->parent.t_context;
+ LttvNameTables *nt = ts->name_tables;
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
guint id;
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
guint id;
symbol = ltt_event_get_string(e, lttv_trace_get_hook_field(th, 2));
expand_soft_irq_table(ts, id);
symbol = ltt_event_get_string(e, lttv_trace_get_hook_field(th, 2));
expand_soft_irq_table(ts, id);
- ts->soft_irq_names[id] = g_quark_from_string(symbol);
+ nt->soft_irq_names[id] = g_quark_from_string(symbol);
f = lttv_trace_get_hook_field(th, 1);
filename = ltt_event_get_string(e, f);
f = lttv_trace_get_hook_field(th, 1);
filename = ltt_event_get_string(e, f);
- g_hash_table_insert(process->fds, (gpointer)fd, (gpointer)g_quark_from_string(filename));
+ g_hash_table_insert(process->fds, (gpointer)(long)fd,
+ (gpointer)(unsigned long)g_quark_from_string(filename));
GArray *mode_stack;
} LttvBdevState;
GArray *mode_stack;
} LttvBdevState;
+typedef struct _LttvNameTables {
+ GQuark *syscall_names;
+ guint nb_syscalls;
+ GQuark *trap_names;
+ guint nb_traps;
+ GQuark *irq_names;
+ guint nb_irqs;
+ GQuark *soft_irq_names;
+ guint nb_soft_irqs;
+ GHashTable *kprobe_hash;
+} LttvNameTables;
+
struct _LttvTraceState {
LttvTraceContext parent;
struct _LttvTraceState {
LttvTraceContext parent;
guint nb_event, save_interval;
/* Block/char devices, locks, memory pages... */
GQuark *eventtype_names;
guint nb_event, save_interval;
/* Block/char devices, locks, memory pages... */
GQuark *eventtype_names;
- GQuark *syscall_names;
- guint nb_syscalls;
- GQuark *trap_names;
- guint nb_traps;
- guint nb_irqs;
- guint nb_soft_irqs;
- GQuark *irq_names;
- GQuark *soft_irq_names;
+ LttvNameTables *name_tables;
LttTime *max_time_state_recomputed_in_seek;
GHashTable *kprobe_hash;
LttTime *max_time_state_recomputed_in_seek;
GHashTable *kprobe_hash;
GQuark name;
{
gchar *str;
GQuark name;
{
gchar *str;
- str = g_strdup_printf("IRQ %" PRIu64 " [%s]", irq, (char*)g_quark_to_string(ts->irq_names[irq]));
+ str = g_strdup_printf("IRQ %" PRIu64 " [%s]", irq,
+ (char*)g_quark_to_string(ts->name_tables->irq_names[irq]));
name = g_quark_from_string(str);
g_free(str);
}
name = g_quark_from_string(str);
g_free(str);
}