core: add IODeviceLatencyTargetSec
This adds support for the following proposed latency based IO control mechanism. https://lkml.org/lkml/2018/6/5/428
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
71d1700afa
commit
6ae4283cb1
@@ -4899,6 +4899,28 @@ static int print_property(const char *name, sd_bus_message *m, bool value, bool
|
||||
|
||||
return 1;
|
||||
|
||||
} else if (contents[0] == SD_BUS_TYPE_STRUCT_BEGIN &&
|
||||
streq(name, "IODeviceLatencyTargetUSec")) {
|
||||
char ts[FORMAT_TIMESPAN_MAX];
|
||||
const char *path;
|
||||
uint64_t target;
|
||||
|
||||
r = sd_bus_message_enter_container(m, SD_BUS_TYPE_ARRAY, "(st)");
|
||||
if (r < 0)
|
||||
return bus_log_parse_error(r);
|
||||
|
||||
while ((r = sd_bus_message_read(m, "(st)", &path, &target)) > 0)
|
||||
print_prop(name, "%s %s", strna(path),
|
||||
format_timespan(ts, sizeof(ts), target, 1));
|
||||
if (r < 0)
|
||||
return bus_log_parse_error(r);
|
||||
|
||||
r = sd_bus_message_exit_container(m);
|
||||
if (r < 0)
|
||||
return bus_log_parse_error(r);
|
||||
|
||||
return 1;
|
||||
|
||||
} else if (contents[0] == SD_BUS_TYPE_BYTE && streq(name, "StandardInputData")) {
|
||||
_cleanup_free_ char *h = NULL;
|
||||
const void *p;
|
||||
|
||||
Reference in New Issue
Block a user