X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Fregister_test%2Fregister_test.c;fp=tests%2Fregister_test%2Fregister_test.c;h=8b65ffbb0003daae74a1d70c9d494cb2f1b4bcf3;hb=a5f09c2c8efcc5fc047178bef0acb73552cdf390;hp=0000000000000000000000000000000000000000;hpb=9dec086e052cf7f583a3afaa3aab48a6de8d38ac;p=ust.git diff --git a/tests/register_test/register_test.c b/tests/register_test/register_test.c new file mode 100644 index 0000000..8b65ffb --- /dev/null +++ b/tests/register_test/register_test.c @@ -0,0 +1,97 @@ +/* Copyright (C) 2010 Nils Carlson + * + * 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; either + * version 2.1 of the License, or (at your option) any later version. + * + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "usterr.h" +#include "tracer.h" +#include "tp.h" + +DEFINE_TRACE(hello_tptest); + + +struct hello_trace_struct { + char *message; +}; + +struct hello_trace_struct hello_struct = { + .message = "ehlo\n", +}; + +void tptest_probe(void *data, int anint) +{ + struct hello_trace_struct *hello; + char message[30]; + hello=(struct hello_trace_struct *)data; + //printf("this is the message: %s\n", hello->message); + snprintf(message, 30, "this is the %s\n", hello->message); +} + + +#define HELLO_LENGTH 100 + +static void * register_thread_main(void *data) +{ + int ret, i, j = 0; + + struct hello_trace_struct hello[HELLO_LENGTH]; + + for (i=0; i