Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/kdump/kdump.c
Show First 20 Lines • Show All 443 Lines • ▼ Show 20 Lines | if (ktr_header.ktr_type & KTR_VERSIONED) { | ||||
ktr_header.ktr_type &= ~KTR_VERSIONED; | ktr_header.ktr_type &= ~KTR_VERSIONED; | ||||
version = ktr_header.ktr_version; | version = ktr_header.ktr_version; | ||||
} else | } else | ||||
version = KTR_VERSION0; | version = KTR_VERSION0; | ||||
if (ktr_header.ktr_type & KTR_DROP) { | if (ktr_header.ktr_type & KTR_DROP) { | ||||
ktr_header.ktr_type &= ~KTR_DROP; | ktr_header.ktr_type &= ~KTR_DROP; | ||||
if (!drop_logged && threads) { | if (!drop_logged && threads) { | ||||
printf( | printf( | ||||
"%6jd %6jd %-8.*s Events dropped.\n", | "%6d %6d %-8.*s Events dropped.\n", | ||||
(intmax_t)ktr_header.ktr_pid, | ktr_header.ktr_pid, | ||||
kib: this assumes specific type for lwpid still | |||||
Done Inline ActionsIt does. Changing the type of lwpid_t wouldn't be as disruptive as changing pid_t, but it seems impractical and unlikely given its part of the ABI in several places. I don't think this makes things appreciably worse. brooks: It does. Changing the type of lwpid_t wouldn't be as disruptive as changing pid_t, but it seems… | |||||
Not Done Inline ActionsI did not suggested changing the type of ktr_tid. Rather I mean that you should cast it to int instead of lwpid_t. kib: I did not suggested changing the type of ktr_tid. Rather I mean that you should cast it to int… | |||||
ktr_header.ktr_tid > 0 ? | ktr_header.ktr_tid > 0 ? | ||||
(intmax_t)ktr_header.ktr_tid : 0, | (lwpid_t)ktr_header.ktr_tid : 0, | ||||
MAXCOMLEN, ktr_header.ktr_comm); | MAXCOMLEN, ktr_header.ktr_comm); | ||||
drop_logged = 1; | drop_logged = 1; | ||||
} else if (!drop_logged) { | } else if (!drop_logged) { | ||||
printf("%6jd %-8.*s Events dropped.\n", | printf("%6d %-8.*s Events dropped.\n", | ||||
(intmax_t)ktr_header.ktr_pid, MAXCOMLEN, | ktr_header.ktr_pid, MAXCOMLEN, | ||||
ktr_header.ktr_comm); | ktr_header.ktr_comm); | ||||
drop_logged = 1; | drop_logged = 1; | ||||
} | } | ||||
} | } | ||||
if ((ktrlen = ktr_header.ktr_len) < 0) | if ((ktrlen = ktr_header.ktr_len) < 0) | ||||
errx(1, "bogus length 0x%x", ktrlen); | errx(1, "bogus length 0x%x", ktrlen); | ||||
if (ktrlen > size) { | if (ktrlen > size) { | ||||
m = realloc(m, ktrlen+1); | m = realloc(m, ktrlen+1); | ||||
▲ Show 20 Lines • Show All 250 Lines • ▼ Show 20 Lines | dumpheader(struct ktr_header *kth, u_int sv_flags) | ||||
* The ktr_tid field was previously the ktr_buffer field, which held | * The ktr_tid field was previously the ktr_buffer field, which held | ||||
* the kernel pointer value for the buffer associated with data | * the kernel pointer value for the buffer associated with data | ||||
* following the record header. It now holds a threadid, but only | * following the record header. It now holds a threadid, but only | ||||
* for trace files after the change. Older trace files still contain | * for trace files after the change. Older trace files still contain | ||||
* kernel pointers. Detect this and suppress the results by printing | * kernel pointers. Detect this and suppress the results by printing | ||||
* negative tid's as 0. | * negative tid's as 0. | ||||
*/ | */ | ||||
if (threads) | if (threads) | ||||
printf("%6jd %6jd %-8.*s ", (intmax_t)kth->ktr_pid, | printf("%6d %6d %-8.*s ", kth->ktr_pid, | ||||
kth->ktr_tid > 0 ? (intmax_t)kth->ktr_tid : 0, | kth->ktr_tid > 0 ? (lwpid_t)kth->ktr_tid : 0, | ||||
MAXCOMLEN, kth->ktr_comm); | MAXCOMLEN, kth->ktr_comm); | ||||
else | else | ||||
printf("%6jd %-8.*s ", (intmax_t)kth->ktr_pid, MAXCOMLEN, | printf("%6d %-8.*s ", kth->ktr_pid, MAXCOMLEN, kth->ktr_comm); | ||||
kth->ktr_comm); | |||||
if (timestamp) { | if (timestamp) { | ||||
if (version == KTR_VERSION0) | if (version == KTR_VERSION0) | ||||
dumptimeval((struct ktr_header_v0 *)kth); | dumptimeval((struct ktr_header_v0 *)kth); | ||||
else | else | ||||
dumptimespec(kth); | dumptimespec(kth); | ||||
} | } | ||||
if (cpuflag && version > KTR_VERSION0) | if (cpuflag && version > KTR_VERSION0) | ||||
printf("%3d ", kth->ktr_cpu); | printf("%3d ", kth->ktr_cpu); | ||||
▲ Show 20 Lines • Show All 1,592 Lines • Show Last 20 Lines |
this assumes specific type for lwpid still