|
From: Rex W. <wa...@gm...> - 2005-04-20 13:49:50
|
Hi All I wanted to know if there exists a macro such that, I can insert it in my source code and the valgrind tool (like memcheck) will check for memory errors or other cache misses only from that point onwards. For example, if I can insert a macro like VALGRIND_TOOL_START and VALGRIND_TOOL_END in 2 areas in my source code, then the tool like memcheck or cachegrind will do their checking and stuff only for that part of the code that lies between the two macros. Do these macros exist? If not, can I write them using the VALGRIND_MAGIC_SEQUENCE macro, or will I have to do something tricky ? Thanks. --=20 Rex Walburn |
|
From: Julian S. <js...@ac...> - 2005-04-20 14:03:09
|
Sorry, no silver bullet. For memcheck/addrcheck/helgrind, Valgrind needs a complete picture of the state of memory, and that can only be achieved by running the program right from the start. For cachegrind, in principle it would be possible to start collecting data part way through the run. That would give you some misleading cache-cold-start effects, but it would work in general. However, we have no mechanism to achieve that at present. J On Wednesday 20 April 2005 14:49, Rex Walburn wrote: > Hi All > > I wanted to know if there exists a macro such that, I can insert it in > my source code and the valgrind tool (like memcheck) will check for > memory errors or other cache misses only from that point onwards. For > example, if I can insert a macro like VALGRIND_TOOL_START and > VALGRIND_TOOL_END in 2 areas in my source code, then the tool like > memcheck or cachegrind will do their checking and stuff only for that > part of the code that lies between the two macros. Do these macros > exist? If not, can I write them using the VALGRIND_MAGIC_SEQUENCE > macro, or will I have to do something tricky ? > > Thanks. |
|
From: Josef W. <Jos...@gm...> - 2005-04-20 16:26:46
|
On Wednesday 20 April 2005 16:02, Julian Seward wrote: > Sorry, no silver bullet. For memcheck/addrcheck/helgrind, Valgrind > needs a complete picture of the state of memory, and that can only > be achieved by running the program right from the start. > > For cachegrind, in principle it would be possible to start collecting > data part way through the run. That would give you some misleading > cache-cold-start effects, but it would work in general. However, we > have no mechanism to achieve that at present. In Callgrind, this is implemented: Start with "instrumentation mode" switched off: "callgrind --instr-atstart=no ..." and either switch real instrumentation on dynamically with "callgrind_control -i on", or via Macro CALLGRIND_START_INSTRUMENTATION, see /usr/include/valgrind/callgrind.h. This is very good to "fast forward" to the interesting place. Josef > > J > > On Wednesday 20 April 2005 14:49, Rex Walburn wrote: > > Hi All > > > > I wanted to know if there exists a macro such that, I can insert it in > > my source code and the valgrind tool (like memcheck) will check for > > memory errors or other cache misses only from that point onwards. For > > example, if I can insert a macro like VALGRIND_TOOL_START and > > VALGRIND_TOOL_END in 2 areas in my source code, then the tool like > > memcheck or cachegrind will do their checking and stuff only for that > > part of the code that lies between the two macros. Do these macros > > exist? If not, can I write them using the VALGRIND_MAGIC_SEQUENCE > > macro, or will I have to do something tricky ? > > > > Thanks. > > ------------------------------------------------------- > This SF.Net email is sponsored by: New Crystal Reports XI. > Version 11 adds new functionality designed to reduce time involved in > creating, integrating, and deploying reporting solutions. Free runtime > info, new features, or free trial, at: > http://www.businessobjects.com/devxi/728 > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers |