Re: [Xenomai-core] [PATCH] in-kernel timer benchmark -v3
Jan Kiszka wrote: ...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. Applied on my own. Jan signature.asc Description: OpenPGP digital signature
Re: [Xenomai-core] [PATCH] in-kernel timer benchmark -v3
Jan Kiszka wrote: Happy New Year everyone! Hope you all survived the turn of the year without complications. ;) Nearly buried alive in patches, but this is hardly a complication. I would like to start with a new patch round. The first one is a revised and extended version of the earlier posted in-kernel timer benchmark based on a RTDM device. Changes since the first version: * revised command line argument to set the test mode * display test mode during startup * display hint on missing benchmark device * support of trace freeze on latency above specified threshold * extended benchmark device to provide ipipe-tracing functions to userspace * further minor fixes Ok, merged. I think the patch should be ready to merge now. This would also be helpful to provide a base on which Gilles can build his timer-scaling tests. BTW, we still need some RTDM abstraction for timers, but this is a different topic that will be addressed later. Btw, since -rc1 is out, I've deprecated the Adeos oldgen support for all archs (ia64 is now I-pipe based too), so that I can merge Dmitry's work later on, exclusively into the newgen codebase. So if anyone still keeps any venerable pre-Ipipe patch in some hideout of his hdd, just let it go now; I know it's heartbreaking, but Xenomai is thankless. -- Philippe. ___ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core
Re: [Xenomai-core] [PATCH] in-kernel timer benchmark -v3
...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 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); signature.asc Description: OpenPGP digital signature ___ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core
Re: [Xenomai-core] [PATCH] in-kernel timer benchmark -v3
...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 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); signature.asc Description: OpenPGP digital signature