tests/ust_global_all_events_basic
tests/ust_global_event_basic
tests/ust-nevents/gen-nevents
+tests/ust-nprocesses/gen-events-time
benchmark/
lttng/Makefile
tests/Makefile
tests/ust-nevents/Makefile
+ tests/ust-nprocesses/Makefile
doc/Makefile
])
-SUBDIRS = . ust-nevents
+SUBDIRS = . ust-nevents ust-nprocesses
AM_CFLAGS=-I$(top_srcdir)/include -I$(top_srcdir)/libkernelctl \
-I$(top_srcdir)/liblttngctl -g -Wall -lurcu -lurcu-cds
#### ADD TESTS HERE ####
test_suite=( test_sessions test_kernel_data_trace test_ust_data_trace
- lttng/runall.sh ust-nevents/run )
+ lttng/runall.sh ust-nevents/run ust-nprocesses/run )
#### END TESTS HERE ####
--- /dev/null
+AM_CPPFLAGS = -ldl -I. -O2
+
+noinst_PROGRAMS = gen-events-time
+gen_events_time_SOURCES = gen-events-time.c tp.c ust_gen_event.h
+gen_events_time_LDADD = -llttng-ust
+
+noinst_SCRIPTS = run
+EXTRA_DIST = run
--- /dev/null
+/*
+ * Copyright (C) - 2009 Pierre-Marc Fournier
+ * Copyright (C) - 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <arpa/inet.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#define TRACEPOINT_DEFINE
+#include "ust_gen_event.h"
+
+int main(int argc, char **argv)
+{
+ int i, netint;
+ long values[] = { 1, 2, 3 };
+ char text[10] = "test";
+ double dbl = 2.0;
+ float flt = 2222.0;
+ /* Default loop time is 60 sec since each round sleeps 1 sec */
+ unsigned int nr_iter = 60;
+
+ fclose(stdout);
+ fclose(stderr);
+ fclose(stdin);
+
+ if (argc == 2) {
+ nr_iter = atoi(argv[1]);
+ }
+
+ for (i = 0; i < nr_iter; i++) {
+ netint = htonl(i);
+ tracepoint(ust_gen_event, tptest, i, netint, values, text,
+ strlen(text), dbl, flt);
+ sleep(1);
+ }
+
+ return 0;
+}
--- /dev/null
+#!/bin/bash
+#
+# Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation; version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+TESTDIR=$(dirname $0)/..
+NR_ITER=100
+TEST_BIN_NAME="gen-events-time"
+SESSION_NAME="ust-nprocesses"
+EVENT_NAME="ust_gen_event:tptest"
+TRACE_PATH=$(mktemp -d)
+TEST_WAIT_SEC=3
+
+source $TESTDIR/utils.sh
+
+echo -e "\n-------------------------------------"
+echo -e "UST tracer - Generate $NR_ITER process"
+echo -e "---------------------------------------"
+
+# MUST set TESTDIR before calling those functions
+
+# Start test for 1000 seconds
+
+for i in `seq 1 $NR_ITER`
+do
+ ./$(dirname $0)/$TEST_BIN_NAME 1000 >/dev/null 2>&1 &
+done
+
+echo -n "Validating registered apps: "
+
+listing=$($TESTDIR/../lttng/$LTTNG_BIN list -u)
+reg_app_count=$(echo -n $listing | sed "s/$TEST_BIN_NAME/$TEST_BIN_NAME\n/g" | grep "$TEST_BIN_NAME" | wc -l)
+if [ "$reg_app_count" -ne "$NR_ITER" ]; then
+ echo -e "$reg_app_count apps listed. Expected $NR_ITER \e[1;31mFAILED\e[0m"
+else
+ echo -e "\e[1;32mOK\e[0m"
+fi
+
+create_lttng_session $SESSION_NAME $TRACE_PATH
+
+enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
+start_tracing $SESSION_NAME
+
+echo "Sleeping $TEST_WAIT_SEC seconds for tracing to start everywhere"
+sleep $TEST_WAIT_SEC
+
+stop_tracing $SESSION_NAME
+destroy_lttng_session $SESSION_NAME
+
+rm -rf $TRACE_PATH
+
+echo -e -n "Killing all spawned applications..."
+killall -q $TEST_BIN_NAME >/dev/null 2>&1 &
+echo -e "\e[1;32mOK\e[0m"
+exit 0
--- /dev/null
+/*
+ * Copyright (c) - 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (c) - 2012 David Goulet <dgoulet@efficios.com>
+ *
+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR
+ * IMPLIED. ANY USE IS AT YOUR OWN RISK.
+ *
+ * Permission is hereby granted to use or copy this program for any purpose,
+ * provided the above notices are retained on all copies. Permission to modify
+ * the code and to distribute modified code is granted, provided the above
+ * notices are retained, and a notice that the code was modified is included
+ * with the above copyright notice.
+ */
+
+#define TRACEPOINT_CREATE_PROBES
+#include "ust_gen_event.h"
--- /dev/null
+#undef TRACEPOINT_PROVIDER
+#define TRACEPOINT_PROVIDER ust_gen_event
+
+#if !defined(_TRACEPOINT_UST_GEN_EVENT_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
+#define _TRACEPOINT_UST_GEN_EVENT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+ * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
+ *
+ * Permission is hereby granted to use or copy this program
+ * for any purpose, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ */
+
+#include <lttng/tracepoint.h>
+
+TRACEPOINT_EVENT(ust_gen_event, tptest,
+ TP_ARGS(int, anint, int, netint, long *, values,
+ char *, text, size_t, textlen,
+ double, doublearg, float, floatarg),
+ TP_FIELDS(
+ ctf_integer(int, intfield, anint)
+ ctf_integer_hex(int, intfield2, anint)
+ ctf_integer(long, longfield, anint)
+ ctf_integer_network(int, netintfield, netint)
+ ctf_integer_network_hex(int, netintfieldhex, netint)
+ ctf_array(long, arrfield1, values, 3)
+ ctf_array_text(char, arrfield2, text, 10)
+ ctf_sequence(char, seqfield1, text, size_t, textlen)
+ ctf_sequence_text(char, seqfield2, text, size_t, textlen)
+ ctf_string(stringfield, text)
+ ctf_float(float, floatfield, floatarg)
+ ctf_float(double, doublefield, doublearg)
+ )
+)
+
+#endif /* _TRACEPOINT_UST_GEN_EVENT_H */
+
+#undef TRACEPOINT_INCLUDE_FILE
+#define TRACEPOINT_INCLUDE_FILE ./ust_gen_event.h
+
+/* This part must be outside ifdef protection */
+#include <lttng/tracepoint-event.h>
+
+#ifdef __cplusplus
+}
+#endif