Skip to content

Resolve parsing issues for certain process names to fix incorrect tab titles

Valid file names for executables can contain '(', ')' or ' '. Some odd but legal executable names include "a) (b", "(a" and "b)". The above examples will lead to incorrect tab titles due to incorrect parsing of the tab names.

This change finds the index of the last character of the name field by searching for the last occurence of ')'. The search encompasses a range of 16 characters starting from the starting index of the name field.

This change relies on the field in /proc/%pid/stat containing the name of the process to start with '(' and ends with ')'. It also relies on the fact that the maximum length of the name of a process is 16 characters. Lastly, it relies on the rest of the contents of /proc/%pid/stat not containing parentheses.

BUG: 470074

Merge request reports