[BACK]Return to kdump.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / kdump

Diff for /src/usr.bin/kdump/kdump.c between version 1.140 and 1.141

version 1.140, 2019/11/27 16:50:21 version 1.141, 2020/01/18 23:56:31
Line 74 
Line 74 
 #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;
Line 186 
Line 193 
                                 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);
Line 354 
Line 367 
         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

Legend:
Removed from v.1.140  
changed lines
  Added in v.1.141