tracing/events: Move TRACE_SYSTEM outside of include guard
[linux-2.6.git] / include / trace / events / block.h
index a99d1e5..9a74b46 100644 (file)
@@ -1,3 +1,6 @@
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM block
+
 #if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ)
 #define _TRACE_BLOCK_H
 
@@ -5,9 +8,6 @@
 #include <linux/blkdev.h>
 #include <linux/tracepoint.h>
 
-#undef TRACE_SYSTEM
-#define TRACE_SYSTEM block
-
 TRACE_EVENT(block_rq_abort,
 
        TP_PROTO(struct request_queue *q, struct request *rq),
@@ -25,9 +25,8 @@ TRACE_EVENT(block_rq_abort,
 
        TP_fast_assign(
                __entry->dev       = rq->rq_disk ? disk_devt(rq->rq_disk) : 0;
-               __entry->sector    = blk_pc_request(rq) ? 0 : rq->hard_sector;
-               __entry->nr_sector = blk_pc_request(rq) ?
-                                               0 : rq->hard_nr_sectors;
+               __entry->sector    = blk_pc_request(rq) ? 0 : blk_rq_pos(rq);
+               __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq);
                __entry->errors    = rq->errors;
 
                blk_fill_rwbs_rq(__entry->rwbs, rq);
@@ -37,7 +36,8 @@ TRACE_EVENT(block_rq_abort,
        TP_printk("%d,%d %s (%s) %llu + %u [%d]",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
                  __entry->rwbs, __get_str(cmd),
-                 __entry->sector, __entry->nr_sector, __entry->errors)
+                 (unsigned long long)__entry->sector,
+                 __entry->nr_sector, __entry->errors)
 );
 
 TRACE_EVENT(block_rq_insert,
@@ -58,10 +58,9 @@ TRACE_EVENT(block_rq_insert,
 
        TP_fast_assign(
                __entry->dev       = rq->rq_disk ? disk_devt(rq->rq_disk) : 0;
-               __entry->sector    = blk_pc_request(rq) ? 0 : rq->hard_sector;
-               __entry->nr_sector = blk_pc_request(rq) ?
-                                               0 : rq->hard_nr_sectors;
-               __entry->bytes     = blk_pc_request(rq) ? rq->data_len : 0;
+               __entry->sector    = blk_pc_request(rq) ? 0 : blk_rq_pos(rq);
+               __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq);
+               __entry->bytes     = blk_pc_request(rq) ? blk_rq_bytes(rq) : 0;
 
                blk_fill_rwbs_rq(__entry->rwbs, rq);
                blk_dump_cmd(__get_str(cmd), rq);
@@ -71,7 +70,8 @@ TRACE_EVENT(block_rq_insert,
        TP_printk("%d,%d %s %u (%s) %llu + %u [%s]",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
                  __entry->rwbs, __entry->bytes, __get_str(cmd),
-                 __entry->sector, __entry->nr_sector, __entry->comm)
+                 (unsigned long long)__entry->sector,
+                 __entry->nr_sector, __entry->comm)
 );
 
 TRACE_EVENT(block_rq_issue,
@@ -92,10 +92,9 @@ TRACE_EVENT(block_rq_issue,
 
        TP_fast_assign(
                __entry->dev       = rq->rq_disk ? disk_devt(rq->rq_disk) : 0;
-               __entry->sector    = blk_pc_request(rq) ? 0 : rq->hard_sector;
-               __entry->nr_sector = blk_pc_request(rq) ?
-                                               0 : rq->hard_nr_sectors;
-               __entry->bytes     = blk_pc_request(rq) ? rq->data_len : 0;
+               __entry->sector    = blk_pc_request(rq) ? 0 : blk_rq_pos(rq);
+               __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq);
+               __entry->bytes     = blk_pc_request(rq) ? blk_rq_bytes(rq) : 0;
 
                blk_fill_rwbs_rq(__entry->rwbs, rq);
                blk_dump_cmd(__get_str(cmd), rq);
@@ -105,7 +104,8 @@ TRACE_EVENT(block_rq_issue,
        TP_printk("%d,%d %s %u (%s) %llu + %u [%s]",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
                  __entry->rwbs, __entry->bytes, __get_str(cmd),
-                 __entry->sector, __entry->nr_sector, __entry->comm)
+                 (unsigned long long)__entry->sector,
+                 __entry->nr_sector, __entry->comm)
 );
 
 TRACE_EVENT(block_rq_requeue,
@@ -125,9 +125,8 @@ TRACE_EVENT(block_rq_requeue,
 
        TP_fast_assign(
                __entry->dev       = rq->rq_disk ? disk_devt(rq->rq_disk) : 0;
-               __entry->sector    = blk_pc_request(rq) ? 0 : rq->hard_sector;
-               __entry->nr_sector = blk_pc_request(rq) ?
-                                               0 : rq->hard_nr_sectors;
+               __entry->sector    = blk_pc_request(rq) ? 0 : blk_rq_pos(rq);
+               __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq);
                __entry->errors    = rq->errors;
 
                blk_fill_rwbs_rq(__entry->rwbs, rq);
@@ -137,7 +136,8 @@ TRACE_EVENT(block_rq_requeue,
        TP_printk("%d,%d %s (%s) %llu + %u [%d]",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
                  __entry->rwbs, __get_str(cmd),
-                 __entry->sector, __entry->nr_sector, __entry->errors)
+                 (unsigned long long)__entry->sector,
+                 __entry->nr_sector, __entry->errors)
 );
 
 TRACE_EVENT(block_rq_complete,
@@ -157,9 +157,8 @@ TRACE_EVENT(block_rq_complete,
 
        TP_fast_assign(
                __entry->dev       = rq->rq_disk ? disk_devt(rq->rq_disk) : 0;
-               __entry->sector    = blk_pc_request(rq) ? 0 : rq->hard_sector;
-               __entry->nr_sector = blk_pc_request(rq) ?
-                                               0 : rq->hard_nr_sectors;
+               __entry->sector    = blk_pc_request(rq) ? 0 : blk_rq_pos(rq);
+               __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq);
                __entry->errors    = rq->errors;
 
                blk_fill_rwbs_rq(__entry->rwbs, rq);
@@ -169,7 +168,8 @@ TRACE_EVENT(block_rq_complete,
        TP_printk("%d,%d %s (%s) %llu + %u [%d]",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
                  __entry->rwbs, __get_str(cmd),
-                 __entry->sector, __entry->nr_sector, __entry->errors)
+                 (unsigned long long)__entry->sector,
+                 __entry->nr_sector, __entry->errors)
 );
 TRACE_EVENT(block_bio_bounce,
 
@@ -195,7 +195,8 @@ TRACE_EVENT(block_bio_bounce,
 
        TP_printk("%d,%d %s %llu + %u [%s]",
                  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-                 __entry->sector, __entry->nr_sector, __entry->comm)
+                 (unsigned long long)__entry->sector,
+                 __entry->nr_sector, __entry->comm)
 );
 
 TRACE_EVENT(block_bio_complete,
@@ -221,7 +222,8 @@ TRACE_EVENT(block_bio_complete,
 
        TP_printk("%d,%d %s %llu + %u [%d]",
                  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-                 __entry->sector, __entry->nr_sector, __entry->error)
+                 (unsigned long long)__entry->sector,
+                 __entry->nr_sector, __entry->error)
 );
 
 TRACE_EVENT(block_bio_backmerge,
@@ -248,7 +250,8 @@ TRACE_EVENT(block_bio_backmerge,
 
        TP_printk("%d,%d %s %llu + %u [%s]",
                  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-                 __entry->sector, __entry->nr_sector, __entry->comm)
+                 (unsigned long long)__entry->sector,
+                 __entry->nr_sector, __entry->comm)
 );
 
 TRACE_EVENT(block_bio_frontmerge,
@@ -275,7 +278,8 @@ TRACE_EVENT(block_bio_frontmerge,
 
        TP_printk("%d,%d %s %llu + %u [%s]",
                  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-                 __entry->sector, __entry->nr_sector, __entry->comm)
+                 (unsigned long long)__entry->sector,
+                 __entry->nr_sector, __entry->comm)
 );
 
 TRACE_EVENT(block_bio_queue,
@@ -302,7 +306,8 @@ TRACE_EVENT(block_bio_queue,
 
        TP_printk("%d,%d %s %llu + %u [%s]",
                  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-                 __entry->sector, __entry->nr_sector, __entry->comm)
+                 (unsigned long long)__entry->sector,
+                 __entry->nr_sector, __entry->comm)
 );
 
 TRACE_EVENT(block_getrq,
@@ -330,7 +335,8 @@ TRACE_EVENT(block_getrq,
 
        TP_printk("%d,%d %s %llu + %u [%s]",
                  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-                 __entry->sector, __entry->nr_sector, __entry->comm)
+                 (unsigned long long)__entry->sector,
+                 __entry->nr_sector, __entry->comm)
 );
 
 TRACE_EVENT(block_sleeprq,
@@ -358,7 +364,8 @@ TRACE_EVENT(block_sleeprq,
 
        TP_printk("%d,%d %s %llu + %u [%s]",
                  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-                 __entry->sector, __entry->nr_sector, __entry->comm)
+                 (unsigned long long)__entry->sector,
+                 __entry->nr_sector, __entry->comm)
 );
 
 TRACE_EVENT(block_plug,
@@ -441,7 +448,9 @@ TRACE_EVENT(block_split,
 
        TP_printk("%d,%d %s %llu / %llu [%s]",
                  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-                 __entry->sector, __entry->new_sector, __entry->comm)
+                 (unsigned long long)__entry->sector,
+                 (unsigned long long)__entry->new_sector,
+                 __entry->comm)
 );
 
 TRACE_EVENT(block_remap,
@@ -471,9 +480,10 @@ TRACE_EVENT(block_remap,
 
        TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
                  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-                 __entry->sector, __entry->nr_sector,
+                 (unsigned long long)__entry->sector,
+                 __entry->nr_sector,
                  MAJOR(__entry->old_dev), MINOR(__entry->old_dev),
-                 __entry->old_sector)
+                 (unsigned long long)__entry->old_sector)
 );
 
 #endif /* _TRACE_BLOCK_H */