diff options
| author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2016-07-20 07:42:01 -0400 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2016-07-20 10:25:16 -0400 |
| commit | 740b163f5175b281f372d77c71a77041100741d6 (patch) | |
| tree | db7e012cf1e34861da821b3d0c6fdb8e7fafdbb2 | |
| parent | a77898c74f599af64b029bf97ca82bf23c29fcd5 (diff) | |
| -rw-r--r-- | bin/rtspin.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/bin/rtspin.c b/bin/rtspin.c index 498603f..a048934 100644 --- a/bin/rtspin.c +++ b/bin/rtspin.c | |||
| @@ -612,14 +612,19 @@ int main(int argc, char** argv) | |||
| 612 | printf("rtspin/%d:%u @ %.4fms\n", gettid(), | 612 | printf("rtspin/%d:%u @ %.4fms\n", gettid(), |
| 613 | job_no, (wctime() - start) * 1000); | 613 | job_no, (wctime() - start) * 1000); |
| 614 | if (cp) { | 614 | if (cp) { |
| 615 | double deadline, current; | 615 | double deadline, current, release; |
| 616 | deadline = cp->deadline * 1e-9; | 616 | lt_t now = litmus_clock(); |
| 617 | current = monotime(); | 617 | deadline = ns2s((double) cp->deadline); |
| 618 | current = ns2s((double) now); | ||
| 619 | release = ns2s((double) cp->release); | ||
| 620 | printf("\trelease: %" PRIu64 "ns (=%.2fs)\n", | ||
| 621 | (uint64_t) cp->release, release); | ||
| 618 | printf("\tdeadline: %" PRIu64 "ns (=%.2fs)\n", | 622 | printf("\tdeadline: %" PRIu64 "ns (=%.2fs)\n", |
| 619 | (uint64_t) cp->deadline, deadline); | 623 | (uint64_t) cp->deadline, deadline); |
| 620 | printf("\tcurrent time: %.2fs, " | 624 | printf("\tcur time: %" PRIu64 "ns (=%.2fs)\n", |
| 621 | "time until deadline: %.2fms\n", | 625 | (uint64_t) now, current); |
| 622 | current, (deadline - current) * 1000); | 626 | printf("\ttime until deadline: %.2fms\n", |
| 627 | (deadline - current) * 1000); | ||
| 623 | } | 628 | } |
| 624 | if (report_interrupts && cp) { | 629 | if (report_interrupts && cp) { |
| 625 | uint64_t irq = cp->irq_count; | 630 | uint64_t irq = cp->irq_count; |
| @@ -661,12 +666,23 @@ int main(int argc, char** argv) | |||
| 661 | /* Use vanilla Linux API. This looks to the | 666 | /* Use vanilla Linux API. This looks to the |
| 662 | * active LITMUS^RT plugin like a | 667 | * active LITMUS^RT plugin like a |
| 663 | * self-suspension. */ | 668 | * self-suspension. */ |
| 669 | if (verbose) | ||
| 670 | printf("\tclock_nanosleep() until %" | ||
| 671 | PRIu64 "ns (=%.2fs)\n", | ||
| 672 | (uint64_t) next_release, | ||
| 673 | ns2s((double) next_release)); | ||
| 664 | lt_sleep_until(next_release); | 674 | lt_sleep_until(next_release); |
| 665 | next_release += period; | 675 | next_release += period; |
| 666 | } else | 676 | } else { |
| 667 | /* Use LITMUS^RT API: some plugins optimize | 677 | /* Use LITMUS^RT API: some plugins optimize |
| 668 | * this by not actually suspending the task. */ | 678 | * this by not actually suspending the task. */ |
| 679 | if (verbose && cp) | ||
| 680 | printf("\tsleep_next_period() until %" | ||
| 681 | PRIu64 "ns (=%.2fs)\n", | ||
| 682 | (uint64_t) (cp->release + period), | ||
| 683 | ns2s((double) (cp->release + period))); | ||
| 669 | sleep_next_period(); | 684 | sleep_next_period(); |
| 685 | } | ||
| 670 | } | 686 | } |
| 671 | } | 687 | } |
| 672 | 688 | ||
