Skip to contentSkip to conversation

memory consumption information in perf stat?

DISCUSSION Milian Wolff 3 participants 4 messages Jan 28, 2016 – Feb 4, 2016

lore
Share & tools
lore
#0 lore raw

Hey all,

for user-space profiling, it would be extremely useful to get memory consumption information such as peak heap size into the output of perf stat. Is this doable? I just learned that command time -v is able to output the maximum and average RSS. It would be extremely nice if perf stat could incorporate that as well somehow such that I only need a single application to look at that.

If this is doable, then feel free to guide me to the code and I'm willing to supply a patch for perf stat.

Thanks

Signature · 4 lines
Milian Wolff | [email protected] | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts
#1 lore raw

Hi,

I am not sure perf stat can compute such information because it mainly count events (hardware or kernel). To compute the peak heap size, perf stat would require the knowledge of all heap memory allocations.

----
Manu

Quoted 13 lines · Milian Wolff

Hey all,

for user-space profiling, it would be extremely useful to get memory consumption information such as peak heap size into the output of perf stat. Is this doable? I just learned that command time -v is able to output the maximum and average RSS. It would be extremely nice if perf stat could incorporate that as well somehow such that I only need a single application to look at that.

If this is doable, then feel free to guide me to the code and I'm willing to supply a patch for perf stat.

Thanks

#2 lore raw
Quoted 5 lines · On Donnerstag, 28. Januar 2016 20:55:05 CET Manuel Selva wrote:

Hi,

I am not sure perf stat can compute such information because it mainly count events (hardware or kernel). To compute the peak heap size, perf stat would require the knowledge of all heap memory allocations.

Right, that is why I compared it to time -v which only gives the RSS as a ballpark figure which is often useful already to compare before/after. And if time -v can do it, I'd say perf stat should be able to do it as well? To track individual heap allocations, I'm using my heaptrack tool anyways. This request is more about making perf stat more useful by adding another side of the performance coin to it.

Signature · 4 lines
Milian Wolff | [email protected] | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts
#3 lore raw
In reply to Milian Wolff

Hi, Brendan Gregg

I saw your website and your email in LKML
so I sent this mail that contain a question.
(Thanks for your perf example page http://www.brendangregg.com/perf.html )

Would you mind if I ask you a question about perf ?

I saw several questions that can be answered by 'perf' in perf example page. 'Which code-paths are allocating memory, and how much?' among them. How to get answer of this question ?

I used 'perf mem record/report' and
'perf record -e mem-loads,mem-stores' to get memory information running my sample program.
But I don't know very well how much is allocated memory because only mem-* events count or overhead(%), etc can be seen.

Are there another way to check memory consumption info by perf ?

(I looked into perf example page but I mightn't look for the contents for it in the page.) (Sure, I used 'command time -v', 'ps' and other tools in linux
to know this information.)

And I added Cc linux-perf-users and Milian Wolff because I think this can be related to the mail of Milian.

(If someone would reply, I'd appreciate it.)

Thanks,
Taeung

Quoted 14 lines · Milian Wolff

Hey all,

for user-space profiling, it would be extremely useful to get memory consumption information such as peak heap size into the output of perf stat. Is this doable? I just learned that command time -v is able to output the maximum and average RSS. It would be extremely nice if perf stat could incorporate that as well somehow such that I only need a single application to look at that.

If this is doable, then feel free to guide me to the code and I'm willing to supply a patch for perf stat.

Thanks