On Thursday 20 November 2014 09:52:46 Julian Seward wrote:
> On 11/20/2014 09:04 AM, Peter Toft wrote:
> > One thing that I often is missing with valgrind/massif is a way to know
> > know where I roughly am in my code when I see a given memory peak.
> > 
> > I could envision to add a valgrind-macro or alike in my C-code to
> > indicate where I am in my code add (tentative syntax)
> > 
> > Does something remotely similar to this already exist?
> 
> Not as far as I can see.  I had a look through ms_main.c but it doesn't
> seem to support any client requests.
> 
> One thing you might consider is to use the stack recording facilities,
> VG_(get_ExeContext), to get a stack trace for each for each snapshot
> that Massif makes.  Not sure how you'd combine the output with the
> existing output, though.

One can already get a stacktrace for each snapshot that massif makes via
--detailed-freq=1, no?

Anyhow, having such a user API for markers in the output would certainly be 
welcome. From a output format POV I'd say it could be done by adding a "desc=" 
or similar to snapshot entries, and then the client request API could just 
trigger the creation of a new detailed snapshot.

#-----------
snapshot=7
#-----------
time=14790656197
mem_heap_B=140095127
mem_heap_extra_B=12551169
mem_stacks_B=0
heap_tree=detailed
desc=Label given by caller of client request API
n32: 140095127 (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
 ...

Adding support for such labels in Massif-Visualizer would be trivial. No clue 
about ms_print though.

Bye
-- 
Milian Wolff
m...@milianw.de
http://milianw.de

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to