Fwd: valgrind/memcheck support for skipping a function

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: valgrind/memcheck support for skipping a function

Rukhsana Ansari

Hi,

Is there a mechanism  in valgrind to  entirely skip memcheck on a particular function?
I  would like memcheck to ignore a particular function because of the slowness associated  when the  function is executed under valgrind.
I tried compiling my program with :
VALGRIND_DISABLE_ERROR_REPORTING
func();
VALGRIND_ENABLE_ERROR_REPORTING
This doesn't solve the issue as it merely disables reporting errors.

I suppose using VALGRIND_NON_SIMD_CALL is an option but am hesistant because of the header caveat on its usage:
"Note that these client requests are not entirely reliable. "


I looked at the user manual but wasn't able to  locate any other relevant macro.

Thanks
--
-Rukhsana


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: valgrind/memcheck support for skipping a function

Tom Hughes-2
On 24/05/17 16:55, Rukhsana Ansari wrote:

> Is there a mechanism  in valgrind to  entirely skip memcheck on a
> particular function?

No, because it doesn't make any sense.

In order for memcheck to work it needs to track the status of every
individual bit of memory - as soon as code was allowed to run outside of
memcheck changes could be made to memory that memcheck wouldn't know
about and from then on all it's reports would be worthless.

You would get false alerts about uninitialised memory where that memory
had in fact been initialised while memcheck was disabled and wouldn't
get alerts about memory that, for example, was freed during that period.

Tom

--
Tom Hughes ([hidden email])
http://compton.nu/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Loading...