|
From: Nicholas N. <nj...@ca...> - 2004-07-19 09:14:13
|
On Mon, 19 Jul 2004, John Vincent wrote: > Thanks for replying to my email. I've just re-read the sections you > suggested, and while they're related, they're not quite what I was after. As > I see it, the "Client Request" stuff is all about my code calling some > routines defined inside valgrind. Please correct me if I've misunderstood. Mostly, although the VALGRIND_NON_SIMD_CALL[0123] requests let you call an arbitrary function from your code, and it gets run on the real CPU and doesn't get instrumented by Valgrind. > While this is very useful, what I wanted was for valgrind to (optionally) > call routines defined in my code - specifically, valgrind keeps some kind of > internal database or model of the memory state, the V and A bits. I'd like > hooks so that when valrgind updates or queries this model, changing the > values of the V and A bits, it could also call routines I've defined, which > would then update or query an application-specific model I've defined. The > "-fcheck-memory-usage" flag in gcc allowed me to write routines in my code to > maintain an application-specific model of memory access, and the compiler > arranged to call my routines whenever a memory access (read or write) > occured. There are no hooks in the existing tools for calling functions on loads and stores. Would the functions you call want to consult the A and V bits? If so, you'll have to modify Memcheck/Addrcheck for your needs. If you just want to call an arbitrary function on loads and stores, my tool "Dullard" is a good place to start, see www.cl.cam.ac.uk/~njn25/software.html. N |
|
From: John V. <jp...@ho...> - 2004-07-19 07:46:39
|
Hello Nicholas, Thanks for replying to my email. I've just re-read the sections you suggested, and while they're related, they're not quite what I was after. As I see it, the "Client Request" stuff is all about my code calling some routines defined inside valgrind. Please correct me if I've misunderstood. While this is very useful, what I wanted was for valgrind to (optionally) call routines defined in my code - specifically, valgrind keeps some kind of internal database or model of the memory state, the V and A bits. I'd like hooks so that when valrgind updates or queries this model, changing the values of the V and A bits, it could also call routines I've defined, which would then update or query an application-specific model I've defined. The "-fcheck-memory-usage" flag in gcc allowed me to write routines in my code to maintain an application-specific model of memory access, and the compiler arranged to call my routines whenever a memory access (read or write) occured. Thanks for your time, /John. >From: Nicholas Nethercote <nj...@ca...> >To: John Vincent <jp...@ho...> >CC: val...@li... >Subject: Re: [Valgrind-developers] valgrind and -fcheck-memory-usage >Date: Sat, 17 Jul 2004 09:47:21 +0100 (BST) > >On Tue, 13 Jul 2004, John Vincent wrote: > >>I'm new to valgrind (3 days use) but I've already found it to be very >>useful, so a big thanks. > >Glad you like it! > >>The "-fcheck-memory-usage" option that used to exist in gcc was also very >>useful to me, since I could write my own checking routines with >>application-specific knowledge about when memory should and should not be >>accessed. Since this is no longer available in gcc, I wonder if it might >>be possible to implement similar "hooks" via the valgrind core? > >Have you read sections 2.7 and 3.7 of the manual, about client requests? If >I understand correctly, this is exactly what you want. > >N _________________________________________________________________ Use MSN Messenger to send music and pics to your friends http://www.msn.co.uk/messenger |
|
From: John V. <jp...@ho...> - 2004-07-19 09:30:22
|
Hi Nicholas, This isn't exactly what I'm after, but it certainly is a good step in the right direction. I'll let you know how I get on... and thanks again for your time. /John. >From: Nicholas Nethercote <nj...@ca...> >To: John Vincent <jp...@ho...> >CC: val...@li... >Subject: Re: [Valgrind-developers] valgrind and -fcheck-memory-usage >Date: Mon, 19 Jul 2004 10:14:08 +0100 (BST) > >On Mon, 19 Jul 2004, John Vincent wrote: > >>Thanks for replying to my email. I've just re-read the sections you >>suggested, and while they're related, they're not quite what I was after. >>As I see it, the "Client Request" stuff is all about my code calling some >>routines defined inside valgrind. Please correct me if I've misunderstood. > >Mostly, although the VALGRIND_NON_SIMD_CALL[0123] requests let you call an >arbitrary function from your code, and it gets run on the real CPU and >doesn't get instrumented by Valgrind. > >>While this is very useful, what I wanted was for valgrind to (optionally) >>call routines defined in my code - specifically, valgrind keeps some kind >>of internal database or model of the memory state, the V and A bits. I'd >>like hooks so that when valrgind updates or queries this model, changing >>the values of the V and A bits, it could also call routines I've defined, >>which would then update or query an application-specific model I've >>defined. The "-fcheck-memory-usage" flag in gcc allowed me to write >>routines in my code to maintain an application-specific model of memory >>access, and the compiler arranged to call my routines whenever a memory >>access (read or write) occured. > >There are no hooks in the existing tools for calling functions on loads and >stores. Would the functions you call want to consult the A and V bits? If >so, you'll have to modify Memcheck/Addrcheck for your needs. If you just >want to call an arbitrary function on loads and stores, my tool "Dullard" >is a good place to start, see www.cl.cam.ac.uk/~njn25/software.html. > >N _________________________________________________________________ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger |