X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Flttv%2Fstate.h;h=87a89b992c213e243c67567c0f0aef1be849d4b4;hb=eb8871e7807eb640a853e6c5fc2eecb937c34314;hp=7884ff2fe363ece40eda83cefe7722b394d8ede4;hpb=86c32a8f662ef6a6c88a72d54c06d2a1095970bf;p=lttv.git diff --git a/ltt/branches/poly/lttv/lttv/state.h b/ltt/branches/poly/lttv/lttv/state.h index 7884ff2f..87a89b99 100644 --- a/ltt/branches/poly/lttv/lttv/state.h +++ b/ltt/branches/poly/lttv/lttv/state.h @@ -60,7 +60,9 @@ extern GQuark LTT_FACILITY_KERNEL_ARCH, LTT_FACILITY_FS, LTT_FACILITY_LIST, - LTT_FACILITY_USER_GENERIC; + LTT_FACILITY_USER_GENERIC, + LTT_FACILITY_BLOCK, + LTT_FACILITY_STATEDUMP; /* Events Quarks */ @@ -83,7 +85,12 @@ extern GQuark LTT_EVENT_STATEDUMP_END, LTT_EVENT_FUNCTION_ENTRY, LTT_EVENT_FUNCTION_EXIT, - LTT_EVENT_THREAD_BRAND; + LTT_EVENT_THREAD_BRAND, + LTT_EVENT_REQUEST_ISSUE, + LTT_EVENT_REQUEST_COMPLETE, + LTT_EVENT_LIST_INTERRUPT, + LTT_EVENT_SYS_CALL_TABLE, + LTT_EVENT_SOFTIRQ_VEC; /* Fields Quarks */ @@ -92,9 +99,9 @@ extern GQuark LTT_FIELD_TRAP_ID, LTT_FIELD_IRQ_ID, LTT_FIELD_SOFT_IRQ_ID, - LTT_FIELD_OUT, - LTT_FIELD_IN, - LTT_FIELD_OUT_STATE, + LTT_FIELD_PREV_PID, + LTT_FIELD_NEXT_PID, + LTT_FIELD_PREV_STATE, LTT_FIELD_PARENT_PID, LTT_FIELD_CHILD_PID, LTT_FIELD_PID, @@ -106,7 +113,14 @@ extern GQuark LTT_FIELD_SUBMODE, LTT_FIELD_STATUS, LTT_FIELD_THIS_FN, - LTT_FIELD_CALL_SITE; + LTT_FIELD_CALL_SITE, + LTT_FIELD_MINOR, + LTT_FIELD_MAJOR, + LTT_FIELD_OPERATION, + LTT_FIELD_ACTION, + LTT_FIELD_ID, + LTT_FIELD_ADDRESS, + LTT_FIELD_SYMBOL; typedef struct _LttvTracesetState LttvTracesetState; typedef struct _LttvTracesetStateClass LttvTracesetStateClass; @@ -198,6 +212,28 @@ extern LttvProcessType LTTV_STATE_USER_THREAD, LTTV_STATE_KERNEL_THREAD; +typedef GQuark LttvCPUMode; +extern LttvCPUMode + LTTV_CPU_UNKNOWN, + LTTV_CPU_IDLE, + LTTV_CPU_BUSY, + LTTV_CPU_IRQ, + LTTV_CPU_SOFT_IRQ, + LTTV_CPU_TRAP; + +typedef GQuark LttvIRQMode; +extern LttvIRQMode + LTTV_IRQ_UNKNOWN, + LTTV_IRQ_IDLE, + LTTV_IRQ_BUSY; + +typedef GQuark LttvBdevMode; +extern LttvBdevMode + LTTV_BDEV_UNKNOWN, + LTTV_BDEV_IDLE, + LTTV_BDEV_BUSY_READING, + LTTV_BDEV_BUSY_WRITING; + typedef struct _LttvExecutionState { LttvExecutionMode t; LttvExecutionSubmode n; @@ -230,6 +266,7 @@ typedef struct _LttvProcessState { guint64 current_function; LttvProcessType type; /* kernel thread or user space ? */ guint target_pid; /* target PID of the current event. */ + guint free_events; /* 0 : none, 1 : free or exit dead, 2 : should delete */ } LttvProcessState; #define ANY_CPU 0 /* For clarity sake : a call to lttv_state_find_process for @@ -277,6 +314,29 @@ GType lttv_traceset_state_get_type (void); #define LTTV_IS_TRACE_STATE_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), LTTV_TRACE_STATE_TYPE)) #define LTTV_TRACE_STATE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), LTTV_TRACE_STATE_TYPE, LttvTraceStateClass)) +typedef struct _LttvCPUState { + GArray *mode_stack; + guint last_irq; + guint last_soft_irq; + guint last_trap; +} LttvCPUState; + +typedef struct _LttvIRQState { + GArray *mode_stack; +} LttvIRQState; + +typedef struct _LttvSoftIRQState { + guint running; /* number of times it is currently running (on different processors) */ +} LttvSoftIRQState; + +typedef struct _LttvTrapState { + guint running; /* number of times it is currently running (on different processors) */ +} LttvTrapState; + +typedef struct _LttvBdevState { + GArray *mode_stack; +} LttvBdevState; + struct _LttvTraceState { LttvTraceContext parent; @@ -292,7 +352,7 @@ struct _LttvTraceState { GQuark *trap_names; guint nb_traps; guint nb_irqs; - guint nb_softirqs; + guint nb_soft_irqs; GQuark *irq_names; GQuark *soft_irq_names; LttTime *max_time_state_recomputed_in_seek; @@ -300,6 +360,11 @@ struct _LttvTraceState { /* Array of per cpu running process */ LttvProcessState **running_process; gboolean has_precomputed_states; + LttvCPUState *cpu_states; /* state of each cpu */ + LttvIRQState *irq_states; /* state of each irq handler */ + LttvSoftIRQState *soft_irq_states; /* state of each softirq */ + LttvTrapState *trap_states; /* state of each trap */ + GHashTable *bdev_states; /* state of the block devices */ }; struct _LttvTraceStateClass { @@ -332,10 +397,9 @@ int lttv_state_pop_state_cleanup(LttvProcessState *process, struct _LttvTracefileState { LttvTracefileContext parent; - //LttvProcessState *process; GQuark tracefile_name; - guint cpu; /* Current cpu of the tracefile */ -// guint saved_position; + guint cpu; /* Current cpu of the tracefile */ /* perhaps merge in cpu_state */ + LttvCPUState *cpu_state; /* cpu resource state */ }; struct _LttvTracefileStateClass { @@ -367,6 +431,11 @@ static inline guint lttv_state_get_target_pid(LttvTracefileState *tfs) #define HDR_QUARKS 9 #define HDR_QUARK 10 - +/* Device number manipulation macros from kernel source */ +#define MINORBITS 20 +#define MINORMASK ((1U << MINORBITS) - 1) +#define MAJOR(dev) ((unsigned int) ((dev) >> MINORBITS)) +#define MINOR(dev) ((unsigned int) ((dev) & MINORMASK)) +#define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi)) #endif // STATE_H