Re: [zfs-discuss] how to convert zio->io_offset to disk block number?
Thanks, fixes following two issues, I can get the right value:(1) Dividing offset 0x657800(6649856) by 512 and take it as the iseek value. (2) Run the dd command on device c2t0d0s0, not c2t0d0. Zhihui 2009/6/26 m...@bruningsystems.com > Hi Zhihui Chen, > > zhihui Chen wrote: > >> Find that zio->io_offset is the absolute offset of device, not in sector >> unit. And If we need use zdb -R to dump the block, we should use the offset >> (zio->io_offset-0x40). >> >> 2009/6/25 zhihui Chen mailto:zhch...@gmail.com>> >> >> >>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:ff02d6a1a700 >>process name:sched >> >> 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: >>NAMESTATE READ WRITE CKSUM >>tpool ONLINE 0 0 0 >> c2t0d0ONLINE 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. >> >> I assume that 6650112 is offset plus 0x40? Try dividing 6650112 by > 512 and using that > as the iseek value. > max > > Thanks >>Zhihui >> >> >> >> >> ___ >> zfs-discuss mailing list >> zfs-discuss@opensolaris.org >> http://mail.opensolaris.org/mailman/listinfo/zfs-discuss >> >> > > ___ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
Re: [zfs-discuss] how to convert zio->io_offset to disk block number?
Find that zio->io_offset is the absolute offset of device, not in sector unit. And If we need use zdb -R to dump the block, we should use the offset (zio->io_offset-0x40). 2009/6/25 zhihui Chen > 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:ff02d6a1a700 > process name:sched > > 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: > NAMESTATE READ WRITE CKSUM > tpool ONLINE 0 0 0 > c2t0d0ONLINE 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
[zfs-discuss] how to convert zio->io_offset to disk block number?
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:ff02d6a1a700 process name:sched 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: NAMESTATE READ WRITE CKSUM tpool ONLINE 0 0 0 c2t0d0ONLINE 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