2 #include <lttv/state.h>
3 #include <ltt/facility.h>
7 LTTV_STATE_MODE_UNKNOWN
,
14 LTTV_STATE_SUBMODE_UNKNOWN
,
15 LTTV_STATE_SUBMODE_NONE
;
29 static void fill_name_tables(LttvTraceState
*tcs
);
31 static void free_name_tables(LttvTraceState
*tcs
);
33 static void remove_all_processes(GHashTable
*processes
);
35 LttvProcessState
*create_process(LttvTracefileState
*tfs
,
36 LttvProcessState
*parent
, guint pid
);
39 init(LttvTracesetState
*self
, LttvTraceset
*ts
)
41 guint i
, j
, nb_trace
, nb_control
, nb_per_cpu
, nb_tracefile
;
47 LttvTracefileState
*tfcs
;
49 LttTime timestamp
= {0,0};
51 LTTV_TRACESET_CONTEXT_CLASS(g_type_class_peek(LTTV_TRACESET_CONTEXT_TYPE
))->
52 init((LttvTracesetContext
*)self
, ts
);
54 nb_trace
= lttv_traceset_number(ts
);
55 for(i
= 0 ; i
< nb_trace
; i
++) {
56 tc
= self
->parent
.traces
[i
];
57 tcs
= (LttvTraceState
*)tc
;
58 tcs
->processes
= g_hash_table_new(g_direct_hash
, g_direct_equal
);
59 fill_name_tables(tcs
);
61 nb_control
= ltt_trace_control_tracefile_number(tc
->t
);
62 nb_per_cpu
= ltt_trace_per_cpu_tracefile_number(tc
->t
);
63 nb_tracefile
= nb_control
+ nb_per_cpu
;
64 for(j
= 0 ; j
< nb_tracefile
; j
++) {
66 tfcs
= LTTV_TRACEFILE_STATE(tc
->control_tracefiles
[j
]);
69 tfcs
= LTTV_TRACEFILE_STATE(tc
->per_cpu_tracefiles
[j
- nb_control
]);
72 tfcs
->parent
.timestamp
= timestamp
;
73 tfcs
->process
= create_process(tfcs
, NULL
,0);
74 tfcs
->cpu_name
= g_quark_from_string(ltt_tracefile_name(tfcs
->parent
.tf
));
81 fini(LttvTracesetState
*self
)
83 guint i
, j
, nb_trace
, nb_tracefile
;
87 LttvTracefileState
*tfcs
;
89 nb_trace
= lttv_traceset_number(LTTV_TRACESET_CONTEXT(self
)->ts
);
90 for(i
= 0 ; i
< nb_trace
; i
++) {
91 tcs
= (LttvTraceState
*)(LTTV_TRACESET_CONTEXT(self
)->traces
[i
]);
92 remove_all_processes(tcs
->processes
);
93 g_hash_table_destroy(tcs
->processes
);
94 free_name_tables(tcs
);
96 LTTV_TRACESET_CONTEXT_CLASS(g_type_class_peek(LTTV_TRACESET_CONTEXT_TYPE
))->
97 fini((LttvTracesetContext
*)self
);
101 static LttvTracesetContext
*
102 new_traceset_context(LttvTracesetContext
*self
)
104 return LTTV_TRACESET_CONTEXT(g_object_new(LTTV_TRACESET_STATE_TYPE
, NULL
));
108 static LttvTraceContext
*
109 new_trace_context(LttvTracesetContext
*self
)
111 return LTTV_TRACE_CONTEXT(g_object_new(LTTV_TRACE_STATE_TYPE
, NULL
));
115 static LttvTracefileContext
*
116 new_tracefile_context(LttvTracesetContext
*self
)
118 return LTTV_TRACEFILE_CONTEXT(g_object_new(LTTV_TRACEFILE_STATE_TYPE
, NULL
));
123 traceset_state_instance_init (GTypeInstance
*instance
, gpointer g_class
)
129 traceset_state_finalize (LttvTracesetState
*self
)
131 G_OBJECT_CLASS(g_type_class_peek(LTTV_TRACESET_CONTEXT_TYPE
))->
132 finalize(G_OBJECT(self
));
137 traceset_state_class_init (LttvTracesetContextClass
*klass
)
139 GObjectClass
*gobject_class
= G_OBJECT_CLASS(klass
);
141 gobject_class
->finalize
= (void (*)(GObject
*self
)) traceset_state_finalize
;
142 klass
->init
= (void (*)(LttvTracesetContext
*self
, LttvTraceset
*ts
))init
;
143 klass
->fini
= (void (*)(LttvTracesetContext
*self
))fini
;
144 klass
->new_traceset_context
= new_traceset_context
;
145 klass
->new_trace_context
= new_trace_context
;
146 klass
->new_tracefile_context
= new_tracefile_context
;
151 lttv_traceset_state_get_type(void)
153 static GType type
= 0;
155 static const GTypeInfo info
= {
156 sizeof (LttvTracesetStateClass
),
157 NULL
, /* base_init */
158 NULL
, /* base_finalize */
159 (GClassInitFunc
) traceset_state_class_init
, /* class_init */
160 NULL
, /* class_finalize */
161 NULL
, /* class_data */
162 sizeof (LttvTracesetContext
),
164 (GInstanceInitFunc
) traceset_state_instance_init
/* instance_init */
167 type
= g_type_register_static (LTTV_TRACESET_CONTEXT_TYPE
, "LttvTracesetStateType",
175 trace_state_instance_init (GTypeInstance
*instance
, gpointer g_class
)
181 trace_state_finalize (LttvTraceState
*self
)
183 G_OBJECT_CLASS(g_type_class_peek(LTTV_TRACE_CONTEXT_TYPE
))->
184 finalize(G_OBJECT(self
));
189 trace_state_class_init (LttvTraceContextClass
*klass
)
191 GObjectClass
*gobject_class
= G_OBJECT_CLASS(klass
);
193 gobject_class
->finalize
= (void (*)(GObject
*self
)) trace_state_finalize
;
198 lttv_trace_state_get_type(void)
200 static GType type
= 0;
202 static const GTypeInfo info
= {
203 sizeof (LttvTraceStateClass
),
204 NULL
, /* base_init */
205 NULL
, /* base_finalize */
206 (GClassInitFunc
) trace_state_class_init
, /* class_init */
207 NULL
, /* class_finalize */
208 NULL
, /* class_data */
209 sizeof (LttvTraceState
),
211 (GInstanceInitFunc
) trace_state_instance_init
/* instance_init */
214 type
= g_type_register_static (LTTV_TRACE_CONTEXT_TYPE
,
215 "LttvTraceStateType", &info
, 0);
222 tracefile_state_instance_init (GTypeInstance
*instance
, gpointer g_class
)
228 tracefile_state_finalize (LttvTracefileState
*self
)
230 G_OBJECT_CLASS(g_type_class_peek(LTTV_TRACEFILE_CONTEXT_TYPE
))->
231 finalize(G_OBJECT(self
));
236 tracefile_state_class_init (LttvTracefileStateClass
*klass
)
238 GObjectClass
*gobject_class
= G_OBJECT_CLASS(klass
);
240 gobject_class
->finalize
= (void (*)(GObject
*self
)) tracefile_state_finalize
;
245 lttv_tracefile_state_get_type(void)
247 static GType type
= 0;
249 static const GTypeInfo info
= {
250 sizeof (LttvTracefileStateClass
),
251 NULL
, /* base_init */
252 NULL
, /* base_finalize */
253 (GClassInitFunc
) tracefile_state_class_init
, /* class_init */
254 NULL
, /* class_finalize */
255 NULL
, /* class_data */
256 sizeof (LttvTracefileState
),
258 (GInstanceInitFunc
) tracefile_state_instance_init
/* instance_init */
261 type
= g_type_register_static (LTTV_TRACEFILE_CONTEXT_TYPE
,
262 "LttvTracefileStateType", &info
, 0);
269 fill_name_tables(LttvTraceState
*tcs
)
273 char *f_name
, *e_name
;
281 GString
*fe_name
= g_string_new("");
283 nb
= ltt_trace_eventtype_number(tcs
->parent
.t
);
284 tcs
->eventtype_names
= g_new(GQuark
, nb
);
285 for(i
= 0 ; i
< nb
; i
++) {
286 et
= ltt_trace_eventtype_get(tcs
->parent
.t
, i
);
287 e_name
= ltt_eventtype_name(et
);
288 f_name
= ltt_facility_name(ltt_eventtype_facility(et
));
289 g_string_printf(fe_name
, "%s.%s", f_name
, e_name
);
290 tcs
->eventtype_names
[i
] = g_quark_from_string(fe_name
->str
);
293 lttv_trace_find_hook(tcs
->parent
.t
, "core", "syscall_entry",
294 "syscall_id", NULL
, NULL
, NULL
, &h
);
295 t
= ltt_field_type(h
.f1
);
296 nb
= ltt_type_element_number(t
);
298 /* CHECK syscalls should be an emun but currently are not!
299 tcs->syscall_names = g_new(GQuark, nb);
301 for(i = 0 ; i < nb ; i++) {
302 tcs->syscall_names[i] = g_quark_from_string(ltt_enum_string_get(t, i));
306 tcs
->syscall_names
= g_new(GQuark
, 256);
307 for(i
= 0 ; i
< 256 ; i
++) {
308 g_string_printf(fe_name
, "syscall %d", i
);
309 tcs
->syscall_names
[i
] = g_quark_from_string(fe_name
->str
);
312 lttv_trace_find_hook(tcs
->parent
.t
, "core", "trap_entry",
313 "trap_id", NULL
, NULL
, NULL
, &h
);
314 t
= ltt_field_type(h
.f1
);
315 nb
= ltt_type_element_number(t
);
318 tcs->trap_names = g_new(GQuark, nb);
319 for(i = 0 ; i < nb ; i++) {
320 tcs->trap_names[i] = g_quark_from_string(ltt_enum_string_get(t, i));
324 tcs
->trap_names
= g_new(GQuark
, 256);
325 for(i
= 0 ; i
< 256 ; i
++) {
326 g_string_printf(fe_name
, "trap %d", i
);
327 tcs
->trap_names
[i
] = g_quark_from_string(fe_name
->str
);
330 lttv_trace_find_hook(tcs
->parent
.t
, "core", "irq_entry",
331 "irq_id", NULL
, NULL
, NULL
, &h
);
332 t
= ltt_field_type(h
.f1
);
333 nb
= ltt_type_element_number(t
);
336 tcs->irq_names = g_new(GQuark, nb);
337 for(i = 0 ; i < nb ; i++) {
338 tcs->irq_names[i] = g_quark_from_string(ltt_enum_string_get(t, i));
342 tcs
->irq_names
= g_new(GQuark
, 256);
343 for(i
= 0 ; i
< 256 ; i
++) {
344 g_string_printf(fe_name
, "irq %d", i
);
345 tcs
->irq_names
[i
] = g_quark_from_string(fe_name
->str
);
348 g_string_free(fe_name
, TRUE
);
353 free_name_tables(LttvTraceState
*tcs
)
355 g_free(tcs
->eventtype_names
);
356 g_free(tcs
->syscall_names
);
357 g_free(tcs
->trap_names
);
358 g_free(tcs
->irq_names
);
362 static void push_state(LttvTracefileState
*tfs
, LttvExecutionMode t
,
365 LttvExecutionState
*es
;
367 LttvProcessState
*process
= tfs
->process
;
369 guint depth
= process
->execution_stack
->len
;
371 g_array_set_size(process
->execution_stack
, depth
+ 1);
372 es
= &g_array_index(process
->execution_stack
, LttvExecutionState
, depth
);
375 es
->entry
= es
->change
= tfs
->parent
.timestamp
;
376 es
->s
= process
->state
->s
;
381 static void pop_state(LttvTracefileState
*tfs
, LttvExecutionMode t
)
383 LttvProcessState
*process
= tfs
->process
;
385 guint depth
= process
->execution_stack
->len
- 1;
387 if(process
->state
->t
!= t
){
388 g_warning("Different execution mode type (%d.%09d): ignore it\n",
389 tfs
->parent
.timestamp
.tv_sec
, tfs
->parent
.timestamp
.tv_nsec
);
390 g_warning("process state has %s when pop_int is %s\n",
391 g_quark_to_string(process
->state
->t
),
392 g_quark_to_string(t
));
393 g_warning("{ %u, %u, %s, %s }\n",
396 g_quark_to_string(process
->name
),
397 g_quark_to_string(process
->state
->s
));
402 g_warning("Trying to pop last state on stack (%d.%09d): ignore it\n",
403 tfs
->parent
.timestamp
.tv_sec
, tfs
->parent
.timestamp
.tv_nsec
);
407 g_array_remove_index(process
->execution_stack
, depth
);
409 process
->state
= &g_array_index(process
->execution_stack
, LttvExecutionState
,
411 process
->state
->change
= tfs
->parent
.timestamp
;
415 LttvProcessState
*create_process(LttvTracefileState
*tfs
,
416 LttvProcessState
*parent
, guint pid
)
418 LttvProcessState
*process
= g_new(LttvProcessState
, 1);
420 LttvExecutionState
*es
;
422 LttvTraceContext
*tc
;
428 tcs
= (LttvTraceState
*)tc
= tfs
->parent
.t_context
;
430 g_hash_table_insert(tcs
->processes
, GUINT_TO_POINTER(pid
), process
);
434 process
->ppid
= parent
->pid
;
435 process
->name
= parent
->name
;
439 process
->name
= LTTV_STATE_UNNAMED
;
442 process
->creation_time
= tfs
->parent
.timestamp
;
443 sprintf(buffer
,"%d-%lu.%lu",pid
, process
->creation_time
.tv_sec
,
444 process
->creation_time
.tv_nsec
);
445 process
->pid_time
= g_quark_from_string(buffer
);
446 process
->execution_stack
= g_array_new(FALSE
, FALSE
,
447 sizeof(LttvExecutionState
));
448 g_array_set_size(process
->execution_stack
, 1);
449 es
= process
->state
= &g_array_index(process
->execution_stack
,
450 LttvExecutionState
, 0);
451 es
->t
= LTTV_STATE_USER_MODE
;
452 es
->n
= LTTV_STATE_SUBMODE_NONE
;
453 es
->entry
= tfs
->parent
.timestamp
;
454 es
->change
= tfs
->parent
.timestamp
;
455 es
->s
= LTTV_STATE_WAIT_FORK
;
461 LttvProcessState
*lttv_state_find_process(LttvTracefileState
*tfs
, guint pid
)
463 LttvTraceState
*ts
=(LttvTraceState
*)LTTV_TRACEFILE_CONTEXT(tfs
)->t_context
;
464 LttvProcessState
*process
= g_hash_table_lookup(ts
->processes
,
465 GUINT_TO_POINTER(pid
));
466 if(process
== NULL
) process
= create_process(tfs
, NULL
, pid
);
471 static void exit_process(LttvTracefileState
*tfs
, LttvProcessState
*process
)
473 LttvTraceState
*ts
= LTTV_TRACE_STATE(tfs
->parent
.t_context
);
475 g_hash_table_remove(ts
->processes
, GUINT_TO_POINTER(process
->pid
));
476 g_array_free(process
->execution_stack
, TRUE
);
481 static void free_process_state(gpointer key
, gpointer value
,gpointer user_data
)
483 g_array_free(((LttvProcessState
*)value
)->execution_stack
, TRUE
);
488 static void remove_all_processes(GHashTable
*processes
)
490 g_hash_table_foreach(processes
, free_process_state
, NULL
);
494 static gboolean
syscall_entry(void *hook_data
, void *call_data
)
496 LttField
*f
= ((LttvTraceHook
*)hook_data
)->f1
;
498 LttvTracefileState
*s
= (LttvTracefileState
*)call_data
;
500 LttvExecutionSubmode submode
;
502 submode
= ((LttvTraceState
*)(s
->parent
.t_context
))->syscall_names
[
503 ltt_event_get_unsigned(s
->parent
.e
, f
)];
504 push_state(s
, LTTV_STATE_SYSCALL
, submode
);
509 static gboolean
syscall_exit(void *hook_data
, void *call_data
)
511 LttvTracefileState
*s
= (LttvTracefileState
*)call_data
;
513 pop_state(s
, LTTV_STATE_SYSCALL
);
518 static gboolean
trap_entry(void *hook_data
, void *call_data
)
520 LttField
*f
= ((LttvTraceHook
*)hook_data
)->f1
;
522 LttvTracefileState
*s
= (LttvTracefileState
*)call_data
;
524 LttvExecutionSubmode submode
;
526 submode
= ((LttvTraceState
*)(s
->parent
.t_context
))->trap_names
[
527 ltt_event_get_unsigned(s
->parent
.e
, f
)];
528 push_state(s
, LTTV_STATE_TRAP
, submode
);
533 static gboolean
trap_exit(void *hook_data
, void *call_data
)
535 LttvTracefileState
*s
= (LttvTracefileState
*)call_data
;
537 pop_state(s
, LTTV_STATE_TRAP
);
542 static gboolean
irq_entry(void *hook_data
, void *call_data
)
544 LttField
*f
= ((LttvTraceHook
*)hook_data
)->f1
;
546 LttvTracefileState
*s
= (LttvTracefileState
*)call_data
;
548 LttvExecutionSubmode submode
;
550 submode
= ((LttvTraceState
*)(s
->parent
.t_context
))->irq_names
[
551 ltt_event_get_unsigned(s
->parent
.e
, f
)];
553 /* Do something with the info about being in user or system mode when int? */
554 push_state(s
, LTTV_STATE_IRQ
, submode
);
559 static gboolean
irq_exit(void *hook_data
, void *call_data
)
561 LttvTracefileState
*s
= (LttvTracefileState
*)call_data
;
563 pop_state(s
, LTTV_STATE_IRQ
);
568 static gboolean
schedchange(void *hook_data
, void *call_data
)
570 LttvTraceHook
*h
= (LttvTraceHook
*)hook_data
;
572 LttvTracefileState
*s
= (LttvTracefileState
*)call_data
;
574 guint pid_in
, pid_out
, state_out
;
576 pid_in
= ltt_event_get_unsigned(s
->parent
.e
, h
->f1
);
577 pid_out
= ltt_event_get_unsigned(s
->parent
.e
, h
->f2
);
578 state_out
= ltt_event_get_unsigned(s
->parent
.e
, h
->f3
);
580 if(s
->process
!= NULL
) {
582 if(state_out
== 0) s
->process
->state
->s
= LTTV_STATE_WAIT_CPU
;
583 else if(s
->process
->state
->s
== LTTV_STATE_EXIT
)
584 exit_process(s
, s
->process
);
585 else s
->process
->state
->s
= LTTV_STATE_WAIT
;
587 if(s
->process
->pid
== 0)
588 s
->process
->pid
== pid_out
;
590 s
->process
->state
->change
= s
->parent
.timestamp
;
592 s
->process
= lttv_state_find_process(s
, pid_in
);
593 s
->process
->state
->s
= LTTV_STATE_RUN
;
594 s
->process
->state
->change
= s
->parent
.timestamp
;
599 static gboolean
process_fork(void *hook_data
, void *call_data
)
601 LttField
*f
= ((LttvTraceHook
*)hook_data
)->f1
;
603 LttvTracefileState
*s
= (LttvTracefileState
*)call_data
;
607 child_pid
= ltt_event_get_unsigned(s
->parent
.e
, f
);
608 create_process(s
, s
->process
, child_pid
);
613 static gboolean
process_exit(void *hook_data
, void *call_data
)
615 LttvTracefileState
*s
= (LttvTracefileState
*)call_data
;
617 if(s
->process
!= NULL
) {
618 s
->process
->state
->s
= LTTV_STATE_EXIT
;
624 lttv_state_add_event_hooks(LttvTracesetState
*self
)
626 LttvTraceset
*traceset
= self
->parent
.ts
;
628 guint i
, j
, k
, nb_trace
, nb_control
, nb_per_cpu
, nb_tracefile
;
636 LttvTracefileState
*tfs
;
644 LttvAttributeValue val
;
646 nb_trace
= lttv_traceset_number(traceset
);
647 for(i
= 0 ; i
< nb_trace
; i
++) {
648 ts
= (LttvTraceState
*)self
->parent
.traces
[i
];
650 /* Find the eventtype id for the following events and register the
651 associated by id hooks. */
653 hooks
= g_array_new(FALSE
, FALSE
, sizeof(LttvTraceHook
));
654 g_array_set_size(hooks
, 9);
656 lttv_trace_find_hook(ts
->parent
.t
, "core","syscall_entry","syscall_id",
657 NULL
, NULL
, syscall_entry
, &g_array_index(hooks
, LttvTraceHook
, 0));
659 lttv_trace_find_hook(ts
->parent
.t
, "core", "syscall_exit", NULL
, NULL
,
660 NULL
, syscall_exit
, &g_array_index(hooks
, LttvTraceHook
, 1));
662 lttv_trace_find_hook(ts
->parent
.t
, "core", "trap_entry", "trap_id",
663 NULL
, NULL
, trap_entry
, &g_array_index(hooks
, LttvTraceHook
, 2));
665 lttv_trace_find_hook(ts
->parent
.t
, "core", "trap_exit", NULL
, NULL
, NULL
,
666 trap_exit
, &g_array_index(hooks
, LttvTraceHook
, 3));
668 lttv_trace_find_hook(ts
->parent
.t
, "core", "irq_entry", "irq_id", NULL
,
669 NULL
, irq_entry
, &g_array_index(hooks
, LttvTraceHook
, 4));
671 lttv_trace_find_hook(ts
->parent
.t
, "core", "irq_exit", NULL
, NULL
, NULL
,
672 irq_exit
, &g_array_index(hooks
, LttvTraceHook
, 5));
674 lttv_trace_find_hook(ts
->parent
.t
, "core", "schedchange", "in", "out",
675 "out_state", schedchange
, &g_array_index(hooks
, LttvTraceHook
, 6));
677 lttv_trace_find_hook(ts
->parent
.t
, "core", "process_fork", "child_pid",
678 NULL
, NULL
, process_fork
, &g_array_index(hooks
, LttvTraceHook
, 7));
680 lttv_trace_find_hook(ts
->parent
.t
, "core", "process_exit", NULL
, NULL
,
681 NULL
, process_exit
, &g_array_index(hooks
, LttvTraceHook
, 8));
683 /* Add these hooks to each before_event_by_id hooks list */
685 nb_control
= ltt_trace_control_tracefile_number(ts
->parent
.t
);
686 nb_per_cpu
= ltt_trace_per_cpu_tracefile_number(ts
->parent
.t
);
687 nb_tracefile
= nb_control
+ nb_per_cpu
;
688 for(j
= 0 ; j
< nb_tracefile
; j
++) {
690 tfs
= LTTV_TRACEFILE_STATE(ts
->parent
.control_tracefiles
[j
]);
693 tfs
= LTTV_TRACEFILE_STATE(ts
->parent
.per_cpu_tracefiles
[j
-nb_control
]);
696 for(k
= 0 ; k
< hooks
->len
; k
++) {
697 hook
= g_array_index(hooks
, LttvTraceHook
, k
);
698 lttv_hooks_add(lttv_hooks_by_id_find(tfs
->parent
.after_event_by_id
,
699 hook
.id
), hook
.h
, &g_array_index(hooks
, LttvTraceHook
, k
));
702 lttv_attribute_find(self
->parent
.a
, LTTV_STATE_HOOKS
, LTTV_POINTER
, &val
);
703 *(val
.v_pointer
) = hooks
;
708 lttv_state_remove_event_hooks(LttvTracesetState
*self
)
710 LttvTraceset
*traceset
= self
->parent
.ts
;
712 guint i
, j
, k
, nb_trace
, nb_control
, nb_per_cpu
, nb_tracefile
;
716 LttvTracefileState
*tfs
;
724 LttvAttributeValue val
;
726 nb_trace
= lttv_traceset_number(traceset
);
727 for(i
= 0 ; i
< nb_trace
; i
++) {
728 ts
= LTTV_TRACE_STATE(self
->parent
.traces
[i
]);
729 lttv_attribute_find(self
->parent
.a
, LTTV_STATE_HOOKS
, LTTV_POINTER
, &val
);
730 hooks
= *(val
.v_pointer
);
732 /* Add these hooks to each before_event_by_id hooks list */
734 nb_control
= ltt_trace_control_tracefile_number(ts
->parent
.t
);
735 nb_per_cpu
= ltt_trace_per_cpu_tracefile_number(ts
->parent
.t
);
736 nb_tracefile
= nb_control
+ nb_per_cpu
;
737 for(j
= 0 ; j
< nb_tracefile
; j
++) {
739 tfs
= LTTV_TRACEFILE_STATE(ts
->parent
.control_tracefiles
[j
]);
742 tfs
= LTTV_TRACEFILE_STATE(ts
->parent
.per_cpu_tracefiles
[j
-nb_control
]);
745 for(k
= 0 ; k
< hooks
->len
; k
++) {
746 hook
= g_array_index(hooks
, LttvTraceHook
, k
);
747 lttv_hooks_remove_data(
748 lttv_hooks_by_id_find(tfs
->parent
.after_event_by_id
,
749 hook
.id
), hook
.h
, &g_array_index(hooks
, LttvTraceHook
, k
));
752 g_array_free(hooks
, TRUE
);
757 void lttv_state_init(int argc
, char **argv
)
759 LTTV_STATE_UNNAMED
= g_quark_from_string("unnamed");
760 LTTV_STATE_MODE_UNKNOWN
= g_quark_from_string("unknown execution mode");
761 LTTV_STATE_USER_MODE
= g_quark_from_string("user mode");
762 LTTV_STATE_WAIT_FORK
= g_quark_from_string("wait fork");
763 LTTV_STATE_SYSCALL
= g_quark_from_string("system call");
764 LTTV_STATE_TRAP
= g_quark_from_string("trap");
765 LTTV_STATE_IRQ
= g_quark_from_string("irq");
766 LTTV_STATE_SUBMODE_UNKNOWN
= g_quark_from_string("unknown submode");
767 LTTV_STATE_SUBMODE_NONE
= g_quark_from_string("(no submode)");
768 LTTV_STATE_WAIT_CPU
= g_quark_from_string("wait for cpu");
769 LTTV_STATE_EXIT
= g_quark_from_string("exiting");
770 LTTV_STATE_WAIT
= g_quark_from_string("wait for I/O");
771 LTTV_STATE_RUN
= g_quark_from_string("running");
772 LTTV_STATE_HOOKS
= g_quark_from_string("saved state hooks");
775 void lttv_state_destroy()