I use following dtrace script to trace the postion of one file on zfs: #!/usr/sbin/dtrace -qs zio_done:entry /((zio_t *)(arg0))->io_vd/ { zio=(zio_t *)arg0; printf("Offset:%x and Size:%x\n",zio->io_offset,zio->io_size); printf("vd:%x\n",(unsigned long)(zio->io_vd)); printf("process name:%s\n",execname); tracemem(zio->io_data,40); stack(); }
and I run dd command: "dd if=/export/dsk1/test1 bs=512 count=1", the dtrace script will generate following it output: Offset:657800 and Size:200 vd:ffffff02d6a1a700 process name:sched aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa zfs`zio_execute+0xa0 genunix`taskq_thread+0x193 unix`thread_start+0x8 ^C The tracemem output is the right context of file test1, which is a 512-byte text file. "zpool status" has following output: pool: tpool state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM tpool ONLINE 0 0 0 c2t0d0 ONLINE 0 0 0 errors: No known data errors My question is how to translate zio->io_offset (0x657800, equal to decimal number 6649856) outputed by dtace to block number on disk c2t0d0? I tried to use "dd if=/dev/dsk/c2t0d0 of=text iseek=6650112 bs=512 count=1" for a check,but the result is not right. Thanks Zhihui
_______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss