| 483 | } |
| 484 | |
| 485 | static struct command_result *json_success_subsystems(struct command *cmd, |
| 486 | const enum subsystem *subsystem) |
| 487 | { |
| 488 | struct json_stream *response = jsonrpc_stream_success(cmd); |
| 489 | |
| 490 | json_object_start(response, "autoclean"); |
| 491 | for (enum subsystem i = 0; i < NUM_SUBSYSTEM; i++) { |
| 492 | if (subsystem && i != *subsystem) |
| 493 | continue; |
| 494 | json_object_start(response, subsystem_to_str(i)); |
| 495 | json_add_bool(response, "enabled", timer_cinfo.subsystem_age[i] != 0); |
| 496 | if (timer_cinfo.subsystem_age[i] != 0) |
| 497 | json_add_u64(response, "age", timer_cinfo.subsystem_age[i]); |
| 498 | json_add_u64(response, "cleaned", total_cleaned[i]); |
| 499 | json_object_end(response); |
| 500 | } |
| 501 | json_object_end(response); |
| 502 | return command_finished(cmd, response); |
| 503 | } |
| 504 | |
| 505 | static struct command_result *json_autoclean_status(struct command *cmd, |
| 506 | const char *buffer, |
no test coverage detected