aboutsummaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_stackdepot.h
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2013-01-18 20:06:45 +0000
committerAndrew Turner <andrew@FreeBSD.org>2013-01-18 20:06:45 +0000
commit58aabf08b77d221489f10e274812ec60917c21a8 (patch)
treeb946f82269be87d83f086167c762c362e734c5bb /lib/sanitizer_common/sanitizer_stackdepot.h
parent37dfff057418e02f8e5322da12684dd927e3d881 (diff)
downloadsrc-58aabf08b77d221489f10e274812ec60917c21a8.tar.gz
src-58aabf08b77d221489f10e274812ec60917c21a8.zip
Import compiler-rt r172839.vendor/compiler-rt/compiler-rt-r172839
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=245614 svn path=/vendor/compiler-rt/compiler-rt-r172839/; revision=245615; tag=vendor/compiler-rt/compiler-rt-r172839
Diffstat (limited to 'lib/sanitizer_common/sanitizer_stackdepot.h')
-rw-r--r--lib/sanitizer_common/sanitizer_stackdepot.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_stackdepot.h b/lib/sanitizer_common/sanitizer_stackdepot.h
new file mode 100644
index 000000000000..49e6669dd203
--- /dev/null
+++ b/lib/sanitizer_common/sanitizer_stackdepot.h
@@ -0,0 +1,36 @@
+//===-- sanitizer_stackdepot.h ----------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is shared between AddressSanitizer and ThreadSanitizer
+// run-time libraries.
+//===----------------------------------------------------------------------===//
+#ifndef SANITIZER_STACKDEPOT_H
+#define SANITIZER_STACKDEPOT_H
+
+#include "sanitizer/common_interface_defs.h"
+
+namespace __sanitizer {
+
+// StackDepot efficiently stores huge amounts of stack traces.
+
+// Maps stack trace to an unique id.
+u32 StackDepotPut(const uptr *stack, uptr size);
+// Retrieves a stored stack trace by the id.
+const uptr *StackDepotGet(u32 id, uptr *size);
+
+struct StackDepotStats {
+ uptr n_uniq_ids;
+ uptr mapped;
+};
+
+StackDepotStats *StackDepotGetStats();
+
+} // namespace __sanitizer
+
+#endif // SANITIZER_STACKDEPOT_H