[haiku-development] Re: Profiling our freebsd network compability libs

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 19 Jul 2012 12:32:00 +0200

On 2012-07-18 at 22:32:05 [+0200], Fredrik Holmqvist 
<fredrik.holmqvist@xxxxxxxxx> wrote:
> does anyone have any suggestions on a good way to see where most time
> is spent in these libs?
> That is :
> src/libs/compat/freebsd_network
> src/libs/compat/freebsd_wlan

There's the "profile" command. It does sampling-based profiling and by 
default also records kernel hits. The libraries are static libraries linked 
into the driver, so it is not possible to discriminate hits in those from 
others in the driver -- you'll have to go by function name.

If the code in question is executed in a userland thread, you can profile 
just that program. If not, you'll have to use the "-a" option to profile 
all teams.

The output is printed when profiling is stopped. Alternatively you can use 
the "-v" option to produce callgrind compatible output. This can be read by 
the KCachegrind application (KDE) which is very nice for closer analysis.

Also peruse the "--help" output. There might be a few more interesting 
options.

CU, Ingo

Other related posts: