cgroup-util: drop handcrafted cg_is_empty(), always check cgroup.events populated field
This effectively renames cg_is_empty_recursive() to cg_is_empty(). Note that all existing code calls the former and not the latter, hence with cgv1 support being dropped it's trivial to consult cgroup.events directly for populated state everywhere. Additionally, use more generic cg_get_keyed_attribute() helper rather than cg_read_event().
This commit is contained in:
@@ -251,7 +251,7 @@ int show_cgroup_by_path(
|
||||
if (!k)
|
||||
return -ENOMEM;
|
||||
|
||||
if (!(flags & OUTPUT_SHOW_ALL) && cg_is_empty_recursive(NULL, k) > 0)
|
||||
if (!(flags & OUTPUT_SHOW_ALL) && cg_is_empty(NULL, k) > 0)
|
||||
continue;
|
||||
|
||||
if (!shown_pids) {
|
||||
|
||||
Reference in New Issue
Block a user