Merge pull request #17903 from yuwata/udev-options-log-level

udev: introduce OPTIONS="log_level=xxx" rule
This commit is contained in:
Lennart Poettering
2020-12-10 20:45:32 +01:00
committed by GitHub
10 changed files with 97 additions and 49 deletions
+14
View File
@@ -324,6 +324,20 @@ bool device_for_action(sd_device *dev, DeviceAction action) {
return a == action;
}
void log_device_uevent(sd_device *device, const char *str) {
DeviceAction action = _DEVICE_ACTION_INVALID;
uint64_t seqnum = 0;
if (!DEBUG_LOGGING)
return;
(void) device_get_seqnum(device, &seqnum);
(void) device_get_action(device, &action);
log_device_debug(device, "%s%s(SEQNUM=%"PRIu64", ACTION=%s)",
strempty(str), isempty(str) ? "" : " ",
seqnum, strna(device_action_to_string(action)));
}
int udev_rule_parse_value(char *str, char **ret_value, char **ret_endpos) {
char *i, *j;
int r;
+2
View File
@@ -33,4 +33,6 @@ int device_wait_for_devlink(const char *path, const char *subsystem, usec_t dead
int device_is_renaming(sd_device *dev);
bool device_for_action(sd_device *dev, DeviceAction action);
void log_device_uevent(sd_device *device, const char *str);
int udev_rule_parse_value(char *str, char **ret_value, char **ret_endpos);