|
From: Nicholas N. <nj...@ca...> - 2005-01-10 13:33:23
|
On Thu, 6 Jan 2005, Jeremy Fitzhardinge wrote: > All this has resulted in Valgrind shrinking by about 6600 lines of code, > including all of vg_proxylwp.c, vg_libpthread.c and about 2200 lines > from vg_scheduler.c - some of the hairest, trickiest and error-prone > code in the codebase. Woo! > There are some disadvantages though. In losing vg_libpthread, Valgrind > has a much more limited understanding of what's going on inside a > threaded program. It can see threads starting and exiting, but that's > ... > Probably the best way to fix this is to work with the glibc people to > try to build some Valgrind support into glibc, and/or take advantage of > the existing hooks which gdb uses. I haven't investigated this at all > yet. Relying on glibc doesn't sound so good to me -- it assumes the program uses glibc and not another way, and will also not be any good for existing versions of glibc. Feels to me like the right way to do this is to get function wrapping working somehow, ie. allowing Valgrind tools to augment functions like pthread_mutex_lock() with some extra code (this is different to function replacement, which we currently use extensively; we don't want to have to duplicate the functionality of the original function). I can't remember if this has been discussed previously (probably) and if so, what the general opinion was about how easy/reliable it is. > Other changes: I took advantage of the general upheaval to try to > isolate more of the OS/arch/platform dependent code. Sounds good. Hopefully it will hold up to a OS-porting effort. I second Julian in saying that it would be nice to see a bit more polishing before it goes in. Looking at the patch, there are a few parts that say "XXX" or "must fix this later"... it would be good to fix these, otherwise they're likely to stay that way for a while. And the things Tom has found, obviously. Also, there's the question of how this will interact with Julian's private VCPU changes. It could be a tricky merge. I think it's great you've got this working! So much nasty code removed, it's great :) I'd love to know how many of the open bugs will eventually be able to be closed by these changes... and self-hosting will be awesome too. Great stuff! N |