summaryrefslogtreecommitdiff
path: root/lib/tsan/rtl/tsan_platform_linux.cc
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2014-12-09 01:22:59 +0000
committerKostya Serebryany <kcc@google.com>2014-12-09 01:22:59 +0000
commite10c4275cb236f88e4b4015b66c23518a46e6cab (patch)
tree2d5e4fccbe698bac725acd725a5f5625c3824fd6 /lib/tsan/rtl/tsan_platform_linux.cc
parenta55884240ee6fc7333e94d775ff5a4d7c9cffb84 (diff)
downloadcompiler-rt-e10c4275cb236f88e4b4015b66c23518a46e6cab.tar.gz
[asan] move GetRSS from tsan to sanitizer_common
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223730 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan/rtl/tsan_platform_linux.cc')
-rw-r--r--lib/tsan/rtl/tsan_platform_linux.cc27
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/tsan/rtl/tsan_platform_linux.cc b/lib/tsan/rtl/tsan_platform_linux.cc
index 461274145..e48e86fb9 100644
--- a/lib/tsan/rtl/tsan_platform_linux.cc
+++ b/lib/tsan/rtl/tsan_platform_linux.cc
@@ -118,33 +118,6 @@ void WriteMemoryProfile(char *buf, uptr buf_size, uptr nthread, uptr nlive) {
nlive, nthread);
}
-uptr GetRSS() {
- uptr fd = OpenFile("/proc/self/statm", false);
- if ((sptr)fd < 0)
- return 0;
- char buf[64];
- uptr len = internal_read(fd, buf, sizeof(buf) - 1);
- internal_close(fd);
- if ((sptr)len <= 0)
- return 0;
- buf[len] = 0;
- // The format of the file is:
- // 1084 89 69 11 0 79 0
- // We need the second number which is RSS in 4K units.
- char *pos = buf;
- // Skip the first number.
- while (*pos >= '0' && *pos <= '9')
- pos++;
- // Skip whitespaces.
- while (!(*pos >= '0' && *pos <= '9') && *pos != 0)
- pos++;
- // Read the number.
- uptr rss = 0;
- while (*pos >= '0' && *pos <= '9')
- rss = rss * 10 + *pos++ - '0';
- return rss * 4096;
-}
-
#if SANITIZER_LINUX
void FlushShadowMemoryCallback(
const SuspendedThreadsList &suspended_threads_list,