Don't show the useless kernel stack for the thread that's reading /proc.
Change-Id: I17ee91a726bff02d6fe44c504e542a31fd6978d6
diff --git a/src/utils.cc b/src/utils.cc
index 2a1e5a1..afb3d5b 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -1008,6 +1008,11 @@
#else
void DumpKernelStack(std::ostream& os, pid_t tid, const char* prefix, bool include_count) {
+ if (tid == GetTid()) {
+ // There's no point showing that we're reading our stack out of /proc!
+ return;
+ }
+
std::string kernel_stack_filename(StringPrintf("/proc/self/task/%d/stack", tid));
std::string kernel_stack;
if (!ReadFileToString(kernel_stack_filename, &kernel_stack)) {