2017-03-02 23:07 GMT+01:00 Mike Lui <mike.d....@gmail.com>:
> Hi Ivo,
>
> I didn't get a response, but I found a snippet in the original paper:
> https://www.cs.columbia.edu/~junfeng/09fa-e6998/papers/valgrind.pdf
>
> Table 1 says these functions are only for syscalls and the valgrind core. Is
> that still correct?

Hi Mike,

As comment on line 517 in pub_tool_tooliface.h says, these are
callback functions
which the Valgrind core (framework) use to pass various events to the
analysis tool.
Tool can be one of memcheck, helgrind, drd, cachegrind, callgrind,
massif, ... [1]
Various tools are interested in slightly different events, so they do
or don't register
event callbacks. Syscall is just one type of such an event.

> callbacks specifically refer to events within the core, right?
>> > Does this mean that they bear no relevance to profiling the user 
>> > application?

User application usually does not interact with these events.
What are you trying to achieve? What is your goal? Asking too detailed question
without knowing the context (what are you up to) does not usually lead to
meaningful answers.

>> > Am I correct that a "mem_write" callback only gets called for memory
>> > write that happens during translation, internal signal handling, etc, along
>> > with the "new_mmap" calls?

Nope. pre_mem_write and post_mem_write are callbacks for events emited
by Valgrind core (framework) when it intercepted a syscall on behalf
of the application.
Because Valgrind has no idea what is happening during a syscall inside kernel,
this is described by so called "syscall wrappers". They tend to describe things
such as "this particular piece of memory is going to be written to  by
kernel during syscall (pre_mem_write)"
and "this particular piece of memory was written to by kernel during
syscall (post_mem_write)".

>  If I were to instrument the application under test then I'd go through the 
> callback given in "basic_tool_funcs", correct?

Instrumentation happens automatically, depending on the analysis tool
selected at Valgrind startup.
I recommend you to read Valgrind intro [1] and core [2], at least the
initial part.

I.

[1] http://valgrind.org/docs/manual/manual-intro.html
[2] http://valgrind.org/docs/manual/manual-core.html

------------------------------------------------------------------------------
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
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to