[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: cprof profiling tool available - useful for WINE development
From:       James Abbatiello <abbeyj () wpi ! edu>
Date:       2000-07-28 4:25:58
[Download RAW message or body]

Jeff Tranter wrote:
> 
> As part of our WINE development we created a performance
> profiler tool that supports multi-threaded programs (GNU
> gprof does not support threads). We've just released it

I think this is a great idea.  Unfortunately, its not working for me.
:(  Issues I have:

- configure doesn't complain if you don't have libelf.  However,
compilation subsequently fails with a rather unusual error message.
Fix: install libelf. :)

- wine-support-for-cprof.diff doesn't apply against the current CVS.  I
patched in the new TEB fields by hand.  Not sure if I broke something
though.

- build-wine script uses EXTRA_LIBS on the make line, but that doesn't
seem to be used by the Makefile(s).  So, I had to modify them in order
to get things linked against libcprof.

- build-wine still fails with unresolved externals on the final link of
winedbg and wine even after that change.  It appears that the optimized
versions of strcpy, etc are "extern inline" in the header files on my
machine.  And with -finstrument-functions, gcc doesn't inline them.  So,
I added in -D__NO_STRING_INLINES to the CFLAGS.  This is possibly
specific to my setup?

- After this, I now have a copy of wine built that segfaults on startup
like so:
Program received signal SIGSEGV, Segmentation fault.
EnterCriticalSection (crit=0x40233678) at ../include/winbase.h:2032
2032        __asm__ __volatile__( ".byte 0x64\n\tmovl 0x24,%0" : "=r"
(ret) );
(gdb) bt
#0  EnterCriticalSection (crit=0x40233678) at ../include/winbase.h:2032
#1  0x40185f5d in __pthread_atfork (prepare=0x403e58a4
<ptmalloc_lock_all>,
    parent=0x403e598c <ptmalloc_unlock_all>,
    child=0x403e5a38 <ptmalloc_init_all>) at pthread.c:127
#2  0x403e5be1 in ptmalloc_init ()
#3  0x403e5d38 in malloc_hook_ini ()
#4  0x403e62fa in __malloc ()
#5  0x403eb064 in strdup ()
#6  0x403891f2 in getenv_str ()
#7  0x40389278 in load_environment ()
#8  0x403892a7 in do_prof_init ()
#9  0x403894ce in prof_init ()
#10 0x4038955f in prof_thread_init ()
#11 0x40389ccd in get_thread_prof ()
#12 0x40389825 in __menter_internal ()
#13 0x40389d0c in __cyg_profile_func_enter ()
#14 0x401eeb9a in __do_global_ctors_aux ()
#15 0x400578c2 in _init ()
(gdb)

To me, this looks like a classic problem with trying to access the TEB
from a constructor.  Unfortunately, I don't know how to fix it, so here
I'm stuck.  Help/suggestions would be appreciated.


-- 
James Abbatiello

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic