Ensure JNI_ChildProcessService_DumpProcessStack is in the stack.

It is possible that JNI_ChildProcessService_DumpProcessStack might
not appear in the stack dumps if the linker decided to either
inline it or combine with another identical function via ICF.

BUG=934317

Change-Id: If2769f0b465d0585d71b7cfc3bb8c45b15f3933a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1594032
Reviewed-by: Yaron Friedman <[email protected]>
Commit-Queue: Chris Mumford <[email protected]>
Cr-Commit-Position: refs/heads/master@{#658234}
diff --git a/base/android/child_process_service.cc b/base/android/child_process_service.cc
index 8ec6e62..0418e60 100644
--- a/base/android/child_process_service.cc
+++ b/base/android/child_process_service.cc
@@ -71,7 +71,11 @@
   _exit(0);
 }
 
-void JNI_ChildProcessService_DumpProcessStack(JNIEnv* env) {
+// Make sure this isn't inlined so it shows up in stack traces.
+// the function body unique by adding a log line, so it doesn't get merged
+// with other functions by link time optimizations (ICF).
+NOINLINE void JNI_ChildProcessService_DumpProcessStack(JNIEnv* env) {
+  LOG(ERROR) << "Dumping as requested.";
   base::debug::DumpWithoutCrashing();
 }