From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [PATCH] in-kernel timer benchmark -v3
Date: Mon, 02 Jan 2006 20:20:14 +0100 [thread overview]
Message-ID: <43B97CEE.4030800@domain.hid> (raw)
In-Reply-To: <43B970BA.3080707@domain.hid>
[-- Attachment #1.1: Type: text/plain, Size: 155 bytes --]
...as a follow-up, here is a patch to fix some bugs in the new trace
triggering and to improve (from my POV) the output of this tool in some
regards.
Jan
[-- Attachment #1.2: latency.patch --]
[-- Type: text/x-patch, Size: 3413 bytes --]
Index: src/testsuite/latency/latency.c
===================================================================
--- src/testsuite/latency/latency.c (Revision 345)
+++ src/testsuite/latency/latency.c (Arbeitskopie)
@@ -39,6 +39,11 @@
#define TIMER_HANDLER 2
int test_mode = USER_TASK;
+const char *test_mode_names[] = {
+ "periodic user-mode task",
+ "in-kernel periodic task",
+ "in-kernel timer handler"
+};
time_t test_start, test_end; /* report test duration */
int test_loops = 0; /* outer loop count */
@@ -78,8 +83,7 @@
return;
}
- if (freeze_threshold > 0)
- freeze_threshold = rt_timer_ns2tsc(freeze_threshold*1000);
+ freeze_threshold = rt_timer_ns2tsc(freeze_threshold);
nsamples = ONE_BILLION / period_ns;
period_tsc = rt_timer_ns2tsc(period_ns);
@@ -122,11 +126,15 @@
if (dt < minj) minj = dt;
sumj += dt;
- if ((freeze_threshold > 0) && (dt > freeze_threshold))
- rt_dev_ioctl(benchdev, RTBNCH_RTIOC_FREEZE_TRACE, freeze_threshold);
+ if (!(finished || warmup))
+ {
+ if ((freeze_threshold > 0) && (dt > freeze_threshold))
+ rt_dev_ioctl(benchdev, RTBNCH_RTIOC_FREEZE_TRACE,
+ freeze_threshold);
- if (!(finished || warmup) && (do_histogram || do_stats))
- add_histogram(histogram_avg, dt);
+ if (do_histogram || do_stats)
+ add_histogram(histogram_avg, dt);
+ }
}
if(!warmup)
@@ -173,8 +181,6 @@
return;
}
- printf("== Test mode: periodic userspace task\n");
-
} else {
struct rtbnch_timerconfig config;
@@ -196,13 +202,13 @@
fprintf(stderr,"latency: failed to start in-kernel timer benchmark, code %d\n",err);
return;
}
-
- printf("== Test mode: in-kernel %s\n",
- (test_mode == TIMER_HANDLER) ? "timer handler" : "periodic task");
}
time(&start);
+ if (WARMUP_TIME)
+ printf("warming up...\n");
+
if (quiet)
fprintf(stderr, "running quietly for %d seconds\n", test_duration);
@@ -256,8 +262,9 @@
time_t now, dt;
time(&now);
dt = now - start - WARMUP_TIME;
- printf("RTT| %.2ld:%.2ld:%.2ld\n",
- dt / 3600,(dt / 60) % 60,dt % 60);
+ printf("RTT| %.2ld:%.2ld:%.2ld (%s, %Ld us period)\n",
+ dt / 3600,(dt / 60) % 60,dt % 60,
+ test_mode_names[test_mode],period_ns / 1000);
printf("RTH|%12s|%12s|%12s|%8s|%12s|%12s\n",
"-----lat min","-----lat avg","-----lat max","-overrun",
"----lat best","---lat worst");
@@ -469,7 +476,7 @@
case 'f':
- freeze_threshold = atoi(optarg);
+ freeze_threshold = atoi(optarg)*1000;
break;
default:
@@ -520,7 +527,10 @@
setlinebuf(stdout);
- printf("== Sampling period: %Ld us\n",period_ns / 1000);
+ printf("== Sampling period: %Ld us\n"
+ "== Test mode: %s\n",
+ period_ns / 1000,
+ test_mode_names[test_mode]);
mlockall(MCL_CURRENT|MCL_FUTURE);
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]
next prev parent reply other threads:[~2006-01-02 19:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-02 13:14 [Xenomai-core] [PATCH] in-kernel timer benchmark -v3 Jan Kiszka
2006-01-02 18:28 ` Philippe Gerum
2006-01-02 19:20 ` Jan Kiszka [this message]
2006-01-03 14:43 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43B97CEE.4030800@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=rpm@xenomai.org \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.