summaryrefslogtreecommitdiff
path: root/blkparse_fmt.c
diff options
context:
space:
mode:
authorAlan D. Brunelle <Alan.Brunelle@hp.com>2006-09-15 01:57:24 +0200
committerJens Axboe <axboe@kernel.dk>2006-09-15 01:57:24 +0200
commit97d13fb0f2a680668a79e64b7c71f93bd2664b0d (patch)
tree05a48886c246e8a0283f7ca14b5d258e86a7c952 /blkparse_fmt.c
parent5225e7882fcf560afe419c49e03d6fd1ead60eb1 (diff)
downloadblktrace-97d13fb0f2a680668a79e64b7c71f93bd2664b0d.tar.gz
blktrace-97d13fb0f2a680668a79e64b7c71f93bd2664b0d.tar.bz2
[PATCH] btt: Cleaned up patches for SEEK additions, DM, Q2A and seek fixes
Added changes to handle DM devices: - Used __pad field in struct blk_io_trace_remap to store from device, contains partition device information. Required modification in blkparse_fmt.c:process_default() to handle this change. - To better handle DM devices, noted that REMAP traces can refer to other REMAP traces, and thus added A_A and A_Q types (much like Q_A and Q_X) types. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'blkparse_fmt.c')
-rw-r--r--blkparse_fmt.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/blkparse_fmt.c b/blkparse_fmt.c
index b97f46a..f74832d 100644
--- a/blkparse_fmt.c
+++ b/blkparse_fmt.c
@@ -135,6 +135,7 @@ static void get_pdu_remap(struct blk_io_trace *t, struct blk_io_trace_remap *r)
__u64 sector = __r->sector;
r->device = be32_to_cpu(__r->device);
+ r->device_from = be32_to_cpu(__r->device_from);
r->sector = be64_to_cpu(sector);
}
@@ -261,6 +262,7 @@ static void process_default(char *act, struct per_cpu_info *pci,
struct blk_io_trace *t, unsigned long long elapsed,
int pdu_len, unsigned char *pdu_buf)
{
+ struct blk_io_trace_remap r = { .device = 0, };
char rwbs[6];
char *name;
@@ -269,6 +271,11 @@ static void process_default(char *act, struct per_cpu_info *pci,
/*
* The header is always the same
*/
+ if (act[0] == 'A') { /* Remap */
+ get_pdu_remap(t, &r);
+ t->device = r.device_from;
+ }
+
fprintf(ofp, "%3d,%-3d %2d %8d %5d.%09lu %5u %2s %3s ",
MAJOR(t->device), MINOR(t->device), pci->cpu, t->sequence,
(int) SECONDS(t->time), (unsigned long) NANO_SECONDS(t->time),
@@ -339,16 +346,12 @@ static void process_default(char *act, struct per_cpu_info *pci,
fprintf(ofp, "[%s] %u\n", name, get_pdu_int(t));
break;
- case 'A': { /* remap */
- struct blk_io_trace_remap r;
-
- get_pdu_remap(t, &r);
+ case 'A': /* remap */
fprintf(ofp, "%llu + %u <- (%d,%d) %llu\n",
(unsigned long long) t->sector, t_sec(t),
MAJOR(r.device), MINOR(r.device),
(unsigned long long) r.sector);
break;
- }
case 'X': /* Split */
fprintf(ofp, "%llu / %u [%s]\n", (unsigned long long) t->sector,