aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2012-09-01 23:35:55 +0200
committerChris Mason <chris.mason@oracle.com>2012-09-10 20:53:05 -0400
commit3b1763ebc32446916598d9fc4e5b480622bbf050 (patch)
tree76322246f1fa58ae428729ae68fea74224f6cadf
parentd389360718e9c436ba714697ebf0e15f01c6eeda (diff)
downloadiowatcher-3b1763ebc32446916598d9fc4e5b480622bbf050.tar.gz
Define mask of trace action and use it instead of opencoding the constant
Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r--blkparse.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/blkparse.c b/blkparse.c
index abdacb5..2be2f05 100644
--- a/blkparse.c
+++ b/blkparse.c
@@ -93,6 +93,8 @@ enum {
__BLK_TA_DRV_DATA, /* binary driver data */
};
+#define BLK_TA_MASK ((1 << BLK_TC_SHIFT) - 1)
+
/*
* Notify events.
*/
@@ -614,7 +616,7 @@ static inline int io_event(struct trace *trace)
void add_tput(struct trace *trace, struct graph_line_data *gld)
{
struct blk_io_trace *io = trace->io;
- int action = io->action & 0xffff;
+ int action = io->action & BLK_TA_MASK;
int seconds;
if (io->action & BLK_TC_ACT(BLK_TC_NOTIFY))
@@ -639,7 +641,7 @@ void add_io(struct trace *trace, struct graph_dot_data *gdd_writes,
struct graph_dot_data *gdd_reads)
{
struct blk_io_trace *io = trace->io;
- int action = io->action & 0xffff;
+ int action = io->action & BLK_TA_MASK;
u64 offset;
if (io->action & BLK_TC_ACT(BLK_TC_NOTIFY))
@@ -661,7 +663,7 @@ void add_pending_io(struct trace *trace, struct graph_line_data *gld)
int ret;
int seconds;
struct blk_io_trace *io = trace->io;
- int action = io->action & 0xffff;
+ int action = io->action & BLK_TA_MASK;
double avg;
if (io->action & BLK_TC_ACT(BLK_TC_NOTIFY))
@@ -696,7 +698,7 @@ void add_completed_io(struct trace *trace,
{
struct blk_io_trace *io = trace->io;
int seconds;
- int action = io->action & 0xffff;
+ int action = io->action & BLK_TA_MASK;
struct pending_io *pio;
double avg;
u64 latency;
@@ -734,7 +736,7 @@ void add_completed_io(struct trace *trace,
void add_iop(struct trace *trace, struct graph_line_data *gld)
{
struct blk_io_trace *io = trace->io;
- int action = io->action & 0xffff;
+ int action = io->action & BLK_TA_MASK;
int seconds;
if (io->action & BLK_TC_ACT(BLK_TC_NOTIFY))
@@ -759,7 +761,7 @@ void add_iop(struct trace *trace, struct graph_line_data *gld)
void check_record(struct trace *trace)
{
struct blk_io_trace *io = trace->io;
- int action = io->action & 0xffff;
+ int action = io->action & BLK_TA_MASK;
if (!(io->action & BLK_TC_ACT(BLK_TC_NOTIFY))) {
switch (action) {