From a62e3ec777dc36c8a23c376f90c8e68dceeeb625 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 5 Apr 2012 15:46:52 -0400 Subject: [PATCH 1/1] Add wildcard test to UST Rename test file and add two event wildcard type to the test. Signed-off-by: David Goulet --- .gitignore | 2 +- tests/ust/Makefile.am | 4 ++-- tests/ust/run-ust-global-tests.sh | 2 +- ...ts_basic.c => ust_global_event_wildcard.c} | 21 +++++++++++++++++-- 4 files changed, 23 insertions(+), 6 deletions(-) rename tests/ust/{ust_global_all_events_basic.c => ust_global_event_wildcard.c} (84%) diff --git a/.gitignore b/.gitignore index b63da96a3..8a0d08796 100644 --- a/.gitignore +++ b/.gitignore @@ -41,7 +41,7 @@ test_kernel_data_trace test_ust_data_trace kernel_all_events_basic kernel_event_basic -ust_global_all_events_basic +ust_global_event_wildcard ust_global_event_basic gen-nevents gen-events-time diff --git a/tests/ust/Makefile.am b/tests/ust/Makefile.am index 9eda72c5d..7c7bcba41 100644 --- a/tests/ust/Makefile.am +++ b/tests/ust/Makefile.am @@ -6,13 +6,13 @@ AM_LDFLAGS = -lurcu -lurcu-cds EXTRA_DIST = runall.sh utils.sh run-ust-global-tests.sh -noinst_PROGRAMS = ust_global_event_basic ust_global_all_events_basic +noinst_PROGRAMS = ust_global_event_basic ust_global_event_wildcard UTILS=utils.h LIBLTTNG=$(top_srcdir)/src/lib/lttng-ctl/lttng-ctl.c \ $(top_srcdir)/src/common/sessiond-comm/sessiond-comm.c -ust_global_all_events_basic_SOURCES = ust_global_all_events_basic.c $(UTILS) $(LIBLTTNG) +ust_global_event_wildcard_SOURCES = ust_global_event_wildcard.c $(UTILS) $(LIBLTTNG) ust_global_event_basic_SOURCES = ust_global_event_basic.c $(UTILS) $(LIBLTTNG) endif diff --git a/tests/ust/run-ust-global-tests.sh b/tests/ust/run-ust-global-tests.sh index 96c1f9e54..969e21733 100755 --- a/tests/ust/run-ust-global-tests.sh +++ b/tests/ust/run-ust-global-tests.sh @@ -7,7 +7,7 @@ TESTDIR=$CURDIR/.. source $TESTDIR/utils.sh tmpdir=`mktemp -d` -tests=( $CURDIR/ust_global_event_basic $CURDIR/ust_global_all_events_basic ) +tests=( $CURDIR/ust_global_event_basic $CURDIR/ust_global_event_wildcard ) exit_code=0 function start_tests () diff --git a/tests/ust/ust_global_all_events_basic.c b/tests/ust/ust_global_event_wildcard.c similarity index 84% rename from tests/ust/ust_global_all_events_basic.c rename to tests/ust/ust_global_event_wildcard.c index 3ae786e8c..1e4420fa5 100644 --- a/tests/ust/ust_global_all_events_basic.c +++ b/tests/ust/ust_global_event_wildcard.c @@ -35,16 +35,26 @@ int main(int argc, char **argv) { struct lttng_handle *handle = NULL; struct lttng_domain dom; - struct lttng_event event; + struct lttng_event event, ev2; char *channel_name = "channel0"; + char *channel_name2 = "channel2"; char *session_name = "ust_global_all_events_basic"; int ret = 0; memset(&dom, 0, sizeof(dom)); memset(&event, 0, sizeof(event)); + memset(&ev2, 0, sizeof(ev2)); + dom.type = LTTNG_DOMAIN_UST; + event.type = LTTNG_EVENT_TRACEPOINT; event.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL; + strcpy(event.name, "*"); + + ev2.type = LTTNG_EVENT_TRACEPOINT; + ev2.loglevel_type = LTTNG_EVENT_LOGLEVEL_RANGE; + ev2.loglevel = LTTNG_LOGLEVEL_NOTICE; + strcpy(ev2.name, "abc*"); printf("\nTesting tracing all UST events:\n"); printf("-----------\n"); @@ -68,13 +78,20 @@ int main(int argc, char **argv) } PRINT_OK(); - printf("Enabling all UST events: "); + printf("Enabling '*' UST events: "); if ((ret = lttng_enable_event(handle, &event, channel_name)) < 0) { printf("error enabling event: %s\n", lttng_strerror(ret)); goto enable_fail; } PRINT_OK(); + printf("Enabling 'abc*' UST events: "); + if ((ret = lttng_enable_event(handle, &ev2, channel_name2)) < 0) { + printf("error enabling event: %s\n", lttng_strerror(ret)); + goto enable_fail; + } + PRINT_OK(); + printf("Start tracing: "); if ((ret = lttng_start_tracing(session_name)) < 0) { printf("error starting tracing: %s\n", lttng_strerror(ret)); -- 2.34.1