aboutsummaryrefslogtreecommitdiff
path: root/src/client/linux/minidump_writer
diff options
context:
space:
mode:
authorTobias Sargeant <tobiasjs@google.com>2017-03-29 11:41:05 +0100
committerTobias Sargeant <tobiasjs@chromium.org>2017-03-29 10:42:31 +0000
commit846b6335c5b0ba46dfa2ed96fccfa3f7a02fa2f1 (patch)
tree85e15abe1c1e543aff8b042971739bf24fb39546 /src/client/linux/minidump_writer
parentIncrease maximum number of threads for minidump_stackwalk. (diff)
downloadbreakpad-846b6335c5b0ba46dfa2ed96fccfa3f7a02fa2f1.tar.xz
Treat the process stack as the top of memory for free space histograms.
Because we can't determine the top of userspace mappable memory directly, we rely on the fact that the process stack is allocated at the top of the address space (minus some randomization). Anything after that should not count as free space. BUG=695382 Change-Id: I68453aac9732c2bd4b87236b234518068dec6640 Reviewed-on: https://chromium-review.googlesource.com/446100 Reviewed-by: Primiano Tucci <primiano@chromium.org>
Diffstat (limited to 'src/client/linux/minidump_writer')
-rw-r--r--src/client/linux/minidump_writer/linux_dumper.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/client/linux/minidump_writer/linux_dumper.h b/src/client/linux/minidump_writer/linux_dumper.h
index 23c78e08..3a9a2e8b 100644
--- a/src/client/linux/minidump_writer/linux_dumper.h
+++ b/src/client/linux/minidump_writer/linux_dumper.h
@@ -99,6 +99,13 @@ class LinuxDumper {
// Returns true on success. One must have called |ThreadsSuspend| first.
virtual bool GetThreadInfoByIndex(size_t index, ThreadInfo* info) = 0;
+ size_t GetMainThreadIndex() const {
+ for (size_t i = 0; i < threads_.size(); ++i) {
+ if (threads_[i] == pid_) return i;
+ }
+ return -1u;
+ }
+
// These are only valid after a call to |Init|.
const wasteful_vector<pid_t> &threads() { return threads_; }
const wasteful_vector<MappingInfo*> &mappings() { return mappings_; }