From 82e2dd32b608b6c687987fbb35d4d905b64560b8 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Thu, 19 Sep 1996 19:50:45 +0000 Subject: [PATCH] For now we just hexdump the stuff in USER records. --- usr.bin/kdump/kdump.1 | 4 ++-- usr.bin/kdump/kdump.c | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/usr.bin/kdump/kdump.1 b/usr.bin/kdump/kdump.1 index 5db704fab177..52c9da1271ec 100644 --- a/usr.bin/kdump/kdump.1 +++ b/usr.bin/kdump/kdump.1 @@ -42,7 +42,7 @@ .Op Fl dnlRT .Op Fl f Ar file .Op Fl m Ar maxdata -.Op Fl t Op cnis +.Op Fl t Op cnisu .Sh DESCRIPTION .Nm Kdump displays the kernel trace files produced with @@ -85,7 +85,7 @@ easily amenable to further processing. Display relative timestamps (time since previous entry). .It Fl T Display absolute timestamps for each entry (seconds since epoch). -.It Fl t Ar cnis +.It Fl t Ar cnisuw See the .Fl t option of diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index b290d4db4091..94111f682458 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -170,6 +170,9 @@ main(argc, argv) case KTR_CSW: ktrcsw((struct ktr_csw *)m); break; + case KTR_USER: + ktruser((struct ktr_user *)m); + break; } if (tail) (void)fflush(stdout); @@ -215,6 +218,9 @@ dumpheader(kth) case KTR_CSW: type = "CSW"; break; + case KTR_USER: + type = "USER"; + break; default: (void)sprintf(unknown, "UNKNOWN(%d)", kth->ktr_type); type = unknown; @@ -433,9 +439,20 @@ ktrcsw(cs) cs->user ? "user" : "kernel"); } +ktruser(cs) + struct ktr_user *cs; +{ + unsigned char *p = (unsigned char *)(cs + 1); + (void)printf("%d ", cs->len); + while (cs->len--) + (void)printf(" %02x", *p++); + (void)printf("\n"); + +} + usage() { (void)fprintf(stderr, - "usage: kdump [-dnlRT] [-f trfile] [-m maxdata] [-t [cnis]]\n"); + "usage: kdump [-dnlRT] [-f trfile] [-m maxdata] [-t [cnisuw]]\n"); exit(1); }