This is an archive of the discontinued LLVM Phabricator instance.

tsan: write uptime in mem profile
ClosedPublic

Authored by dvyukov on Sep 21 2021, 4:16 AM.

Details

Summary

Write uptime in real time seconds for every mem profile record.
Uptime is useful to make more sense out of the profile,
compare random lines, etc.

Depends on D110153.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Sep 21 2021, 4:16 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2021, 4:16 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka accepted this revision.Sep 21 2021, 1:24 PM
vitalybuka added inline comments.
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp
152

time units are not clear, so uptime -> uptime_ns would be nice

This revision is now accepted and ready to land.Sep 21 2021, 1:24 PM
melver accepted this revision.Sep 22 2021, 12:44 AM
melver added inline comments.
compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp
141–142

This is floor(seconds), is it of sufficient granularity?

dvyukov updated this revision to Diff 374142.Sep 22 2021, 1:10 AM
dvyukov marked an inline comment as done.

rebased and addressed comments

dvyukov added inline comments.Sep 22 2021, 1:12 AM
compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp
141–142

I also want to make delay between profile writes 1s instead of the current 100ms. Reading /proc/self/smaps takes long time for huge processes and printing 10 lines per second just looks excessive.
This second granularity worked well when I used it. The line is also quite long, so I don't want to increase it more w/o a good reason.

This revision was landed with ongoing or failed builds.Sep 22 2021, 1:20 AM
This revision was automatically updated to reflect the committed changes.