version 1.140, 2019/11/27 16:50:21 |
version 1.141, 2020/01/18 23:56:31 |
|
|
#include "kdump_subr.h" |
#include "kdump_subr.h" |
#include "extern.h" |
#include "extern.h" |
|
|
int timestamp, decimal, iohex, fancy = 1, maxdata = INT_MAX; |
enum { |
|
TIMESTAMP_NONE, |
|
TIMESTAMP_ABSOLUTE, |
|
TIMESTAMP_RELATIVE, |
|
TIMESTAMP_ELAPSED |
|
} timestamp = TIMESTAMP_NONE; |
|
|
|
int decimal, iohex, fancy = 1, maxdata = INT_MAX; |
int needtid, tail, basecol; |
int needtid, tail, basecol; |
char *tracefile = DEF_TRACEFILE; |
char *tracefile = DEF_TRACEFILE; |
struct ktr_header ktr_header; |
struct ktr_header ktr_header; |
|
|
errx(1, "-p %s: %s", optarg, errstr); |
errx(1, "-p %s: %s", optarg, errstr); |
break; |
break; |
case 'R': /* relative timestamp */ |
case 'R': /* relative timestamp */ |
timestamp = timestamp == 1 ? 3 : 2; |
if (timestamp == TIMESTAMP_ABSOLUTE) |
|
timestamp = TIMESTAMP_ELAPSED; |
|
else |
|
timestamp = TIMESTAMP_RELATIVE; |
break; |
break; |
case 'T': |
case 'T': |
timestamp = timestamp == 2 ? 3 : 1; |
if (timestamp == TIMESTAMP_RELATIVE) |
|
timestamp = TIMESTAMP_ELAPSED; |
|
else |
|
timestamp = TIMESTAMP_ABSOLUTE; |
break; |
break; |
case 't': |
case 't': |
trpoints = getpoints(optarg, DEF_POINTS); |
trpoints = getpoints(optarg, DEF_POINTS); |
|
|
if (needtid) |
if (needtid) |
basecol += printf("/%-7ld", (long)kth->ktr_tid); |
basecol += printf("/%-7ld", (long)kth->ktr_tid); |
basecol += printf(" %-8.*s ", MAXCOMLEN, kth->ktr_comm); |
basecol += printf(" %-8.*s ", MAXCOMLEN, kth->ktr_comm); |
if (timestamp) { |
if (timestamp != TIMESTAMP_NONE) { |
if (timestamp == 3) { |
if (timestamp == TIMESTAMP_ELAPSED) { |
if (prevtime.tv_sec == 0) |
if (prevtime.tv_sec == 0) |
prevtime = kth->ktr_time; |
prevtime = kth->ktr_time; |
timespecsub(&kth->ktr_time, &prevtime, &temp); |
timespecsub(&kth->ktr_time, &prevtime, &temp); |
} else if (timestamp == 2) { |
} else if (timestamp == TIMESTAMP_RELATIVE) { |
timespecsub(&kth->ktr_time, &prevtime, &temp); |
timespecsub(&kth->ktr_time, &prevtime, &temp); |
prevtime = kth->ktr_time; |
prevtime = kth->ktr_time; |
} else |
} else |