|
From: Peter T. <pt...@li...> - 2014-11-20 08:23:39
|
Hi all
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)
VALGRIND_MASSIF("calculator1()")
and another place
VALGRIND_MASSIF("reduceMem - middle")
Then the ms_print output should indicate (see the % signs) when in the
code flow that we had this function call executed.
19.63^ ###
| % #
| % # ::
| % # : :::
| % :::::::::# : : ::%
| % : # : : : %::
| % : # : : : %: :::
| % : # : : : %: : ::
| % ::::::::::: # : : : %: : :
:::
| % : : # : : : %: : :
: ::
| ::%::: : # : : : %: : :
: : ::
| @@@: % : : # : : : %: : :
: : : @
| ::@ : % : : # : : : %: : :
: : : @
| :::: @ : % : : # : : : %: : :
: : : @
| ::: : @ : % : : # : : : %: : :
: : : @
| ::: : : @ : % : : # : : : %: : :
: : : @
| :::: : : : @ : % : : # : : : %: : :
: : : @
| ::: : : : : @ : % : : # : : : %: : :
: : : @
| :::: : : : : : @ : % : : # : : : %: : :
: : : @
| ::: : : : : : : @ : % : : # : : : %: : :
: : : @
0
+--------------------------%-------------------------------%-------------->KB
0
29.48
% %
reduceMem - middle
% calculator1()
Number of snapshots: 25
Detailed snapshots: [9, 14 (peak), 24]
Does something remotely similar to this already exist?
Best
--
Peter Toft <pt...@li...>
|
|
From: Julian S. <js...@ac...> - 2014-11-20 08:53:10
|
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. J |
|
From: Peter T. <pt...@li...> - 2014-11-20 10:24:39
|
Julian Seward skrev den 2014-11-20 09:52: > 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. > > J Could it be roadmapped? IMHO it would be very nice to have. /pto |
|
From: Milian W. <ma...@mi...> - 2014-11-20 12:10:49
|
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 ma...@mi... http://milianw.de |
|
From: Peter T. <pt...@li...> - 2014-11-20 08:53:38
|
whooa - wrapping killed the text. The nice ASCII diagram can be seen at http://pastebin.com/HS5CVd4s --- Peter Toft <pt...@li...> Peter Toft skrev den 2014-11-20 09:04: > Hi all > > 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) > > VALGRIND_MASSIF("calculator1()") > > and another place > > VALGRIND_MASSIF("reduceMem - middle") > > > Then the ms_print output should indicate (see the % signs) when in the > code flow that we had this function call executed. |
|
From: Wilfried G. <dot...@ci...> - 2014-11-20 12:10:22
|
Hi Peter, you should try massif visiualizer: https://projects.kde.org/projects/extragear/sdk/massif-visualizer > Thu Nov 20 2014 03:04:14 EST from "Peter Toft" <pt...@li...> Subject: >[Valgrind-users] massif instrumentation in C/C++ code > > Hi all > > 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) > > VALGRIND_MASSIF("calculator1()") > > and another place > > VALGRIND_MASSIF("reduceMem - middle") > > > Then the ms_print output should indicate (see the % signs) when in the > code flow that we had this function call executed. > > > 19.63^ ### > | % # > | % # :: > | % # : ::: > | % :::::::::# : : ::% > | % : # : : : %:: > | % : # : : : %: ::: > | % : # : : : %: : :: > | % ::::::::::: # : : : %: : : > ::: > | % : : # : : : %: : : > : :: > | ::%::: : # : : : %: : : > : : :: > | @@@: % : : # : : : %: : : > : : : @ > | ::@ : % : : # : : : %: : : > : : : @ > | :::: @ : % : : # : : : %: : : > : : : @ > | ::: : @ : % : : # : : : %: : : > : : : @ > | ::: : : @ : % : : # : : : %: : : > : : : @ > | :::: : : : @ : % : : # : : : %: : : > : : : @ > | ::: : : : : @ : % : : # : : : %: : : > : : : @ > | :::: : : : : : @ : % : : # : : : %: : : > : : : @ > | ::: : : : : : : @ : % : : # : : : %: : : > : : : @ > 0 > >+--------------------------%-------------------------------%-------------->KB > > 0 > 29.48 > % % > reduceMem - middle > % calculator1() > > Number of snapshots: 25 > Detailed snapshots: [9, 14 (peak), 24] > > Does something remotely similar to this already exist? > > Best > > -- > Peter Toft <pt...@li...> > > >------------------------------------------------------------------------------ > > 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 > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > > > |
|
From: Peter T. <pt...@li...> - 2014-11-20 20:54:56
|
This is a *very* impressive tool. It has already helped me A LOT today. Thanx!! But adding my idea would make it super^2 (needs cowork between the valgrind core and your tool) /P --- Peter Toft <pt...@li...> Wilfried Goesgens skrev den 2014-11-20 12:57: > Hi Peter, > > you should try massif visiualizer: > > https://projects.kde.org/projects/extragear/sdk/massif-visualizer > >> Thu Nov 20 2014 03:04:14 EST from "Peter Toft" <pt...@li...> Subject: [Valgrind-users] massif instrumentation in C/C++ code >> Hi all >> >> 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) >> >> VALGRIND_MASSIF("calculator1()") >> >> and another place >> >> VALGRIND_MASSIF("reduceMem - middle") >> >> Then the ms_print output should indicate (see the % signs) when in the >> code flow that we had this function call executed. >> >> 19.63^ ### >> | % # >> | % # :: >> | % # : ::: >> | % :::::::::# : : ::% >> | % : # : : : %:: >> | % : # : : : %: ::: >> | % : # : : : %: : :: >> | % ::::::::::: # : : : %: : : >> ::: >> | % : : # : : : %: : : >> : :: >> | ::%::: : # : : : %: : : >> : : :: >> | @@@: % : : # : : : %: : : >> : : : @ >> | ::@ : % : : # : : : %: : : >> : : : @ >> | :::: @ : % : : # : : : %: : : >> : : : @ >> | ::: : @ : % : : # : : : %: : : >> : : : @ >> | ::: : : @ : % : : # : : : %: : : >> : : : @ >> | :::: : : : @ : % : : # : : : %: : : >> : : : @ >> | ::: : : : : @ : % : : # : : : %: : : >> : : : @ >> | :::: : : : : : @ : % : : # : : : %: : : >> : : : @ >> | ::: : : : : : : @ : % : : # : : : %: : : >> : : : @ >> 0 >> +--------------------------%-------------------------------%-------------->KB >> 0 >> 29.48 >> % % >> reduceMem - middle >> % calculator1() >> >> Number of snapshots: 25 >> Detailed snapshots: [9, 14 (peak), 24] >> >> Does something remotely similar to this already exist? >> >> Best >> >> -- >> Peter Toft <pt...@li...> >> >> ------------------------------------------------------------------------------ >> 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 [1] >> _______________________________________________ >> Valgrind-users mailing list >> Val...@li... >> https://lists.sourceforge.net/lists/listinfo/valgrind-users Links: ------ [1] http://pubads.gdoubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk |
|
From: Milian W. <ma...@mi...> - 2014-11-20 22:51:22
|
On Thursday 20 November 2014 21:54:45 Peter Toft wrote: > This is a *very* impressive tool. > > It has already helped me A LOT today. Thanx!! > > But adding my idea would make it super^2 (needs cowork between the > valgrind core and your tool) It's actually "my" tool and as I said in my other email, I totally agree that having markers in massif output would be an excellent addition! VTune also supports something like that for its runtime performance analysis. Bye -- Milian Wolff ma...@mi... http://milianw.de |