libprocessgroup: optimize SetAttributeAction::ExecuteForProcess performance

Current implementation of SetAttributeAction::ExecuteForProcess reuses
SetAttributeAction::ExecuteForTask while not utilizing available uid/pid
information. This results in a call to GetPathForTask() which is an
expensive function due to it reading and parsing /proc/$pid/cgroups.
This can be avoided if we utilize available uid/pid info and the fact
that cgroup v2 attributes share the cgroup v2 hierarchy as process
groups, which use a known path template.

Bug: 292636609
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
(cherry picked from commit 961c01ce23bb886583ca8cac1640806346c09a7f)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:1e81ee13638c5ca03157db674009d4cf7c2a1263)
Merged-In: I02e3046bd85d0dfebc68ab444f1796bb54cc69c7
Change-Id: I02e3046bd85d0dfebc68ab444f1796bb54cc69c7
3 files changed