Changeset 6a26e9b in rtems


Ignore:
Timestamp:
Dec 24, 2013, 7:08:29 AM (5 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.11, master
Children:
0c09ccf3
Parents:
9f9c0bb
Message:

cpukit/capture: Print the uptime and diff in ctrace.

Print the uptime and difference in nanoseconds to the previous
record in the ctrace output. For example:

0:00:59.474927121 14760 0a01000c TNTD 235 235 CREATED_BY
0:00:59.474927418 297 0a010012 /dev 235 235 CREATED
0:00:59.474930799 3381 0a01000c TNTD 235 235 STARTED_BY
0:00:59.474931105 306 0a010012 /dev 235 235 STARTED
0:00:59.475072297 141192 0a01000c TNTD 235 235 SWITCHED_OUT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libmisc/capture/capture-cli.c

    r9f9c0bb r6a26e9b  
    222222  uint32_t minutes;
    223223  uint32_t seconds;
    224   uint32_t usecs;
    225 
    226   seconds = uptime / 1000000000LLU;
    227   minutes = seconds / 60;
    228   hours   = minutes / 60;
    229   minutes = minutes % 60;
    230   seconds = seconds % 60;
    231   usecs = (uptime / 1000) % 1000000;
    232 
    233   fprintf (stdout, "%5lu:%02lu:%02lu.%06lu", hours, minutes, seconds, usecs);
     224  uint32_t nanosecs;
     225
     226  seconds  = uptime / 1000000000LLU;
     227  minutes  = seconds / 60;
     228  hours    = minutes / 60;
     229  minutes  = minutes % 60;
     230  seconds  = seconds % 60;
     231  nanosecs = uptime % 1000000000;
     232
     233  fprintf (stdout, "%5lu:%02lu:%02lu.%09lu", hours, minutes, seconds, nanosecs);
    234234}
    235235
     
    13551355  rtems_capture_record_t* rec;
    13561356  int                     arg;
     1357  rtems_capture_time_t    last_t = 0;
    13571358
    13581359  for (arg = 1; arg < argc; arg++)
     
    14211422      else
    14221423      {
    1423         rtems_capture_time_t t;
    1424         uint32_t             event;
    1425         int                  e;
     1424        uint64_t diff = 0;
     1425        uint32_t event;
     1426        int      e;
    14261427
    14271428        event = rec->events >> RTEMS_CAPTURE_EVENT_START;
    1428 
    1429         t = rec->time;
    14301429
    14311430        for (e = RTEMS_CAPTURE_EVENT_START; e < RTEMS_CAPTURE_EVENT_END; e++)
     
    14331432          if (event & 1)
    14341433          {
    1435             fprintf (stdout, "%12Lu %9lu.%09lu ",
    1436                      t,
    1437                      (unsigned long) (t / 1000000000ULL),
    1438                      (unsigned long) (t % 10000000000ULL));
     1434            rtems_capture_cli_print_timestamp (rec->time);
     1435            if (last_t)
     1436              diff = rec->time - last_t;
     1437            last_t = rec->time;
     1438            fprintf (stdout, " %9" PRId64 " ", diff);
    14391439            rtems_monitor_dump_id (rtems_capture_task_id (rec->task));
    14401440            fprintf (stdout, " %c%c%c%c",
Note: See TracChangeset for help on using the changeset viewer.