Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Jan 2006 13:59:33 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-drivers@freebsd.org
Cc:        Bharma Ji <bharmaji@gmail.com>
Subject:   Re: How to profile a driver
Message-ID:  <200601311359.34539.jhb@freebsd.org>
In-Reply-To: <67beabb0601300932u50554f86i3b068258e013af02@mail.gmail.com>
References:  <67beabb0601300932u50554f86i3b068258e013af02@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 30 January 2006 12:32, Bharma Ji wrote:
> I am trying to optimize a driver for performance. What are the standard
> ways to profile a driver?
>
>  My problem at the moment is that when I run a test and max out the CPU,
> then the system % is 60 and user % is 30. I wanted to find out how much
> time is being spent in the driver(and within it, if possible in what
> components). Can this be determined and if so, how to figure this out.

There aren't currently any really good tools for this, but one very useful 
thing you can try is including KTR in your kernel and turn on KTR_SCHED 
traces while you run your test, then use ktrdump to dump the events to a file 
and use schedgraph.py to look at the results, it will pop up a window showing 
you the scheduler activity (which threads ran when and for how-long, etc.) on 
a timeline.

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601311359.34539.jhb>