-static void print_machine_status_info(MachineStatusInfo *i) {
- char since1[FORMAT_TIMESTAMP_RELATIVE_MAX], *s1;
- char since2[FORMAT_TIMESTAMP_MAX], *s2;
- assert(i);
-
- fputs(strna(i->name), stdout);
-
- if (!sd_id128_equal(i->id, SD_ID128_NULL))
- printf("(" SD_ID128_FORMAT_STR ")\n", SD_ID128_FORMAT_VAL(i->id));
- else
- putchar('\n');
-
- s1 = format_timestamp_relative(since1, sizeof(since1), i->timestamp);
- s2 = format_timestamp(since2, sizeof(since2), i->timestamp);
-
- if (s1)
- printf("\t Since: %s; %s\n", s2, s1);
- else if (s2)
- printf("\t Since: %s\n", s2);
-
- if (i->leader > 0) {
- _cleanup_free_ char *t = NULL;
-
- printf("\t Leader: %u", (unsigned) i->leader);
-
- get_process_comm(i->leader, &t);
- if (t)
- printf(" (%s)", t);
-
- putchar('\n');
- }
-
- if (i->service) {
- printf("\t Service: %s", i->service);
-
- if (i->class)
- printf("; class %s", i->class);
-
- putchar('\n');
- } else if (i->class)
- printf("\t Class: %s\n", i->class);
-
- if (i->slice)
- printf("\t Slice: %s\n", i->slice);
- if (i->root_directory)
- printf("\t Root: %s\n", i->root_directory);
-
- if (i->default_control_group) {
- unsigned c;
- int output_flags =
- arg_all * OUTPUT_SHOW_ALL |
- arg_full * OUTPUT_FULL_WIDTH;
-
- printf("\t CGroup: %s\n", i->default_control_group);
-
- if (arg_transport != TRANSPORT_SSH) {
- c = columns();
- if (c > 18)
- c -= 18;
- else
- c = 0;
-
- show_cgroup_and_extra_by_spec(i->default_control_group,
- "\t\t ", c, false, &i->leader,
- i->leader > 0 ? 1 : 0,
- output_flags);
- }
- }
-}
-