From 428c3fb5c8120a229b1220014dbe7dd2f2294f39 Mon Sep 17 00:00:00 2001 From: compudj Date: Wed, 29 Mar 2006 20:20:11 +0000 Subject: [PATCH] instrum size git-svn-id: http://ltt.polymtl.ca/svn@1735 04897980-b3bd-0310-b5e0-8ef037075253 --- tests/kernel/Makefile | 5 ++++- tests/kernel/test-instrument-size-big.c | 21 +++++++++++++++++++ tests/kernel/test-instrument-size-big.mod.c | 16 ++++++++++++++ tests/kernel/test-instrument-size-med.c | 21 +++++++++++++++++++ tests/kernel/test-instrument-size-med.mod.c | 16 ++++++++++++++ tests/kernel/test-instrument-size-small.c | 19 +++++++++++++++++ tests/kernel/test-instrument-size-small.mod.c | 16 ++++++++++++++ tests/kernel/test-time-probe.mod.c | 20 ++++++++++++++++++ 8 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 tests/kernel/test-instrument-size-big.c create mode 100644 tests/kernel/test-instrument-size-big.mod.c create mode 100644 tests/kernel/test-instrument-size-med.c create mode 100644 tests/kernel/test-instrument-size-med.mod.c create mode 100644 tests/kernel/test-instrument-size-small.c create mode 100644 tests/kernel/test-instrument-size-small.mod.c create mode 100644 tests/kernel/test-time-probe.mod.c diff --git a/tests/kernel/Makefile b/tests/kernel/Makefile index 89428311..a2f40d35 100644 --- a/tests/kernel/Makefile +++ b/tests/kernel/Makefile @@ -2,7 +2,10 @@ ifneq ($(KERNELRELEASE),) ifneq ($(CONFIG_LTT),) obj-m += ltt-facility-loader-tests.o obj-m += test-time-probe.o - #test-l1-hit-probe.o test-instrument-size-small.o test-instrument-size-med.o test-instrument-size-big.o + obj-m += test-instrument-size-small.o + obj-m += test-instrument-size-med.o + obj-m += test-instrument-size-big.o + #test-l1-hit-probe.o endif else diff --git a/tests/kernel/test-instrument-size-big.c b/tests/kernel/test-instrument-size-big.c new file mode 100644 index 00000000..56d88885 --- /dev/null +++ b/tests/kernel/test-instrument-size-big.c @@ -0,0 +1,21 @@ +/* test-time-probe.c + * + * size of instrumented object. + */ + + +#define CONFIG_LTT_FACILITY_TESTS +#include "ltt-facility-tests.h" + +#include +#include +#include + +void ltt_test_init(void) +{ + struct lttng_tests_write_struct_data2 test_str; + + trace_tests_write_struct(5, &test_str); + return; +} + diff --git a/tests/kernel/test-instrument-size-big.mod.c b/tests/kernel/test-instrument-size-big.mod.c new file mode 100644 index 00000000..9159fdfc --- /dev/null +++ b/tests/kernel/test-instrument-size-big.mod.c @@ -0,0 +1,16 @@ +#include +#include +#include + +MODULE_INFO(vermagic, VERMAGIC_STRING); + +struct module __this_module +__attribute__((section(".gnu.linkonce.this_module"))) = { + .name = KBUILD_MODNAME, +}; + +static const char __module_depends[] +__attribute_used__ +__attribute__((section(".modinfo"))) = +"depends=ltt-facility-loader-tests"; + diff --git a/tests/kernel/test-instrument-size-med.c b/tests/kernel/test-instrument-size-med.c new file mode 100644 index 00000000..5251966d --- /dev/null +++ b/tests/kernel/test-instrument-size-med.c @@ -0,0 +1,21 @@ +/* test-time-probe.c + * + * size of instrumented object. + */ + + +#define CONFIG_LTT_FACILITY_TESTS +#include "ltt-facility-tests.h" + +#include +#include +#include + +void ltt_test_init(void) +{ + char mystring; + + trace_tests_write_string(&mystring); + return; +} + diff --git a/tests/kernel/test-instrument-size-med.mod.c b/tests/kernel/test-instrument-size-med.mod.c new file mode 100644 index 00000000..9159fdfc --- /dev/null +++ b/tests/kernel/test-instrument-size-med.mod.c @@ -0,0 +1,16 @@ +#include +#include +#include + +MODULE_INFO(vermagic, VERMAGIC_STRING); + +struct module __this_module +__attribute__((section(".gnu.linkonce.this_module"))) = { + .name = KBUILD_MODNAME, +}; + +static const char __module_depends[] +__attribute_used__ +__attribute__((section(".modinfo"))) = +"depends=ltt-facility-loader-tests"; + diff --git a/tests/kernel/test-instrument-size-small.c b/tests/kernel/test-instrument-size-small.c new file mode 100644 index 00000000..7e802e72 --- /dev/null +++ b/tests/kernel/test-instrument-size-small.c @@ -0,0 +1,19 @@ +/* test-time-probe.c + * + * size of instrumented object. + */ + + +#define CONFIG_LTT_FACILITY_TESTS +#include "ltt-facility-tests.h" + +#include +#include +#include + +void ltt_test_init(void) +{ + trace_tests_write_4bytes(5000); + return; +} + diff --git a/tests/kernel/test-instrument-size-small.mod.c b/tests/kernel/test-instrument-size-small.mod.c new file mode 100644 index 00000000..9159fdfc --- /dev/null +++ b/tests/kernel/test-instrument-size-small.mod.c @@ -0,0 +1,16 @@ +#include +#include +#include + +MODULE_INFO(vermagic, VERMAGIC_STRING); + +struct module __this_module +__attribute__((section(".gnu.linkonce.this_module"))) = { + .name = KBUILD_MODNAME, +}; + +static const char __module_depends[] +__attribute_used__ +__attribute__((section(".modinfo"))) = +"depends=ltt-facility-loader-tests"; + diff --git a/tests/kernel/test-time-probe.mod.c b/tests/kernel/test-time-probe.mod.c new file mode 100644 index 00000000..1202190e --- /dev/null +++ b/tests/kernel/test-time-probe.mod.c @@ -0,0 +1,20 @@ +#include +#include +#include + +MODULE_INFO(vermagic, VERMAGIC_STRING); + +struct module __this_module +__attribute__((section(".gnu.linkonce.this_module"))) = { + .name = KBUILD_MODNAME, + .init = init_module, +#ifdef CONFIG_MODULE_UNLOAD + .exit = cleanup_module, +#endif +}; + +static const char __module_depends[] +__attribute_used__ +__attribute__((section(".modinfo"))) = +"depends=ltt-facility-loader-tests"; + -- 2.34.1