Teaches the ProcessCpuTracker about USAPs.

This CL updates the ProcessCpuTracer.getName method to force a refresh
of the process name when the current state indicates that it was named
either 'usap32' or 'usap64'.  This will prevent false attribution of
process statistics to system service processes.

Bug: 146614089
Test: Treehugger
Change-Id: Ieca4715b7aeb44ef7d1ec98773b25bdfa0a9fc6b
This commit is contained in:
Chris Wailes
2020-03-04 13:40:28 -08:00
parent d0b322c5d2
commit 03c842dd30

View File

@@ -883,8 +883,11 @@ public class ProcessCpuTracker {
private void getName(Stats st, String cmdlineFile) {
String newName = st.name;
if (st.name == null || st.name.equals("app_process")
|| st.name.equals("<pre-initialized>")) {
if (st.name == null
|| st.name.equals("app_process")
|| st.name.equals("<pre-initialized>")
|| st.name.equals("usap32")
|| st.name.equals("usap64")) {
String cmdName = ProcStatsUtil.readTerminatedProcFile(cmdlineFile, (byte) '\0');
if (cmdName != null && cmdName.length() > 1) {
newName = cmdName;