Identify untracked processes
Unlike services which are identified by their names, untracked processes are only identified by their pids, and this isn't useful for debugging. ``` [78678.052436][ T1] init: Untracked pid 4159 did not have an associated service entry and will not be reaped ``` What can you do with this mesage if you don't know what pid 4159 is for. You may search for the pid in the log, but the log may have been truncated already. This change tries to be more useful by printing out more information: comm, ppid, etc. In addition to this, this change dumps remaining userspace processes when sysrq KILL/TERM. We do sysrq SIGKILL or SIGTERM only to make sure that processes who don't belong to process group of any service are killed. Normally, there's no such process because we seldom do setpgid. However, when such process(es) exist, knowing what they are is important. Thus, let's print them (pid, name. ...) before invoking the sysrq. Bug: 425867970 Test: setprop sys.powerctl shutdown and observe the log ... [ 400.195409] init: Untracked process (pid: 687 comm: (iptables-restor) ppid: 1, pgrp: 676, state: Z) received SIGTERM [ 400.195695] init: Untracked process (pid: 688 comm: (ip6tables-resto) ppid: 1, pgrp: 676, state: Z) received SIGTERM ... [ 404.191811] init: Remaining userspace processes except init: [ 404.193124] init: pid: 132 comm: (ueventd) ppid: 1, pgrp: 132, state: Z [ 404.193279] init: pid: 350 comm: (servicemanager) ppid: 1, pgrp: 350, state: Z [ 404.193594] init: pid: 773 comm: (android.hardwar) ppid: 1, pgrp: 773, state: Z [ 404.193765] init: pid: 2526 comm: (hwservicemanage) ppid: 1, pgrp: 2526, state: Z [ 404.193877] sysrq: Terminate All Tasks Flag: EXEMPT adding more debugging info Change-Id: I3947c6ee2d27aef2e49ca27f22a58525cdcc8409
Loading
Please register or sign in to comment