Hi, I have written a device driver for an own PCI card reading bytes from a process signal frame. The driver is running quite well (2,4 GHz dual Core) reading one byte is done in about 4 microseconds. The problem is, that sometimes the read of one byte need up to 80 microseconds. The driver uses ddi calls for reading registers on the PCI card. I have done some dtrace tests, but no results up to now. I want to switch on the trace by passing driver _entry probe and switch of passing the driver _return probe. I''ve checked the on-cpu, off-cpu, interupt-start, probes etc - but no result. Any ideas to catch the reason for the 80 microseconds-read are welcome!! (scheduling, timer, interrupts,...???) Any suggestions for helpful dtrace probes ? Thanks sigi -- This message posted from opensolaris.org
Siegfried Schmidt wrote:> Hi, > I have written a device driver for an own PCI card reading bytes from a process signal frame. > The driver is running quite well (2,4 GHz dual Core) reading one byte is done in about 4 microseconds. > The problem is, that sometimes the read of one byte need up to 80 microseconds. > The driver uses ddi calls for reading registers on the PCI card. > I have done some dtrace tests, but no results up to now. > I want to switch on the trace by passing driver _entry probe and switch of > passing the driver _return probe. I''ve checked the on-cpu, off-cpu, interupt-start, probes etc - but no result. > > > Any ideas to catch the reason for the 80 microseconds-read are welcome!! > (scheduling, timer, interrupts,...???) > Any suggestions for helpful dtrace probes ?Have you tried something like this: fbt:mydriver:curiousfunction:entry{ self->follow = timestamp; self->spec = speculation(); } fbt:mydriver:curiousfunction:return /self->spec/ { if ((timestamp - self->follow) > 80) { speculate(self->spec); @longread = stack(10); } } James C. McPherson -- Senior Kernel Software Engineer, Solaris Sun Microsystems http://blogs.sun.com/jmcp http://www.jmcp.homeunix.com/blog
Thanks for your idea, the "if" statement in the dtrace code causes a syntax error on my machine? Sigi -- This message posted from opensolaris.org
Right, dtrace does not have an if-then-else construct. Try this: fbt:mydriver:curiousfunction:entry{ self->follow = timestamp; self->spec = speculation(); } fbt:mydriver:curiousfunction:return /self->spec && self->follow && (timestamp - self->follow) > 80/ { speculate(self->spec); stack(10); } Siegfried Schmidt wrote:> Thanks for your idea, > > the "if" statement in the dtrace code causes a syntax error on > my machine? > > Sigi > > > -- > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- blu There are two rules in life: Rule 1- Don''t tell people everything you know ---------------------------------------------------------------------- Brian Utterback - Solaris RPE, Sun Microsystems, Inc. Ph:877-259-7345, Em:brian.utterback-at-ess-you-enn-dot-kom
Thanks for the info, i have to modify the dtrace script (see below), and I am not sure if the time statement is ok. Timestamp is in nanoseconds, so I think correct is "...((timestamp - self->follow) > [b]50000[/b])/" ?? But I''m happy, I have the first results (without timestamp) and now I try to understand the results. I see some kernel modules involved in my ioctl function, but no ddi_getxx?? Where can I find more details to understand the results? Result: 1 40113 ipe_ioctl:return genunix`cdev_ioctl+0x1d specfs`spec_ioctl+0x50 genunix`fop_ioctl+0x25 genunix`ioctl+0xac unix`_sys_sysenter_post_swapgs+0x14b 1 40113 ipe_ioctl:return genunix`cdev_ioctl+0x1d specfs`spec_ioctl+0x50 genunix`fop_ioctl+0x25 genunix`ioctl+0xac unix`_sys_sysenter_post_swapgs+0x14b 1 40113 ipe_ioctl:return genunix`cdev_ioctl+0x1d specfs`spec_ioctl+0x50 genunix`fop_ioctl+0x25 genunix`ioctl+0xac unix`_sys_sysenter_post_swapgs+0x14b ---------------------------------------------------------------------- dtrace script: # pragma D option bufsize=12g # pragma D option specsize=10g # pragma D option switchrate=10hz fbt:ipe:ipe_ioctl:entry { self->follow = timestamp; self->spec = speculation(); } fbt:ipe:ipe_ioctl:return /self->spec && self->follow && ((timestamp - self->follow) > 50)/ { speculate(self->spec); stack(10); commit(self->spec); discard(self->spec); } -- This message posted from opensolaris.org