summaryrefslogtreecommitdiffstats
path: root/libbacktrace
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-08-22 12:06:20 -0700
committerElliott Hughes <enh@google.com>2018-08-22 12:06:20 -0700
commit95c34a72af2c34c75710f6d109d006ad19603e39 (patch)
treecd0d4673e1ebd2e39fddb02fe904c816d408e707 /libbacktrace
parent56d079b40a4978c3bc929c9d9513119c62d0de1c (diff)
downloadsystem_core-95c34a72af2c34c75710f6d109d006ad19603e39.tar.gz
system_core-95c34a72af2c34c75710f6d109d006ad19603e39.tar.bz2
system_core-95c34a72af2c34c75710f6d109d006ad19603e39.zip
bionic supplies PR_SET_VMA now.
Bug: N/A Test: builds Change-Id: I8254711543cbf11bdf905ea441655ca1c1e82aac
Diffstat (limited to 'libbacktrace')
-rw-r--r--libbacktrace/backtrace_benchmarks.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/libbacktrace/backtrace_benchmarks.cpp b/libbacktrace/backtrace_benchmarks.cpp
index 099ac60f9..a93a25e90 100644
--- a/libbacktrace/backtrace_benchmarks.cpp
+++ b/libbacktrace/backtrace_benchmarks.cpp
@@ -35,10 +35,6 @@
#include <backtrace/BacktraceMap.h>
#include <unwindstack/Memory.h>
-// Definitions of prctl arguments to set a vma name in Android kernels.
-#define ANDROID_PR_SET_VMA 0x53564d41
-#define ANDROID_PR_SET_VMA_ANON_NAME 0
-
constexpr size_t kNumMaps = 2000;
static bool CountMaps(pid_t pid, size_t* num_maps) {
@@ -93,10 +89,11 @@ static void CreateMap(benchmark::State& state, BacktraceMap* (*map_func)(pid_t,
exit(1);
}
memset(memory, 0x1, PAGE_SIZE);
- if (prctl(ANDROID_PR_SET_VMA, ANDROID_PR_SET_VMA_ANON_NAME, memory, PAGE_SIZE, "test_map") ==
- -1) {
+#if defined(PR_SET_VMA)
+ if (prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, memory, PAGE_SIZE, "test_map") == -1) {
fprintf(stderr, "Failed: %s\n", strerror(errno));
}
+#endif
maps.push_back(memory);
}