From: compudj Date: Tue, 13 Mar 2007 01:01:46 +0000 (+0000) Subject: add compact test X-Git-Tag: v0.12.20~1072 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c9a9c80f3f62d7f187f02c3eafe8bb92aa2cf949;p=lttv.git add compact test git-svn-id: http://ltt.polymtl.ca/svn@2417 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/tests/kernel/Makefile b/tests/kernel/Makefile index 1d947906..95549140 100644 --- a/tests/kernel/Makefile +++ b/tests/kernel/Makefile @@ -3,6 +3,7 @@ ifneq ($(CONFIG_LTT),) obj-m += ltt-facility-loader-tests.o # obj-m += test-time-probe.o obj-m += test-time-probe2.o + obj-m += test-compact.o # obj-m += test-instrument-size-small.o # obj-m += test-instrument-size-med.o # obj-m += test-instrument-size-big.o diff --git a/tests/kernel/test-compact.c b/tests/kernel/test-compact.c new file mode 100644 index 00000000..b348e91c --- /dev/null +++ b/tests/kernel/test-compact.c @@ -0,0 +1,60 @@ +/* test-time-probe.c + * + * Test time spent in a LTTng instrumentation probe. + */ + + +#define CONFIG_LTT_FACILITY_COMPACT +#include +#include "ltt-facility-compact.h" + +#include +#include +#include + + +/* Event logged : 4 bytes. Let's use 1MB of + * buffers. 1MB / 4bytes = 262144 (plus heartbeats). So, if we write 20000 + * event, we should not lose events. Check event lost count after tests. */ + +#define NR_LOOPS 20000 + +static int ltt_test_init(void) +{ + unsigned int i; + cycles_t time1, time2, time; + cycles_t tot_time = 0; + unsigned long flags; + printk(KERN_ALERT "test init\n"); + + local_irq_save(flags); + time1 = get_cycles(); + for(i=0; i