X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Flttv%2Fstate.h;h=c71049a82d63ffc713aae7ece2f8f09d728239ee;hb=0305fe774206ec12a98378be3cf891446b1b901c;hp=68c6eb2569378d029691d92a71c3381f3bf043d5;hpb=f63ebe5196f36fcf40385d29cfc37288c4d70817;p=lttv.git diff --git a/ltt/branches/poly/lttv/lttv/state.h b/ltt/branches/poly/lttv/lttv/state.h index 68c6eb25..c71049a8 100644 --- a/ltt/branches/poly/lttv/lttv/state.h +++ b/ltt/branches/poly/lttv/lttv/state.h @@ -60,7 +60,8 @@ extern GQuark LTT_FACILITY_KERNEL_ARCH, LTT_FACILITY_FS, LTT_FACILITY_LIST, - LTT_FACILITY_USER_GENERIC; + LTT_FACILITY_USER_GENERIC, + LTT_FACILITY_BLOCK; /* Events Quarks */ @@ -83,7 +84,10 @@ 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; /* Fields Quarks */ @@ -106,7 +110,11 @@ 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; typedef struct _LttvTracesetState LttvTracesetState; typedef struct _LttvTracesetStateClass LttvTracesetStateClass; @@ -198,6 +206,27 @@ 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_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; @@ -277,6 +306,24 @@ 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; +} 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 _LttvBdevState { + GArray *mode_stack; +} LttvBdevState; + struct _LttvTraceState { LttvTraceContext parent; @@ -292,7 +339,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 +347,10 @@ 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 */ + GHashTable *bdev_states; /* state of the block devices */ }; struct _LttvTraceStateClass { @@ -332,10 +383,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 +417,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