Chen, Robert
2007-Apr-13 03:27 UTC
[zfs-discuss] How to dtrace which process is writting a veritas volume?
Hi all, How to dtrace a who is writing a veritas volume? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20070412/dfd8c254/attachment.html>
Rayson Ho
2007-Apr-13 03:31 UTC
[zfs-discuss] How to dtrace which process is writting a veritas volume?
On 4/12/07, Chen, Robert <robertchen at ebay.com> wrote:> How to dtrace a who is writing a veritas volume?May be fuser or lsof is faster to provide the answer?? Rayson> > > > Thanks. > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss > >
Carisdad
2007-Apr-13 20:24 UTC
[zfs-discuss] How to dtrace which process is writting a veritas volume?
Rayson Ho wrote:> On 4/12/07, Chen, Robert <robertchen at ebay.com> wrote: >> How to dtrace a who is writing a veritas volume? > > May be fuser or lsof is faster to provide the answer?? > > Rayson > > > > >> >> >> >> Thanks. >> _______________________________________________ >> zfs-discuss mailing list >> zfs-discuss at opensolaris.org >> http://mail.opensolaris.org/mailman/listinfo/zfs-discuss >> >> > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss >Are you looking for data aggregated on user or process? For veritas filesystems, the io provider doesn''t seem to work terribly well because veritas will aggregate operations and not be able to report specifically which process or file is being written/read. However, you can use the fds[] array and the fileinfo_t structures with syscalls, so you could do something like #pragma D option quiet syscall::*write*:entry { @[fds[arg0].fi_mount, pid] = sum(arg2); } tick-5sec { trunc(@,20); printf("---------------------------------------------------------------------------------------------\n"); printf("%30s %10s %10s\n", "Mnt Point", "PID", "Sum(Size)"); printa("%30s %10d %@10d\n", @); printf("---------------------------------------------------------------------------------------------\n"); trunc(@); } This will give you the top 20 mntpt/pid combinations every 5-seconds and then clear the aggregation. You can create aggregations on individual files using fi_pathname instead of fi_mount, and you can narrow the files/mntpts using predicates to the syscall entry. Put that script in a file and run with dtrace -s <script filename> to use it. -Andy