]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgtop: Update code comments
authorMichal Koutný <mkoutny@suse.com>
Tue, 29 Nov 2022 12:23:51 +0000 (13:23 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 30 Nov 2022 00:40:56 +0000 (09:40 +0900)
src/cgtop/cgtop.c

index cef5b654e7a571fadfcbc71a5054da10d33a4435..5d82d656bcad145770180a193c6f2f8d67ecb530 100644 (file)
@@ -56,10 +56,11 @@ typedef struct Group {
         uint64_t io_input_bps, io_output_bps;
 } Group;
 
+/* Counted objects, enum order matters */
 typedef enum PidsCount {
-        COUNT_USERSPACE_PROCESSES,
+        COUNT_USERSPACE_PROCESSES,      /* least */
         COUNT_ALL_PROCESSES,
-        COUNT_PIDS,
+        COUNT_PIDS,                     /* most, requires pids controller */
 } PidsCount;
 
 static unsigned arg_depth = 3;
@@ -932,6 +933,7 @@ static int run(int argc, char *argv[]) {
         if (r < 0)
                 return log_error_errno(r, "Failed to determine supported controllers: %m");
 
+        /* honor user selection unless pids controller is unavailable */
         possible_count = (mask & CGROUP_MASK_PIDS) ? COUNT_PIDS : COUNT_ALL_PROCESSES;
         arg_count = MIN(possible_count, arg_count);