2 This file is part of systemd.
4 Copyright 2012 Lennart Poettering
6 systemd is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation; either version 2.1 of the License, or
9 (at your option) any later version.
11 systemd is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public License
17 along with systemd; If not, see <http://www.gnu.org/licenses/>.
31 #include "alloc-util.h"
32 #include "bus-error.h"
34 #include "cgroup-show.h"
35 #include "cgroup-util.h"
39 #include "parse-util.h"
40 #include "path-util.h"
41 #include "process-util.h"
42 #include "stdio-util.h"
43 #include "terminal-util.h"
44 #include "unit-name.h"
47 typedef struct Group
{
57 unsigned cpu_iteration
;
64 unsigned io_iteration
;
65 uint64_t io_input
, io_output
;
67 uint64_t io_input_bps
, io_output_bps
;
70 static unsigned arg_depth
= 3;
71 static unsigned arg_iterations
= (unsigned) -1;
72 static bool arg_batch
= false;
73 static bool arg_raw
= false;
74 static usec_t arg_delay
= 1*USEC_PER_SEC
;
75 static char* arg_machine
= NULL
;
76 static char* arg_root
= NULL
;
77 static bool arg_recursive
= true;
78 static bool arg_recursive_unset
= false;
82 COUNT_USERSPACE_PROCESSES
,
84 } arg_count
= COUNT_PIDS
;
92 } arg_order
= ORDER_CPU
;
97 } arg_cpu_type
= CPU_PERCENT
;
99 static void group_free(Group
*g
) {
106 static void group_hashmap_clear(Hashmap
*h
) {
109 while ((g
= hashmap_steal_first(h
)))
113 static void group_hashmap_free(Hashmap
*h
) {
114 group_hashmap_clear(h
);
118 static const char *maybe_format_bytes(char *buf
, size_t l
, bool is_valid
, uint64_t t
) {
122 snprintf(buf
, l
, "%" PRIu64
, t
);
125 return format_bytes(buf
, l
, t
);
129 const char *controller
,
143 all_unified
= cg_all_unified();
147 g
= hashmap_get(a
, path
);
149 g
= hashmap_get(b
, path
);
155 g
->path
= strdup(path
);
161 r
= hashmap_put(a
, g
->path
, g
);
167 r
= hashmap_move_one(a
, b
, path
);
171 g
->cpu_valid
= g
->memory_valid
= g
->io_valid
= g
->n_tasks_valid
= false;
175 if (streq(controller
, SYSTEMD_CGROUP_CONTROLLER
) && IN_SET(arg_count
, COUNT_ALL_PROCESSES
, COUNT_USERSPACE_PROCESSES
)) {
176 _cleanup_fclose_
FILE *f
= NULL
;
179 r
= cg_enumerate_processes(controller
, path
, &f
);
186 while (cg_read_pid(f
, &pid
) > 0) {
188 if (arg_count
== COUNT_USERSPACE_PROCESSES
&& is_kernel_thread(pid
) > 0)
195 g
->n_tasks_valid
= true;
197 } else if (streq(controller
, "pids") && arg_count
== COUNT_PIDS
) {
198 _cleanup_free_
char *p
= NULL
, *v
= NULL
;
200 r
= cg_get_path(controller
, path
, "pids.current", &p
);
204 r
= read_one_line_file(p
, &v
);
210 r
= safe_atou64(v
, &g
->n_tasks
);
215 g
->n_tasks_valid
= true;
217 } else if (streq(controller
, "cpu") || streq(controller
, "cpuacct")) {
218 _cleanup_free_
char *p
= NULL
, *v
= NULL
;
223 const char *keys
[] = { "usage_usec", NULL
};
224 _cleanup_free_
char *val
= NULL
;
226 if (!streq(controller
, "cpu"))
229 r
= cg_get_keyed_attribute("cpu", path
, "cpu.stat", keys
, &val
);
235 r
= safe_atou64(val
, &new_usage
);
239 new_usage
*= NSEC_PER_USEC
;
241 if (!streq(controller
, "cpuacct"))
244 r
= cg_get_path(controller
, path
, "cpuacct.usage", &p
);
248 r
= read_one_line_file(p
, &v
);
254 r
= safe_atou64(v
, &new_usage
);
259 timestamp
= now_nsec(CLOCK_MONOTONIC
);
261 if (g
->cpu_iteration
== iteration
- 1 &&
262 (nsec_t
) new_usage
> g
->cpu_usage
) {
266 x
= timestamp
- g
->cpu_timestamp
;
270 y
= (nsec_t
) new_usage
- g
->cpu_usage
;
271 g
->cpu_fraction
= (double) y
/ (double) x
;
275 g
->cpu_usage
= (nsec_t
) new_usage
;
276 g
->cpu_timestamp
= timestamp
;
277 g
->cpu_iteration
= iteration
;
279 } else if (streq(controller
, "memory")) {
280 _cleanup_free_
char *p
= NULL
, *v
= NULL
;
283 r
= cg_get_path(controller
, path
, "memory.current", &p
);
285 r
= cg_get_path(controller
, path
, "memory.usage_in_bytes", &p
);
289 r
= read_one_line_file(p
, &v
);
295 r
= safe_atou64(v
, &g
->memory
);
300 g
->memory_valid
= true;
302 } else if ((streq(controller
, "io") && all_unified
) ||
303 (streq(controller
, "blkio") && !all_unified
)) {
304 _cleanup_fclose_
FILE *f
= NULL
;
305 _cleanup_free_
char *p
= NULL
;
306 uint64_t wr
= 0, rd
= 0;
309 r
= cg_get_path(controller
, path
, all_unified
? "io.stat" : "blkio.io_service_bytes", &p
);
321 char line
[LINE_MAX
], *l
;
324 if (!fgets(line
, sizeof(line
), f
))
327 /* Trim and skip the device */
329 l
+= strcspn(l
, WHITESPACE
);
330 l
+= strspn(l
, WHITESPACE
);
333 while (!isempty(l
)) {
334 if (sscanf(l
, "rbytes=%" SCNu64
, &k
))
336 else if (sscanf(l
, "wbytes=%" SCNu64
, &k
))
339 l
+= strcspn(l
, WHITESPACE
);
340 l
+= strspn(l
, WHITESPACE
);
343 if (first_word(l
, "Read")) {
346 } else if (first_word(l
, "Write")) {
352 l
+= strspn(l
, WHITESPACE
);
353 r
= safe_atou64(l
, &k
);
361 timestamp
= now_nsec(CLOCK_MONOTONIC
);
363 if (g
->io_iteration
== iteration
- 1) {
366 x
= (uint64_t) (timestamp
- g
->io_timestamp
);
370 if (rd
> g
->io_input
)
371 yr
= rd
- g
->io_input
;
375 if (wr
> g
->io_output
)
376 yw
= wr
- g
->io_output
;
380 if (yr
> 0 || yw
> 0) {
381 g
->io_input_bps
= (yr
* 1000000000ULL) / x
;
382 g
->io_output_bps
= (yw
* 1000000000ULL) / x
;
389 g
->io_timestamp
= timestamp
;
390 g
->io_iteration
= iteration
;
399 static int refresh_one(
400 const char *controller
,
408 _cleanup_closedir_
DIR *d
= NULL
;
416 if (depth
> arg_depth
)
419 r
= process(controller
, path
, a
, b
, iteration
, &ours
);
423 r
= cg_enumerate_subgroups(controller
, path
, &d
);
430 _cleanup_free_
char *fn
= NULL
, *p
= NULL
;
433 r
= cg_read_subgroup(d
, &fn
);
439 p
= strjoin(path
, "/", fn
);
443 path_kill_slashes(p
);
445 r
= refresh_one(controller
, p
, a
, b
, iteration
, depth
+ 1, &child
);
450 IN_SET(arg_count
, COUNT_ALL_PROCESSES
, COUNT_USERSPACE_PROCESSES
) &&
452 child
->n_tasks_valid
&&
453 streq(controller
, SYSTEMD_CGROUP_CONTROLLER
)) {
455 /* Recursively sum up processes */
457 if (ours
->n_tasks_valid
)
458 ours
->n_tasks
+= child
->n_tasks
;
460 ours
->n_tasks
= child
->n_tasks
;
461 ours
->n_tasks_valid
= true;
472 static int refresh(const char *root
, Hashmap
*a
, Hashmap
*b
, unsigned iteration
) {
477 r
= refresh_one(SYSTEMD_CGROUP_CONTROLLER
, root
, a
, b
, iteration
, 0, NULL
);
480 r
= refresh_one("cpu", root
, a
, b
, iteration
, 0, NULL
);
483 r
= refresh_one("cpuacct", root
, a
, b
, iteration
, 0, NULL
);
486 r
= refresh_one("memory", root
, a
, b
, iteration
, 0, NULL
);
489 r
= refresh_one("io", root
, a
, b
, iteration
, 0, NULL
);
492 r
= refresh_one("blkio", root
, a
, b
, iteration
, 0, NULL
);
495 r
= refresh_one("pids", root
, a
, b
, iteration
, 0, NULL
);
502 static int group_compare(const void*a
, const void *b
) {
503 const Group
*x
= *(Group
**)a
, *y
= *(Group
**)b
;
505 if (arg_order
!= ORDER_TASKS
|| arg_recursive
) {
506 /* Let's make sure that the parent is always before
507 * the child. Except when ordering by tasks and
508 * recursive summing is off, since that is actually
509 * not accumulative for all children. */
511 if (path_startswith(y
->path
, x
->path
))
513 if (path_startswith(x
->path
, y
->path
))
523 if (arg_cpu_type
== CPU_PERCENT
) {
524 if (x
->cpu_valid
&& y
->cpu_valid
) {
525 if (x
->cpu_fraction
> y
->cpu_fraction
)
527 else if (x
->cpu_fraction
< y
->cpu_fraction
)
529 } else if (x
->cpu_valid
)
531 else if (y
->cpu_valid
)
534 if (x
->cpu_usage
> y
->cpu_usage
)
536 else if (x
->cpu_usage
< y
->cpu_usage
)
543 if (x
->n_tasks_valid
&& y
->n_tasks_valid
) {
544 if (x
->n_tasks
> y
->n_tasks
)
546 else if (x
->n_tasks
< y
->n_tasks
)
548 } else if (x
->n_tasks_valid
)
550 else if (y
->n_tasks_valid
)
556 if (x
->memory_valid
&& y
->memory_valid
) {
557 if (x
->memory
> y
->memory
)
559 else if (x
->memory
< y
->memory
)
561 } else if (x
->memory_valid
)
563 else if (y
->memory_valid
)
569 if (x
->io_valid
&& y
->io_valid
) {
570 if (x
->io_input_bps
+ x
->io_output_bps
> y
->io_input_bps
+ y
->io_output_bps
)
572 else if (x
->io_input_bps
+ x
->io_output_bps
< y
->io_input_bps
+ y
->io_output_bps
)
574 } else if (x
->io_valid
)
576 else if (y
->io_valid
)
580 return path_compare(x
->path
, y
->path
);
583 static void display(Hashmap
*a
) {
588 unsigned rows
, n
= 0, j
, maxtcpu
= 0, maxtpath
= 3; /* 3 for ellipsize() to work properly */
589 char buffer
[MAX3(21, FORMAT_BYTES_MAX
, FORMAT_TIMESPAN_MAX
)];
593 if (!terminal_is_dumb())
594 fputs(ANSI_HOME_CLEAR
, stdout
);
596 array
= alloca(sizeof(Group
*) * hashmap_size(a
));
598 HASHMAP_FOREACH(g
, a
, i
)
599 if (g
->n_tasks_valid
|| g
->cpu_valid
|| g
->memory_valid
|| g
->io_valid
)
602 qsort_safe(array
, n
, sizeof(Group
*), group_compare
);
604 /* Find the longest names in one run */
605 for (j
= 0; j
< n
; j
++) {
606 unsigned cputlen
, pathtlen
;
608 format_timespan(buffer
, sizeof(buffer
), (usec_t
) (array
[j
]->cpu_usage
/ NSEC_PER_USEC
), 0);
609 cputlen
= strlen(buffer
);
610 maxtcpu
= MAX(maxtcpu
, cputlen
);
612 pathtlen
= strlen(array
[j
]->path
);
613 maxtpath
= MAX(maxtpath
, pathtlen
);
616 if (arg_cpu_type
== CPU_PERCENT
)
617 xsprintf(buffer
, "%6s", "%CPU");
619 xsprintf(buffer
, "%*s", maxtcpu
, "CPU Time");
626 const char *on
, *off
;
628 path_columns
= columns() - 36 - strlen(buffer
);
629 if (path_columns
< 10)
632 on
= ansi_highlight_underline();
633 off
= ansi_underline();
635 printf("%s%s%-*s%s %s%7s%s %s%s%s %s%8s%s %s%8s%s %s%8s%s%s\n",
637 arg_order
== ORDER_PATH
? on
: "", path_columns
, "Control Group",
638 arg_order
== ORDER_PATH
? off
: "",
639 arg_order
== ORDER_TASKS
? on
: "", arg_count
== COUNT_PIDS
? "Tasks" : arg_count
== COUNT_USERSPACE_PROCESSES
? "Procs" : "Proc+",
640 arg_order
== ORDER_TASKS
? off
: "",
641 arg_order
== ORDER_CPU
? on
: "", buffer
,
642 arg_order
== ORDER_CPU
? off
: "",
643 arg_order
== ORDER_MEMORY
? on
: "", "Memory",
644 arg_order
== ORDER_MEMORY
? off
: "",
645 arg_order
== ORDER_IO
? on
: "", "Input/s",
646 arg_order
== ORDER_IO
? off
: "",
647 arg_order
== ORDER_IO
? on
: "", "Output/s",
648 arg_order
== ORDER_IO
? off
: "",
651 path_columns
= maxtpath
;
653 for (j
= 0; j
< n
; j
++) {
654 _cleanup_free_
char *ellipsized
= NULL
;
657 if (on_tty() && j
+ 6 > rows
)
662 path
= isempty(g
->path
) ? "/" : g
->path
;
663 ellipsized
= ellipsize(path
, path_columns
, 33);
664 printf("%-*s", path_columns
, ellipsized
?: path
);
666 if (g
->n_tasks_valid
)
667 printf(" %7" PRIu64
, g
->n_tasks
);
671 if (arg_cpu_type
== CPU_PERCENT
) {
673 printf(" %6.1f", g
->cpu_fraction
*100);
677 printf(" %*s", maxtcpu
, format_timespan(buffer
, sizeof(buffer
), (usec_t
) (g
->cpu_usage
/ NSEC_PER_USEC
), 0));
679 printf(" %8s", maybe_format_bytes(buffer
, sizeof(buffer
), g
->memory_valid
, g
->memory
));
680 printf(" %8s", maybe_format_bytes(buffer
, sizeof(buffer
), g
->io_valid
, g
->io_input_bps
));
681 printf(" %8s", maybe_format_bytes(buffer
, sizeof(buffer
), g
->io_valid
, g
->io_output_bps
));
687 static void help(void) {
688 printf("%s [OPTIONS...] [CGROUP]\n\n"
689 "Show top control groups by their resource usage.\n\n"
690 " -h --help Show this help\n"
691 " --version Show package version\n"
692 " -p --order=path Order by path\n"
693 " -t --order=tasks Order by number of tasks/processes\n"
694 " -c --order=cpu Order by CPU load (default)\n"
695 " -m --order=memory Order by memory load\n"
696 " -i --order=io Order by IO load\n"
697 " -r --raw Provide raw (not human-readable) numbers\n"
698 " --cpu=percentage Show CPU usage as percentage (default)\n"
699 " --cpu=time Show CPU usage as time\n"
700 " -P Count userspace processes instead of tasks (excl. kernel)\n"
701 " -k Count all processes instead of tasks (incl. kernel)\n"
702 " --recursive=BOOL Sum up process count recursively\n"
703 " -d --delay=DELAY Delay between updates\n"
704 " -n --iterations=N Run for N iterations before exiting\n"
705 " -b --batch Run in batch mode, accepting no input\n"
706 " --depth=DEPTH Maximum traversal depth (default: %u)\n"
707 " -M --machine= Show container\n"
708 , program_invocation_short_name
, arg_depth
);
711 static int parse_argv(int argc
, char *argv
[]) {
721 static const struct option options
[] = {
722 { "help", no_argument
, NULL
, 'h' },
723 { "version", no_argument
, NULL
, ARG_VERSION
},
724 { "delay", required_argument
, NULL
, 'd' },
725 { "iterations", required_argument
, NULL
, 'n' },
726 { "batch", no_argument
, NULL
, 'b' },
727 { "raw", no_argument
, NULL
, 'r' },
728 { "depth", required_argument
, NULL
, ARG_DEPTH
},
729 { "cpu", optional_argument
, NULL
, ARG_CPU_TYPE
},
730 { "order", required_argument
, NULL
, ARG_ORDER
},
731 { "recursive", required_argument
, NULL
, ARG_RECURSIVE
},
732 { "machine", required_argument
, NULL
, 'M' },
741 while ((c
= getopt_long(argc
, argv
, "hptcmin:brd:kPM:", options
, NULL
)) >= 0)
754 if (streq(optarg
, "time"))
755 arg_cpu_type
= CPU_TIME
;
756 else if (streq(optarg
, "percentage"))
757 arg_cpu_type
= CPU_PERCENT
;
759 log_error("Unknown argument to --cpu=: %s", optarg
);
763 arg_cpu_type
= CPU_TIME
;
768 r
= safe_atou(optarg
, &arg_depth
);
770 log_error("Failed to parse depth parameter.");
777 r
= parse_sec(optarg
, &arg_delay
);
778 if (r
< 0 || arg_delay
<= 0) {
779 log_error("Failed to parse delay parameter.");
786 r
= safe_atou(optarg
, &arg_iterations
);
788 log_error("Failed to parse iterations parameter.");
803 arg_order
= ORDER_PATH
;
807 arg_order
= ORDER_TASKS
;
811 arg_order
= ORDER_CPU
;
815 arg_order
= ORDER_MEMORY
;
819 arg_order
= ORDER_IO
;
823 if (streq(optarg
, "path"))
824 arg_order
= ORDER_PATH
;
825 else if (streq(optarg
, "tasks"))
826 arg_order
= ORDER_TASKS
;
827 else if (streq(optarg
, "cpu"))
828 arg_order
= ORDER_CPU
;
829 else if (streq(optarg
, "memory"))
830 arg_order
= ORDER_MEMORY
;
831 else if (streq(optarg
, "io"))
832 arg_order
= ORDER_IO
;
834 log_error("Invalid argument to --order=: %s", optarg
);
840 arg_count
= COUNT_ALL_PROCESSES
;
844 arg_count
= COUNT_USERSPACE_PROCESSES
;
848 r
= parse_boolean(optarg
);
850 log_error("Failed to parse --recursive= argument: %s", optarg
);
855 arg_recursive_unset
= r
== 0;
859 arg_machine
= optarg
;
866 assert_not_reached("Unhandled option");
869 if (optind
== argc
- 1)
870 arg_root
= argv
[optind
];
871 else if (optind
< argc
) {
872 log_error("Too many arguments.");
879 static const char* counting_what(void) {
880 if (arg_count
== COUNT_PIDS
)
882 else if (arg_count
== COUNT_ALL_PROCESSES
)
883 return "all processes (incl. kernel)";
885 return "userspace processes (excl. kernel)";
888 int main(int argc
, char *argv
[]) {
890 Hashmap
*a
= NULL
, *b
= NULL
;
891 unsigned iteration
= 0;
892 usec_t last_refresh
= 0;
893 bool quit
= false, immediate_refresh
= false;
894 _cleanup_free_
char *root
= NULL
;
897 log_parse_environment();
900 r
= parse_argv(argc
, argv
);
904 r
= cg_mask_supported(&mask
);
906 log_error_errno(r
, "Failed to determine supported controllers: %m");
910 arg_count
= (mask
& CGROUP_MASK_PIDS
) ? COUNT_PIDS
: COUNT_USERSPACE_PROCESSES
;
912 if (arg_recursive_unset
&& arg_count
== COUNT_PIDS
) {
913 log_error("Non-recursive counting is only supported when counting processes, not tasks. Use -P or -k.");
917 r
= show_cgroup_get_path_and_warn(arg_machine
, arg_root
, &root
);
919 log_error_errno(r
, "Failed to get root control group path: %m");
922 log_debug("Cgroup path: %s", root
);
924 a
= hashmap_new(&string_hash_ops
);
925 b
= hashmap_new(&string_hash_ops
);
931 signal(SIGWINCH
, columns_lines_cache_reset
);
933 if (arg_iterations
== (unsigned) -1)
934 arg_iterations
= on_tty() ? 0 : 1;
940 char h
[FORMAT_TIMESPAN_MAX
];
942 t
= now(CLOCK_MONOTONIC
);
944 if (t
>= last_refresh
+ arg_delay
|| immediate_refresh
) {
946 r
= refresh(root
, a
, b
, iteration
++);
948 log_error_errno(r
, "Failed to refresh: %m");
952 group_hashmap_clear(b
);
959 immediate_refresh
= false;
964 if (arg_iterations
&& iteration
>= arg_iterations
)
967 if (!on_tty()) /* non-TTY: Empty newline as delimiter between polls */
972 (void) usleep(last_refresh
+ arg_delay
- t
);
974 r
= read_one_char(stdin
, &key
, last_refresh
+ arg_delay
- t
, NULL
);
978 log_error_errno(r
, "Couldn't read key: %m");
983 if (on_tty()) { /* TTY: Clear any user keystroke */
984 fputs("\r \r", stdout
);
994 immediate_refresh
= true;
1002 arg_order
= ORDER_PATH
;
1006 arg_order
= ORDER_TASKS
;
1010 arg_order
= ORDER_CPU
;
1014 arg_order
= ORDER_MEMORY
;
1018 arg_order
= ORDER_IO
;
1022 arg_cpu_type
= arg_cpu_type
== CPU_TIME
? CPU_PERCENT
: CPU_TIME
;
1026 arg_count
= arg_count
!= COUNT_ALL_PROCESSES
? COUNT_ALL_PROCESSES
: COUNT_PIDS
;
1027 fprintf(stdout
, "\nCounting: %s.", counting_what());
1033 arg_count
= arg_count
!= COUNT_USERSPACE_PROCESSES
? COUNT_USERSPACE_PROCESSES
: COUNT_PIDS
;
1034 fprintf(stdout
, "\nCounting: %s.", counting_what());
1040 if (arg_count
== COUNT_PIDS
)
1041 fprintf(stdout
, "\n\aCannot toggle recursive counting, not available in task counting mode.");
1043 arg_recursive
= !arg_recursive
;
1044 fprintf(stdout
, "\nRecursive process counting: %s", yes_no(arg_recursive
));
1051 if (arg_delay
< USEC_PER_SEC
)
1052 arg_delay
+= USEC_PER_MSEC
*250;
1054 arg_delay
+= USEC_PER_SEC
;
1056 fprintf(stdout
, "\nIncreased delay to %s.", format_timespan(h
, sizeof(h
), arg_delay
, 0));
1062 if (arg_delay
<= USEC_PER_MSEC
*500)
1063 arg_delay
= USEC_PER_MSEC
*250;
1064 else if (arg_delay
< USEC_PER_MSEC
*1250)
1065 arg_delay
-= USEC_PER_MSEC
*250;
1067 arg_delay
-= USEC_PER_SEC
;
1069 fprintf(stdout
, "\nDecreased delay to %s.", format_timespan(h
, sizeof(h
), arg_delay
, 0));
1077 #define ON ANSI_HIGHLIGHT
1078 #define OFF ANSI_NORMAL
1081 "\t<" ON
"p" OFF
"> By path; <" ON
"t" OFF
"> By tasks/procs; <" ON
"c" OFF
"> By CPU; <" ON
"m" OFF
"> By memory; <" ON
"i" OFF
"> By I/O\n"
1082 "\t<" ON
"+" OFF
"> Inc. delay; <" ON
"-" OFF
"> Dec. delay; <" ON
"%%" OFF
"> Toggle time; <" ON
"SPACE" OFF
"> Refresh\n"
1083 "\t<" ON
"P" OFF
"> Toggle count userspace processes; <" ON
"k" OFF
"> Toggle count all processes\n"
1084 "\t<" ON
"r" OFF
"> Count processes recursively; <" ON
"q" OFF
"> Quit");
1091 fprintf(stdout
, "\nUnknown key '\\x%x'. Ignoring.", key
);
1093 fprintf(stdout
, "\nUnknown key '%c'. Ignoring.", key
);
1103 group_hashmap_free(a
);
1104 group_hashmap_free(b
);
1106 return r
< 0 ? EXIT_FAILURE
: EXIT_SUCCESS
;