summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--man/udevadm.xml32
-rw-r--r--src/udev/udevadm-info.c52
2 files changed, 75 insertions, 9 deletions
diff --git a/man/udevadm.xml b/man/udevadm.xml
index e299a75879..162287fa5f 100644
--- a/man/udevadm.xml
+++ b/man/udevadm.xml
@@ -228,6 +228,30 @@
<entry>Device path in <filename>/sys/</filename></entry>
</row>
<row>
+ <entry><literal>M:</literal></entry>
+ <entry>Device name in <filename>/sys/</filename> (i.e. the last component of <literal>P:</literal>)</entry>
+ </row>
+ <row>
+ <entry><literal>R:</literal></entry>
+ <entry>Device number in <filename>/sys/</filename> (i.e. the numeric suffix of the last component of <literal>P:</literal>)</entry>
+ </row>
+ <row>
+ <entry><literal>U:</literal></entry>
+ <entry>Kernel subsystem</entry>
+ </row>
+ <row>
+ <entry><literal>T:</literal></entry>
+ <entry>Kernel device type within subsystem</entry>
+ </row>
+ <row>
+ <entry><literal>D:</literal></entry>
+ <entry>Kernel device node major/minor</entry>
+ </row>
+ <row>
+ <entry><literal>I:</literal></entry>
+ <entry>Network interface index</entry>
+ </row>
+ <row>
<entry><literal>N:</literal></entry>
<entry>Kernel device node name</entry>
</row>
@@ -240,6 +264,14 @@
<entry>Device node symlink</entry>
</row>
<row>
+ <entry><literal>Q:</literal></entry>
+ <entry>Block device sequence number (DISKSEQ)</entry>
+ </row>
+ <row>
+ <entry><literal>V:</literal></entry>
+ <entry>Attached driver</entry>
+ </row>
+ <row>
<entry><literal>E:</literal></entry>
<entry>Device property</entry>
</row>
diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c
index a088c1727c..721c5665b3 100644
--- a/src/udev/udevadm-info.c
+++ b/src/udev/udevadm-info.c
@@ -171,27 +171,61 @@ static int print_device_chain(sd_device *device) {
}
static int print_record(sd_device *device) {
- const char *str, *val;
- int i;
+ const char *str, *val, *subsys;
+ dev_t devnum;
+ uint64_t q;
+ int i, ifi;
assert(device);
- (void) sd_device_get_devpath(device, &str);
+ /* We don't show syspath here, because it's identical to devpath (modulo the "/sys" prefix).
+ *
+ * We don't show action/seqnum here because that only makes sense for records synthesized from
+ * uevents, not for those synthesized from database entries.
+ *
+ * We don't show sysattrs here, because they can be expensive and potentially issue expensive driver
+ * IO. */
+
+ assert_se(sd_device_get_devpath(device, &str) >= 0);
printf("P: %s\n", str);
+ if (sd_device_get_sysname(device, &str) >= 0)
+ printf("M: %s\n", str);
+
+ if (sd_device_get_sysnum(device, &str) >= 0)
+ printf("R: %s\n", str);
+
+ if (sd_device_get_subsystem(device, &subsys) >= 0)
+ printf("U: %s\n", subsys);
+
+ if (sd_device_get_devtype(device, &str) >= 0)
+ printf("T: %s\n", str);
+
+ if (sd_device_get_devnum(device, &devnum) >= 0)
+ printf("D: %c %u:%u\n", streq_ptr(subsys, "block") ? 'b' : 'c', major(devnum), minor(devnum));
+
+ if (sd_device_get_ifindex(device, &ifi) >= 0)
+ printf("I: %i\n", ifi);
+
if (sd_device_get_devname(device, &str) >= 0) {
assert_se(val = path_startswith(str, "/dev/"));
printf("N: %s\n", val);
- }
- if (device_get_devlink_priority(device, &i) >= 0)
- printf("L: %i\n", i);
+ if (device_get_devlink_priority(device, &i) >= 0)
+ printf("L: %i\n", i);
- FOREACH_DEVICE_DEVLINK(device, str) {
- assert_se(val = path_startswith(str, "/dev/"));
- printf("S: %s\n", val);
+ FOREACH_DEVICE_DEVLINK(device, str) {
+ assert_se(val = path_startswith(str, "/dev/"));
+ printf("S: %s\n", val);
+ }
}
+ if (sd_device_get_diskseq(device, &q) >= 0)
+ printf("Q: %" PRIu64 "\n", q);
+
+ if (sd_device_get_driver(device, &str) >= 0)
+ printf("V: %s\n", str);
+
FOREACH_DEVICE_PROPERTY(device, str, val)
printf("E: %s=%s\n", str, val);