#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-
+
#include <glib.h>
#include <lttv/lttv.h>
#include <lttv/module.h>
{
guint i, nb_tracefile, nb_cpus, nb_irqs, nb_soft_irqs;
- LttvTracefileState *tfcs;
-
LttvAttribute *tracefiles_tree, *tracefile_tree;
guint *running_process;
nb_tracefile = self->parent.tracefiles->len;
for(i = 0 ; i < nb_tracefile ; i++) {
- tfcs =
- LTTV_TRACEFILE_STATE(g_array_index(self->parent.tracefiles,
- LttvTracefileContext*, i));
+
type = lttv_attribute_get(tracefiles_tree, i, &name, &value, &is_named);
g_assert(type == LTTV_GOBJECT);
tracefile_tree = *((LttvAttribute **)(value.v_gobject));
// }
// }
- name_tables->nb_syscalls = 256;
- name_tables->syscall_names = g_new(GQuark, 256);
- for(i = 0 ; i < 256 ; i++) {
+ name_tables->nb_syscalls = PREALLOC_NB_SYSCALLS;
+ name_tables->syscall_names = g_new(GQuark, name_tables->nb_syscalls);
+ for(i = 0 ; i < name_tables->nb_syscalls; i++) {
g_string_printf(fe_name, "syscall %d", i);
name_tables->syscall_names[i] = g_quark_from_string(fe_name->str);
}
// ltt_enum_string_get(t, i));
// }
- name_tables->nb_traps = 256;
- name_tables->trap_names = g_new(GQuark, 256);
- for(i = 0 ; i < 256 ; i++) {
+ name_tables->nb_traps = PREALLOC_NB_TRAPS;
+ name_tables->trap_names = g_new(GQuark, name_tables->nb_traps);
+ for(i = 0 ; i < name_tables->nb_traps; i++) {
g_string_printf(fe_name, "trap %d", i);
name_tables->trap_names[i] = g_quark_from_string(fe_name->str);
}
}
*/
/* FIXME: LttvIRQState *irq_states should become a g_array */
- /* temp fix: increase from 256 to 512 default size */
- name_tables->nb_irqs = 512;
- name_tables->irq_names = g_new(GQuark, 512);
- for(i = 0 ; i < 512 ; i++) {
+ name_tables->nb_irqs = PREALLOC_NB_IRQS;
+ name_tables->irq_names = g_new(GQuark, name_tables->nb_irqs);
+ for(i = 0 ; i < name_tables->nb_irqs; i++) {
g_string_printf(fe_name, "irq %d", i);
name_tables->irq_names[i] = g_quark_from_string(fe_name->str);
}
}
*/
- /* the kernel is limited to 32 statically defined softirqs */
- name_tables->nb_soft_irqs = 32;
+ name_tables->nb_soft_irqs = PREALLOC_NB_SOFT_IRQS;
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);
//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);
- guint64 nb_softirqs = nt->nb_soft_irqs;
- if(softirq < nb_softirqs) {
- submode = nt->soft_irq_names[softirq];
- } else {
- /* Fixup an incomplete irq table */
- GString *string = g_string_new("");
- g_string_printf(string, "softirq %" PRIu64, softirq);
- submode = g_quark_from_string(string->str);
- g_string_free(string, TRUE);
- }
+ expand_soft_irq_table(ts, softirq);
/* update softirq status */
/* a soft irq raises are not cumulative */
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
guint id;
- guint64 address;
char *symbol;
id = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 0));
- address = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1));
symbol = ltt_event_get_string(e, lttv_trace_get_hook_field(th, 2));
expand_syscall_table(ts, id);
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
guint id;
- guint64 address;
char *symbol;
id = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 0));
- address = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1));
symbol = ltt_event_get_string(e, lttv_trace_get_hook_field(th, 2));
expand_soft_irq_table(ts, id);
LttvTracefileState *s = (LttvTracefileState *)call_data;
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
- guint parent_pid;
guint child_pid; /* In the Linux Kernel, there is one PID per thread. */
guint child_tgid; /* tgid in the Linux kernel is the "real" POSIX PID. */
//LttvProcessState *zombie_process;
LttvProcessState *child_process;
struct marker_field *f;
- /* Parent PID */
- parent_pid = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 0));
+ /* Skip Parent PID param */
/* Child PID */
child_pid = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 1));
LttvProcessState *process = ts->running_process[cpu];
LttvProcessState *parent_process;
struct marker_field *f;
- GQuark type, mode, submode, status;
+ GQuark type;
LttvExecutionState *es;
guint i, nb_cpus;
//FIXME: type is rarely used, enum must match possible types.
- /* mode */
- f = lttv_trace_get_hook_field(th, 4);
- mode = ltt_enum_string_get(f,ltt_event_get_unsigned(e, f));
+ /* Skip mode 4th param */
- /* submode */
- f = lttv_trace_get_hook_field(th, 5);
- submode = ltt_enum_string_get(f, ltt_event_get_unsigned(e, f));
+ /* Skip submode 5th param */
- /* status */
- f = lttv_trace_get_hook_field(th, 6);
- status = ltt_enum_string_get(f, ltt_event_get_unsigned(e, f));
+ /* Skip status 6th param */
/* TGID */
f = lttv_trace_get_hook_field(th, 7);