[Xenomai-git] Philippe Gerum : cobalt/testsuite: fixup for 32bit emulation
Module: xenomai-3 Branch: master Commit: 3759aa162c5359fc2c9e0d07590b157186ebe90f URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=3759aa162c5359fc2c9e0d07590b157186ebe90f Author: Philippe Gerum Date: Wed Oct 22 10:53:36 2014 +0200 cobalt/testsuite: fixup for 32bit emulation --- demo/alchemy/altency.c | 44 ++-- include/rtdm/uapi/autotune.h|2 + include/rtdm/uapi/testing.h | 78 ++- kernel/drivers/testing/switchtest.c |2 +- kernel/drivers/testing/timerbench.c | 28 ++--- testsuite/latency/latency.c | 53 testsuite/switchtest/switchtest.c |6 +-- 7 files changed, 90 insertions(+), 123 deletions(-) diff --git a/demo/alchemy/altency.c b/demo/alchemy/altency.c index ef1a694..2e4d093 100644 --- a/demo/alchemy/altency.c +++ b/demo/alchemy/altency.c @@ -25,9 +25,9 @@ RT_SEM display_sem; #define TEN_MILLIONS1000 unsigned max_relaxed; -long minjitter, maxjitter, avgjitter; -long gminjitter = TEN_MILLIONS, gmaxjitter = -TEN_MILLIONS, goverrun = 0; -long long gavgjitter = 0; +int32_t minjitter, maxjitter, avgjitter; +int32_t gminjitter = TEN_MILLIONS, gmaxjitter = -TEN_MILLIONS, goverrun = 0; +int64_t gavgjitter = 0; long long period_ns = 0; int test_duration = 0; /* sec of testing, via -T , 0 is inf */ @@ -57,7 +57,7 @@ int test_loops = 0; /* outer loop count */ #define WARMUP_TIME 1 #define HISTOGRAM_CELLS 300 int histogram_size = HISTOGRAM_CELLS; -long *histogram_avg = NULL, *histogram_max = NULL, *histogram_min = NULL; +int32_t *histogram_avg = NULL, *histogram_max = NULL, *histogram_min = NULL; char *do_gnuplot = NULL; int do_histogram = 0, do_stats = 0, finished = 0; @@ -65,10 +65,10 @@ int bucketsize = 1000; /* default = 1000ns, -B to override */ #define need_histo() (do_histogram || do_stats || do_gnuplot) -static inline void add_histogram(long *histogram, long addval) +static inline void add_histogram(int32_t *histogram, int32_t addval) { /* bucketsize steps */ - long inabs = (addval >= 0 ? addval : -addval) / bucketsize; + int inabs = (addval >= 0 ? addval : -addval) / bucketsize; histogram[inabs < histogram_size ? inabs : histogram_size - 1]++; } @@ -77,7 +77,7 @@ static void latency(void *cookie) RTIME expected_ns, start_ns, fault_threshold; unsigned int old_relaxed = 0, new_relaxed; int ret, count, nsamples, warmup = 1; - long minj, maxj, dt, overrun, sumj; + int32_t minj, maxj, dt, overrun, sumj; unsigned long ov; fault_threshold = CONFIG_XENO_DEFAULT_PERIOD; @@ -100,7 +100,7 @@ static void latency(void *cookie) for (count = sumj = 0; count < nsamples; count++) { ret = rt_task_wait_period(&ov); - dt = (long)(rt_timer_read() - expected_ns); + dt = (int32_t)(rt_timer_read() - expected_ns); new_relaxed = sampling_relaxed; if (dt > maxj) { if (new_relaxed != old_relaxed @@ -213,7 +213,7 @@ static void display(void *cookie) test_duration); for (;;) { - long minj, gminj, maxj, gmaxj, avgj; + int32_t minj, gminj, maxj, gmaxj, avgj; if (test_mode == USER_TASK) { ret = rt_sem_p(&display_sem, TM_INFINITE); @@ -268,7 +268,7 @@ static void display(void *cookie) "lat max", "-overrun", "---msw", "---lat best", "--lat worst"); } - printf("RTD|%11.3f|%11.3f|%11.3f|%8ld|%6u|%11.3f|%11.3f\n", + printf("RTD|%11.3f|%11.3f|%11.3f|%8d|%6u|%11.3f|%11.3f\n", (double)minj / 1000, (double)avgj / 1000, (double)maxj / 1000, @@ -279,7 +279,7 @@ static void display(void *cookie) } } -static double dump_histogram(long *histogram, char *kind) +static double dump_histogram(int32_t *histogram, char *kind) { int n, total_hits = 0; double avg = 0; /* used to sum hits 1st */ @@ -288,13 +288,13 @@ static double dump_histogram(long *histogram, char *kind) printf("---|--param|range-|--samples\n"); for (n = 0; n < histogram_size; n++) { - long hits = histogram[n]; + int32_t hits = histogram[n]; if (hits) { total_hits += hits; avg += n * hits; if (do_histogram) - printf("HSD|%s| %3d -%3d | %8ld\n", + printf("HSD|%s| %3d -%3d | %8d\n", kind, n, n + 1, h
[Xenomai-git] Philippe Gerum : cobalt/testsuite: fixup for 32bit emulation
Module: xenomai-3 Branch: next Commit: 3759aa162c5359fc2c9e0d07590b157186ebe90f URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=3759aa162c5359fc2c9e0d07590b157186ebe90f Author: Philippe Gerum Date: Wed Oct 22 10:53:36 2014 +0200 cobalt/testsuite: fixup for 32bit emulation --- demo/alchemy/altency.c | 44 ++-- include/rtdm/uapi/autotune.h|2 + include/rtdm/uapi/testing.h | 78 ++- kernel/drivers/testing/switchtest.c |2 +- kernel/drivers/testing/timerbench.c | 28 ++--- testsuite/latency/latency.c | 53 testsuite/switchtest/switchtest.c |6 +-- 7 files changed, 90 insertions(+), 123 deletions(-) diff --git a/demo/alchemy/altency.c b/demo/alchemy/altency.c index ef1a694..2e4d093 100644 --- a/demo/alchemy/altency.c +++ b/demo/alchemy/altency.c @@ -25,9 +25,9 @@ RT_SEM display_sem; #define TEN_MILLIONS1000 unsigned max_relaxed; -long minjitter, maxjitter, avgjitter; -long gminjitter = TEN_MILLIONS, gmaxjitter = -TEN_MILLIONS, goverrun = 0; -long long gavgjitter = 0; +int32_t minjitter, maxjitter, avgjitter; +int32_t gminjitter = TEN_MILLIONS, gmaxjitter = -TEN_MILLIONS, goverrun = 0; +int64_t gavgjitter = 0; long long period_ns = 0; int test_duration = 0; /* sec of testing, via -T , 0 is inf */ @@ -57,7 +57,7 @@ int test_loops = 0; /* outer loop count */ #define WARMUP_TIME 1 #define HISTOGRAM_CELLS 300 int histogram_size = HISTOGRAM_CELLS; -long *histogram_avg = NULL, *histogram_max = NULL, *histogram_min = NULL; +int32_t *histogram_avg = NULL, *histogram_max = NULL, *histogram_min = NULL; char *do_gnuplot = NULL; int do_histogram = 0, do_stats = 0, finished = 0; @@ -65,10 +65,10 @@ int bucketsize = 1000; /* default = 1000ns, -B to override */ #define need_histo() (do_histogram || do_stats || do_gnuplot) -static inline void add_histogram(long *histogram, long addval) +static inline void add_histogram(int32_t *histogram, int32_t addval) { /* bucketsize steps */ - long inabs = (addval >= 0 ? addval : -addval) / bucketsize; + int inabs = (addval >= 0 ? addval : -addval) / bucketsize; histogram[inabs < histogram_size ? inabs : histogram_size - 1]++; } @@ -77,7 +77,7 @@ static void latency(void *cookie) RTIME expected_ns, start_ns, fault_threshold; unsigned int old_relaxed = 0, new_relaxed; int ret, count, nsamples, warmup = 1; - long minj, maxj, dt, overrun, sumj; + int32_t minj, maxj, dt, overrun, sumj; unsigned long ov; fault_threshold = CONFIG_XENO_DEFAULT_PERIOD; @@ -100,7 +100,7 @@ static void latency(void *cookie) for (count = sumj = 0; count < nsamples; count++) { ret = rt_task_wait_period(&ov); - dt = (long)(rt_timer_read() - expected_ns); + dt = (int32_t)(rt_timer_read() - expected_ns); new_relaxed = sampling_relaxed; if (dt > maxj) { if (new_relaxed != old_relaxed @@ -213,7 +213,7 @@ static void display(void *cookie) test_duration); for (;;) { - long minj, gminj, maxj, gmaxj, avgj; + int32_t minj, gminj, maxj, gmaxj, avgj; if (test_mode == USER_TASK) { ret = rt_sem_p(&display_sem, TM_INFINITE); @@ -268,7 +268,7 @@ static void display(void *cookie) "lat max", "-overrun", "---msw", "---lat best", "--lat worst"); } - printf("RTD|%11.3f|%11.3f|%11.3f|%8ld|%6u|%11.3f|%11.3f\n", + printf("RTD|%11.3f|%11.3f|%11.3f|%8d|%6u|%11.3f|%11.3f\n", (double)minj / 1000, (double)avgj / 1000, (double)maxj / 1000, @@ -279,7 +279,7 @@ static void display(void *cookie) } } -static double dump_histogram(long *histogram, char *kind) +static double dump_histogram(int32_t *histogram, char *kind) { int n, total_hits = 0; double avg = 0; /* used to sum hits 1st */ @@ -288,13 +288,13 @@ static double dump_histogram(long *histogram, char *kind) printf("---|--param|range-|--samples\n"); for (n = 0; n < histogram_size; n++) { - long hits = histogram[n]; + int32_t hits = histogram[n]; if (hits) { total_hits += hits; avg += n * hits; if (do_histogram) - printf("HSD|%s| %3d -%3d | %8ld\n", + printf("HSD|%s| %3d -%3d | %8d\n", kind, n, n + 1, hit
[Xenomai-git] Philippe Gerum : cobalt/testsuite: fixup for 32bit emulation
Module: xenomai-3 Branch: next Commit: 7cff5969a7952d75f7b10f35cccaf5f969eb6f8c URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=7cff5969a7952d75f7b10f35cccaf5f969eb6f8c Author: Philippe Gerum Date: Wed Oct 22 10:53:36 2014 +0200 cobalt/testsuite: fixup for 32bit emulation --- demo/alchemy/altency.c | 44 ++-- include/rtdm/uapi/autotune.h|2 + include/rtdm/uapi/testing.h | 78 ++- kernel/drivers/testing/switchtest.c |2 +- kernel/drivers/testing/timerbench.c | 28 ++--- testsuite/latency/latency.c | 53 testsuite/switchtest/switchtest.c |6 +-- 7 files changed, 90 insertions(+), 123 deletions(-) diff --git a/demo/alchemy/altency.c b/demo/alchemy/altency.c index ef1a694..2e4d093 100644 --- a/demo/alchemy/altency.c +++ b/demo/alchemy/altency.c @@ -25,9 +25,9 @@ RT_SEM display_sem; #define TEN_MILLIONS1000 unsigned max_relaxed; -long minjitter, maxjitter, avgjitter; -long gminjitter = TEN_MILLIONS, gmaxjitter = -TEN_MILLIONS, goverrun = 0; -long long gavgjitter = 0; +int32_t minjitter, maxjitter, avgjitter; +int32_t gminjitter = TEN_MILLIONS, gmaxjitter = -TEN_MILLIONS, goverrun = 0; +int64_t gavgjitter = 0; long long period_ns = 0; int test_duration = 0; /* sec of testing, via -T , 0 is inf */ @@ -57,7 +57,7 @@ int test_loops = 0; /* outer loop count */ #define WARMUP_TIME 1 #define HISTOGRAM_CELLS 300 int histogram_size = HISTOGRAM_CELLS; -long *histogram_avg = NULL, *histogram_max = NULL, *histogram_min = NULL; +int32_t *histogram_avg = NULL, *histogram_max = NULL, *histogram_min = NULL; char *do_gnuplot = NULL; int do_histogram = 0, do_stats = 0, finished = 0; @@ -65,10 +65,10 @@ int bucketsize = 1000; /* default = 1000ns, -B to override */ #define need_histo() (do_histogram || do_stats || do_gnuplot) -static inline void add_histogram(long *histogram, long addval) +static inline void add_histogram(int32_t *histogram, int32_t addval) { /* bucketsize steps */ - long inabs = (addval >= 0 ? addval : -addval) / bucketsize; + int inabs = (addval >= 0 ? addval : -addval) / bucketsize; histogram[inabs < histogram_size ? inabs : histogram_size - 1]++; } @@ -77,7 +77,7 @@ static void latency(void *cookie) RTIME expected_ns, start_ns, fault_threshold; unsigned int old_relaxed = 0, new_relaxed; int ret, count, nsamples, warmup = 1; - long minj, maxj, dt, overrun, sumj; + int32_t minj, maxj, dt, overrun, sumj; unsigned long ov; fault_threshold = CONFIG_XENO_DEFAULT_PERIOD; @@ -100,7 +100,7 @@ static void latency(void *cookie) for (count = sumj = 0; count < nsamples; count++) { ret = rt_task_wait_period(&ov); - dt = (long)(rt_timer_read() - expected_ns); + dt = (int32_t)(rt_timer_read() - expected_ns); new_relaxed = sampling_relaxed; if (dt > maxj) { if (new_relaxed != old_relaxed @@ -213,7 +213,7 @@ static void display(void *cookie) test_duration); for (;;) { - long minj, gminj, maxj, gmaxj, avgj; + int32_t minj, gminj, maxj, gmaxj, avgj; if (test_mode == USER_TASK) { ret = rt_sem_p(&display_sem, TM_INFINITE); @@ -268,7 +268,7 @@ static void display(void *cookie) "lat max", "-overrun", "---msw", "---lat best", "--lat worst"); } - printf("RTD|%11.3f|%11.3f|%11.3f|%8ld|%6u|%11.3f|%11.3f\n", + printf("RTD|%11.3f|%11.3f|%11.3f|%8d|%6u|%11.3f|%11.3f\n", (double)minj / 1000, (double)avgj / 1000, (double)maxj / 1000, @@ -279,7 +279,7 @@ static void display(void *cookie) } } -static double dump_histogram(long *histogram, char *kind) +static double dump_histogram(int32_t *histogram, char *kind) { int n, total_hits = 0; double avg = 0; /* used to sum hits 1st */ @@ -288,13 +288,13 @@ static double dump_histogram(long *histogram, char *kind) printf("---|--param|range-|--samples\n"); for (n = 0; n < histogram_size; n++) { - long hits = histogram[n]; + int32_t hits = histogram[n]; if (hits) { total_hits += hits; avg += n * hits; if (do_histogram) - printf("HSD|%s| %3d -%3d | %8ld\n", + printf("HSD|%s| %3d -%3d | %8d\n", kind, n, n + 1, hit
[Xenomai-git] Philippe Gerum : cobalt/testsuite: fixup for 32bit emulation
Module: xenomai-3 Branch: next Commit: 8b793f7dab4b9b0d046755d76c4027794c8ac54e URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=8b793f7dab4b9b0d046755d76c4027794c8ac54e Author: Philippe Gerum Date: Wed Oct 22 10:53:36 2014 +0200 cobalt/testsuite: fixup for 32bit emulation --- demo/alchemy/altency.c | 44 ++-- include/rtdm/uapi/autotune.h|2 + include/rtdm/uapi/testing.h | 78 ++- kernel/drivers/testing/switchtest.c |2 +- kernel/drivers/testing/timerbench.c | 28 ++--- testsuite/latency/latency.c | 53 testsuite/switchtest/switchtest.c |6 +-- 7 files changed, 90 insertions(+), 123 deletions(-) diff --git a/demo/alchemy/altency.c b/demo/alchemy/altency.c index ef1a694..2e4d093 100644 --- a/demo/alchemy/altency.c +++ b/demo/alchemy/altency.c @@ -25,9 +25,9 @@ RT_SEM display_sem; #define TEN_MILLIONS1000 unsigned max_relaxed; -long minjitter, maxjitter, avgjitter; -long gminjitter = TEN_MILLIONS, gmaxjitter = -TEN_MILLIONS, goverrun = 0; -long long gavgjitter = 0; +int32_t minjitter, maxjitter, avgjitter; +int32_t gminjitter = TEN_MILLIONS, gmaxjitter = -TEN_MILLIONS, goverrun = 0; +int64_t gavgjitter = 0; long long period_ns = 0; int test_duration = 0; /* sec of testing, via -T , 0 is inf */ @@ -57,7 +57,7 @@ int test_loops = 0; /* outer loop count */ #define WARMUP_TIME 1 #define HISTOGRAM_CELLS 300 int histogram_size = HISTOGRAM_CELLS; -long *histogram_avg = NULL, *histogram_max = NULL, *histogram_min = NULL; +int32_t *histogram_avg = NULL, *histogram_max = NULL, *histogram_min = NULL; char *do_gnuplot = NULL; int do_histogram = 0, do_stats = 0, finished = 0; @@ -65,10 +65,10 @@ int bucketsize = 1000; /* default = 1000ns, -B to override */ #define need_histo() (do_histogram || do_stats || do_gnuplot) -static inline void add_histogram(long *histogram, long addval) +static inline void add_histogram(int32_t *histogram, int32_t addval) { /* bucketsize steps */ - long inabs = (addval >= 0 ? addval : -addval) / bucketsize; + int inabs = (addval >= 0 ? addval : -addval) / bucketsize; histogram[inabs < histogram_size ? inabs : histogram_size - 1]++; } @@ -77,7 +77,7 @@ static void latency(void *cookie) RTIME expected_ns, start_ns, fault_threshold; unsigned int old_relaxed = 0, new_relaxed; int ret, count, nsamples, warmup = 1; - long minj, maxj, dt, overrun, sumj; + int32_t minj, maxj, dt, overrun, sumj; unsigned long ov; fault_threshold = CONFIG_XENO_DEFAULT_PERIOD; @@ -100,7 +100,7 @@ static void latency(void *cookie) for (count = sumj = 0; count < nsamples; count++) { ret = rt_task_wait_period(&ov); - dt = (long)(rt_timer_read() - expected_ns); + dt = (int32_t)(rt_timer_read() - expected_ns); new_relaxed = sampling_relaxed; if (dt > maxj) { if (new_relaxed != old_relaxed @@ -213,7 +213,7 @@ static void display(void *cookie) test_duration); for (;;) { - long minj, gminj, maxj, gmaxj, avgj; + int32_t minj, gminj, maxj, gmaxj, avgj; if (test_mode == USER_TASK) { ret = rt_sem_p(&display_sem, TM_INFINITE); @@ -268,7 +268,7 @@ static void display(void *cookie) "lat max", "-overrun", "---msw", "---lat best", "--lat worst"); } - printf("RTD|%11.3f|%11.3f|%11.3f|%8ld|%6u|%11.3f|%11.3f\n", + printf("RTD|%11.3f|%11.3f|%11.3f|%8d|%6u|%11.3f|%11.3f\n", (double)minj / 1000, (double)avgj / 1000, (double)maxj / 1000, @@ -279,7 +279,7 @@ static void display(void *cookie) } } -static double dump_histogram(long *histogram, char *kind) +static double dump_histogram(int32_t *histogram, char *kind) { int n, total_hits = 0; double avg = 0; /* used to sum hits 1st */ @@ -288,13 +288,13 @@ static double dump_histogram(long *histogram, char *kind) printf("---|--param|range-|--samples\n"); for (n = 0; n < histogram_size; n++) { - long hits = histogram[n]; + int32_t hits = histogram[n]; if (hits) { total_hits += hits; avg += n * hits; if (do_histogram) - printf("HSD|%s| %3d -%3d | %8ld\n", + printf("HSD|%s| %3d -%3d | %8d\n", kind, n, n + 1, hit