// Create the thread pools. heap_->CreateThreadPool(); // Reset the gc performance data at zygote fork so that the GCs // before fork aren't attributed to an app. heap_->ResetGcPerformanceInfo(); if (!is_system_server && !safe_mode_ && (jit_options_->UseJitCompilation() || jit_options_->GetSaveProfilingInfo()) && jit_.get() == nullptr) { // Note that when running ART standalone (not zygote, nor zygote fork), // the jit may have already been created. CreateJit(); } StartSignalCatcher(); // Start the JDWP thread. If the command-line debugger flags specified "suspend=y", // this will pause the runtime, so we probably want this to come last. Dbg::StartJdwp(); }
root@shamu:/ # ps -t 2089 USER PID PPID VSIZE RSS WCHAN PC NAME u0_a582089386156528053732 SyS_epoll_ b6cb0894 S com.hujiang.dict:pushservice u0_a5820922089156528053732 do_sigtime b6cb0b68 S Signal Catcher u0_a5820952089156528053732 unix_strea b6cb194c S JDWP u0_a5820962089156528053732 futex_wait b6c875e8 S ReferenceQueueD u0_a5820972089156528053732 futex_wait b6c875e8 S FinalizerDaemon u0_a5820992089156528053732 futex_wait b6c875e8 S FinalizerWatchd u0_a5821002089156528053732 futex_wait b6c875e8 S HeapTaskDaemon u0_a5821012089156528053732 binder_thr b6cb09c0 S Binder_1 u0_a5821022089156528053732 binder_thr b6cb09c0 S Binder_2 u0_a5821072089156528053732 SyS_epoll_ b6cb0894 S Thread-123 u0_a5821082089156528053732 futex_wait b6c875e8 S taskService-pro
127|root@shamu:/ # ps -t 386 USER PID PPID VSIZE RSS WCHAN PC NAME root3861152844867416 poll_sched b6cb0a5c S zygote root2203386152844867416 futex_wait b6c875e8 S ReferenceQueueD root2204386152844867416 futex_wait b6c875e8 S FinalizerDaemon root2205386152844867416 futex_wait b6c875e8 S FinalizerWatchd root2206386152844867416 futex_wait b6c875e8 S HeapTaskDaemon
voidSignalCatcher::HandleSigQuit(){ Runtime* runtime = Runtime::Current(); std::ostringstream os; os << "\n" << "----- pid " << getpid() << " at " << GetIsoDate() << " -----\n"; DumpCmdLine(os); // Note: The strings "Build fingerprint:" and "ABI:" are chosen to match the format used by // debuggerd. This allows, for example, the stack tool to work. std::string fingerprint = runtime->GetFingerprint(); os << "Build fingerprint: '" << (fingerprint.empty() ? "unknown" : fingerprint) << "'\n"; os << "ABI: '" << GetInstructionSetString(runtime->GetInstructionSet()) << "'\n"; os << "Build type: " << (kIsDebugBuild ? "debug" : "optimized") << "\n"; runtime->DumpForSigQuit(os); if ((false)) { std::string maps; if (ReadFileToString("/proc/self/maps", &maps)) { os << "/proc/self/maps:\n" << maps; } } os << "----- end " << getpid() << " -----\n"; Output(os.str()); }
...
while (true) { int signal_number = signal_catcher->WaitForSignal(self, signals); if (signal_catcher->ShouldHalt()) { runtime->DetachCurrentThread(); returnnullptr; } switch (signal_number) { case SIGQUIT: signal_catcher->HandleSigQuit(); break; case SIGUSR1: signal_catcher->HandleSigUsr1(); break; default: LOG(ERROR) << "Unexpected signal %d" << signal_number; break; } } ...
"adbd" sysTid=23850 #00 pc 0002b158 /sbin/adbd #01 pc 0002467f /sbin/adbd #02 pc 00020854 [stack]
"adbd" sysTid=23851 #00 pc 0002fd38 /sbin/adbd #01 pc 0002a501 /sbin/adbd #02 pc 0000000b <unknown>
"adbd" sysTid=23852 #00 pc 0002b624 /sbin/adbd #01 pc 000106cf /sbin/adbd #02 pc 00010301 /sbin/adbd #03 pc 0002a613 /sbin/adbd #04 pc 00030283 /sbin/adbd
"adbd" sysTid=23853 #00 pc 0002b628 /sbin/adbd #01 pc 00013999 /sbin/adbd #02 pc 000112ed /sbin/adbd #03 pc 000104e1 /sbin/adbd #04 pc 0002a613 /sbin/adbd #05 pc 00030283 /sbin/adbd
"adbd" sysTid=23862 #00 pc 0002b888 /sbin/adbd #01 pc 0000a503 /sbin/adbd #02 pc 00009527 /sbin/adbd #03 pc 0002a613 /sbin/adbd #04 pc 00030283 /sbin/adbd
root@shamu:/data/local/tmp# ./CallStack #00 pc 000006d1 /data/local/tmp/CallStack #01 pc 00017359 /system/lib/libc.so (__libc_init+44) #02 pc 0000074c /data/local/tmp/CallStack