gettimeofday() in hping

Kris Kennaway kris at FreeBSD.org
Tue Jan 22 12:24:52 PST 2008


Stefan Lambrev wrote:
> 
> Kris Kennaway wrote:
>> Stefan Lambrev wrote:
>>
>>>> You should use hwpmc to verify where the application is really 
>>>> spending time, since gettimeofday doesn't seem to account for it all.
>>> pmc: Unknown Intel CPU.
>>> module_register_init: MOD_LOAD (hwpmc, 0xffffffff8029906d, 
>>> 0xffffffff8054c500) error 78
>>
>> OK, this is the famous problem with modern CPUs that jkoshy has 
>> declined to work around :(  There are patches for this in perforce, see
>>
>> http://perforce.freebsd.org/changeView.cgi?CH=126189
> cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -march=nocona 
> -std=c99 -g -Wall -Wredundant-decls -Wnested-externs 
> -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline 
> -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc  
> -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL 
> -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common 
> -finline-limit=8000 --param inline-unit-growth=100 --param 
> large-function-growth=1000  -mcmodel=kernel -mno-red-zone  -mfpmath=387 
> -mno-sse -mno-sse2 -mno-mmx -mno-3dnow  -msoft-float 
> -fno-asynchronous-unwind-tables -ffreestanding -Werror  vers.c
> linking kernel.debug
> hwpmc_x86.o(.text+0x1a5): In function `pmc_md_initialize':
> /usr/src/sys/dev/hwpmc/hwpmc_x86.c:144: undefined reference to 
> `pmc_initialize_p6'
> 
> Any chance you have patches against RELENG_7_0 ? :)

They should apply, but maybe you will also need other patches from that 
branch.

>>> What was the other way to do this profiling?
>>
>> No other that I have found to be useful.
>>
>>> Can ktrace help?
>>
>> Not really, it only tells you what syscalls were made.
> But it can also display relative timestamps (time since previous entry).
> Can't this be useful?

Not really, it doesn't give enough of a cross-section into what your 
machine is spending its time doing.

Kris


More information about the freebsd-hackers mailing list