From: Mathieu Desnoyers Date: Tue, 2 Nov 2010 21:22:35 +0000 (-0400) Subject: Fix block event resource view X-Git-Tag: v0.12.36~1^2~4 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=59dc1f2a91ea206e39d1ade572bec306811fff03;p=lttv.git Fix block event resource view Signed-off-by: Mathieu Desnoyers --- diff --git a/lttv/lttv/state.c b/lttv/lttv/state.c index 871df9bc..7700b52c 100644 --- a/lttv/lttv/state.c +++ b/lttv/lttv/state.c @@ -227,7 +227,7 @@ static void lttv_trace_states_read_raw(LttvTraceState *tcs, FILE *fp, GPtrArray *quarktable); /* Resource function prototypes */ -static LttvBdevState *get_hashed_bdevstate(LttvTraceState *ts, guint16 devcode); +static LttvBdevState *get_hashed_bdevstate(LttvTraceState *ts, guint32 devcode); static LttvBdevState *bdevstate_new(void); static void bdevstate_free(LttvBdevState *); static void bdevstate_free_cb(gpointer key, gpointer value, gpointer user_data); @@ -1491,9 +1491,10 @@ static void lttv_state_free_trap_states(LttvTrapState *states, guint n) /* bdevstate stuff */ -static LttvBdevState *get_hashed_bdevstate(LttvTraceState *ts, guint16 devcode) +static LttvBdevState *get_hashed_bdevstate(LttvTraceState *ts, guint32 devcode) { gint devcode_gint = devcode; + printf("get_hashed_bdevstate devcode %d\n", devcode_gint); gpointer bdev = g_hash_table_lookup(ts->bdev_states, &devcode_gint); if(bdev == NULL) { LttvBdevState *bdevstate = g_new(LttvBdevState, 1); @@ -2764,7 +2765,8 @@ static gboolean bdev_request_issue(void *hook_data, void *call_data) lttv_trace_get_hook_field(th, 1)); guint oper = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 2)); - guint16 devcode = MKDEV(major,minor); + guint32 devcode = MKDEV(major,minor); + printf("major %d minor %d oper %d devcode %d\n", major, minor, oper, devcode); /* have we seen this block device before? */ gpointer bdev = get_hashed_bdevstate(ts, devcode); @@ -2790,7 +2792,7 @@ static gboolean bdev_request_complete(void *hook_data, void *call_data) lttv_trace_get_hook_field(th, 1)); //guint oper = ltt_event_get_long_unsigned(e, // lttv_trace_get_hook_field(th, 2)); - guint16 devcode = MKDEV(major,minor); + guint32 devcode = MKDEV(major,minor); /* have we seen this block device before? */ gpointer bdev = get_hashed_bdevstate(ts, devcode); diff --git a/lttv/lttv/state.h b/lttv/lttv/state.h index 1e6efb57..0ae7e5c6 100644 --- a/lttv/lttv/state.h +++ b/lttv/lttv/state.h @@ -470,6 +470,6 @@ static inline guint lttv_state_get_target_pid(LttvTracefileState *tfs) #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)) +#define MKDEV(ma, mi) ((((unsigned int) (ma)) << MINORBITS) | (unsigned int) (mi)) #endif // STATE_H