Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/kdump Understand xattr ktruser records
details: https://anonhg.NetBSD.org/src/rev/6b3b6b673b0b
branches: trunk
changeset: 1009311:6b3b6b673b0b
user: christos <christos%NetBSD.org@localhost>
date: Mon Apr 20 00:35:41 2020 +0000
description:
Understand xattr ktruser records
diffstat:
usr.bin/kdump/kdump.c | 37 +++++++++++++++++++++++++++++++++++--
1 files changed, 35 insertions(+), 2 deletions(-)
diffs (65 lines):
diff -r c3cfba797fa2 -r 6b3b6b673b0b usr.bin/kdump/kdump.c
--- a/usr.bin/kdump/kdump.c Mon Apr 20 00:34:58 2020 +0000
+++ b/usr.bin/kdump/kdump.c Mon Apr 20 00:35:41 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kdump.c,v 1.136 2020/04/03 06:13:07 wiz Exp $ */
+/* $NetBSD: kdump.c,v 1.137 2020/04/20 00:35:41 christos Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: kdump.c,v 1.136 2020/04/03 06:13:07 wiz Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.137 2020/04/20 00:35:41 christos Exp $");
#endif
#endif /* not lint */
@@ -1213,6 +1213,36 @@
}
static void
+ktruser_xattr_name(const char *name, const void *buf, size_t len)
+{
+ printf("%.*s: [%*s]\n", KTR_USER_MAXIDLEN, name, (int)len,
+ (const char *)buf);
+}
+
+static void
+ktruser_xattr_val(const char *name, const void *buf, size_t len)
+{
+ const uint8_t *p = buf;
+ printf("%.*s: ", KTR_USER_MAXIDLEN, name);
+ for (size_t i = 0; i < len; i++)
+ printf("%.2x", *p++);
+ printf("\n");
+}
+
+static void
+ktruser_xattr_list(const char *name, const void *buf, size_t len)
+{
+ const uint8_t *p = buf, *ep = p + len;
+ printf("%.*s:", KTR_USER_MAXIDLEN, name);
+ while (p < ep) {
+ int l = *p++;
+ printf(" %.*s", l, p);
+ p += l;
+ }
+ printf("\n");
+}
+
+static void
ktruser_control(const char *name, const void *buf, size_t len)
{
struct cmsghdr m;
@@ -1266,6 +1296,9 @@
{ "mbsoname", ktruser_soname },
{ "mbcontrol", ktruser_control },
{ "malloc", ktruser_malloc },
+ { "xattr-name", ktruser_xattr_name },
+ { "xattr-val", ktruser_xattr_val },
+ { "xattr-list", ktruser_xattr_list },
{ NULL, ktruser_misc },
};
Home |
Main Index |
Thread Index |
Old Index