Compare dmprof GLOBAL_STATS with sum of /proc/pid/smaps

20 views
Skip to first unread message

WenSheng He

unread,
Aug 1, 2014, 10:36:16 PM8/1/14
to dmp...@chromium.org
In order to get the /proc files at the point of dmprof dump, I modify the DumpOrderedProfile function to backup them using system("cp command").
Then I write shell script to sum different groups of VSS and RSS, and compare with the GLOBAL_STATS. Details as below:

File

VSS

RSS

Formula for smaps

smaps

dmprof

Diff

smaps

dmprof

Diff

file-exec

139920

139920

=

39428

39428

=

File mapping with x flag

file-nonexec

260140

260140

=

25504

25504

=

File mapping without x flag

anonymous

148860

148860

=

107568

107572

4[HWS1] 

Mapping with empty Pathname

stack

136

132

4[HWS2] 

76

76

=

Main thread stack

other

215220

215216

4[HWS3] 

10608

10608

=

Thread stack, [vdso], [vsyscall]

total

764276

764268

8

183184

183188

4

VSS = sum of Size

RSS = sum of Rss


 [HWS1]Maybe Reasonable wave? I check other snapshots, some have the same problem, some don't.

07667000-076db000 rw-p 00000000 00:00 0

 [HWS2]It’s really unbelievable that the smaps mapping section is same as the MMAP_LIST in dmprof, and minus result should be 132KB, why does smaps show Size as 136KB? The arithmetic  of Linux is wrong? Next I should check the kernel code.

7fffd4bd5000-7fffd4bf6000 rw-p 00000000 00:00 0                          [stack]

 [HWS3]dmprof didn’t account for [vdso]

Dai Mikurube

unread,
Aug 4, 2014, 5:12:30 AM8/4/14
to WenSheng He, dmprof
Such a 4KB ( == 1 page) difference often happens. It's very hard to get all data at the exact same time. We should accept such a small difference.

Also, small differences may happen because of limitation of API/procfs and difference of definition. Do you really need such an "exact" value? I think it's an unreasonably hard yak-shaving. I don't recommend to dive into it.


--
You received this message because you are subscribed to the Google Groups "dmprof" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dmprof+un...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/dmprof/5b13af64-a3e6-490d-9715-dff8d24302e2%40chromium.org.



--
Dai MIKURUBE

WenSheng He

unread,
Aug 4, 2014, 8:51:47 PM8/4/14
to dmp...@chromium.org, zhsb...@gmail.com
Thank you for your advice, I accept.

在 2014年8月4日星期一UTC+8下午5时12分30秒,Dai Mikurube写道:
Reply all
Reply to author
Forward
0 new messages