|
Anonymous Tracing and Fast Reboot
During development of the Fast Reboot project, I needed to do a lot of anonymous tracing to
figure out what device drivers do in the early stage of boot: do they allocate DMA buffers,
do they actually perform DMA, do they register interrupts, how many interrupts typically
arrive before the drivers attach, etc. With every trace I found out more information,
and based on what I had found out, I usually needed to change the scripts to obtain more
information. Those of you who have done anonymous tracing would remember that reboot is
required to obtain new traces. Fast Reboot, the very project I was developing, was there
to save me from growing old watching the system reboot. I was able to quickly change the
script, and fast reboot to obtain a new set of traces.
#!/usr/sbin/dtrace -Fs
ddi_regs_map_setup:entry,ddi_dma_alloc_handle:entry
{
this->devi = (struct dev_info *)arg0;
@a[stack()] = count();
@b[stringof(`devnamesp[this->devi->devi_major].dn_name),
probefunc] = count();
}
ddi_dma_mem_alloc:entry
{
this->devi = (struct dev_info *)
(((ddi_dma_impl_t *)arg0)->dmai_rdip);
@a[stack()] = count();
@b[stringof(`devnamesp[this->devi->devi_major].dn_name),
probefunc] = count();
}
END
{
printa(@a);
printa("%20s: %30s %10@d\n", @b);
/* printa("0x%x %10@d\n", @b); */
}
clovertown-ds-1# reboot -f
Oct 1 09:31:14 clovertown-ds-1 reboot: initiated by root on /dev/console
Oct 1 09:31:16 clovertown-ds-1 rpcbind: rpcbind terminating on signal.
Oct 1 09:31:16 clovertown-ds-1 syslogd: going down on signal 15
Oct 1 09:31:16 /usr/lib/snmp/snmpdx: received signal 15
Fast reboot.
syncing file systems... done
SunOS Release 5.11 Version onnv-gate:2008-09-30 64-bit
Copyright 1983-2008 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
DEBUG enabled
NOTICE: enabling probe 0 (::ddi_regs_map_setup:entry)
NOTICE: enabling probe 1 (::ddi_dma_alloc_handle:entry)
NOTICE: enabling probe 2 (::ddi_dma_mem_alloc:entry)
NOTICE: enabling probe 3 (:::END)
NOTICE: enabling probe 4 (dtrace:::ERROR)
Hostname: clovertown-ds-1
NIS domain name is mpklab.sfbay.sun.com
/dev/rdsk/c1d0s7 is clean
Reading ZFS config: done.
clovertown-ds-1 console login: root
Password:
clovertown-ds-1# dtrace -ae > /var/tmp/dma.out
clovertown-ds-1# tail -30 /var/tmp/dma.out
i8042: ddi_regs_map_setup 1
kb8042: ddi_regs_map_setup 1
mouse8042: ddi_regs_map_setup 1
npe: ddi_regs_map_setup 1
nvidia: ddi_regs_map_setup 1
pci-ide: ddi_regs_map_setup 2
asy: ddi_regs_map_setup 3
ata: ddi_dma_mem_alloc 3
ehci: ddi_dma_alloc_handle 4
ehci: ddi_dma_mem_alloc 4
pci_pci: ddi_regs_map_setup 5
vgatext: ddi_regs_map_setup 7
ata: ddi_regs_map_setup 9
uhci: ddi_dma_alloc_handle 12
uhci: ddi_dma_mem_alloc 12
ehci: ddi_regs_map_setup 15
intel_nb5000: ddi_regs_map_setup 21
e1000g: ddi_regs_map_setup 32
uhci: ddi_regs_map_setup 56
pcie_pci: ddi_regs_map_setup 65
e1000g: ddi_dma_mem_alloc 8450
e1000g: ddi_dma_alloc_handle 10754
ata: ddi_dma_alloc_handle 10978
( Oct 01 2008, 09:37:56 AM PDT / Sep 28 2008, 02:20:22 PM PDT )
Permalink
Trackback: http://blogs.sun.com/sherrym/entry/anonymous_tracing_and_fast_reboot
|