Re: Please give me advises: How to use the snapshot parameter used in VALGRIND's massif in external applications like Python or ROS/ROS2

Paul Floyd <[email protected]>
Newsgroups gmane.comp.debugging.valgrind
Message-ID <[email protected]>
On 19/01/2021 17:52, Koki Nagahama wrote:
> Hi VALGRIND developers and users,
> I'm planning to modify a part of your product, VALGRIND,to integrate 
> it with a middleware for robots called ROS.
>
> In order to do this, I'm considering two ways to implement the massif 
> component of VALGRIND: (1) to implement it in C and call it in another 
> program as a Python library, and (2) to convert it into a ROS/ROS2 
> component (nodes) in C++.
>
> The reason for these implementations plan is that I want to retrieve 
> the values of heap_szB and stack_szB defined in the Snapshot structure 
> in ms_main.c of massif via VALGRIND and use them in a timely manner in 
> an external Python-based program.
> As far as I read the raw source code, the way to get the data is to 
> specify the last struct element of Snapshot* snapshot and extract it 
> (if I'm wrong, please let me know).However, I'm struggling with the 
> implementation of the part that passes to the external application.
>
> Please advise me on the implementation, including which method is more 
> feasible.

Hi

This doesn't seem feasible to me.

Massif (and all of the Valgrind tools) does not link with any library. 
This makes life much simpler because generally the guest application 
links with at least libc. If both guest and host link with the same libs 
then that would cause conflicts.

I think that the best way to do something like this is to use a pipe to 
communicate with an external application, similar to the way that tools 
use pipes for communication between gdb and the embedded gdbserver.


A+

Paul




_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.