2 * Copyright (C) 2009 Pierre-Marc Fournier
3 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #include <ust/marker.h>
23 #define TRACEPOINT_CREATE_PROBES
26 struct hello_trace_struct
{
30 struct hello_trace_struct hello_struct
= {
34 void tptest_probe(void *data
, int anint
)
36 struct hello_trace_struct
*hello
;
37 hello
= (struct hello_trace_struct
*)data
;
38 DBG("in tracepoint probe...");
39 printf("this is the message: %s\n", hello
->message
);
42 void tptest2_probe(void *data
)
46 static void __attribute__((constructor
)) init()
48 DBG("connecting tracepoint...\n");
50 * Note: this is an internal API that will be used within
51 * TRACEPOINT_EVENT only eventually.
53 __register_tracepoint(hello_tptest
, tptest_probe
, &hello_struct
);
54 __register_tracepoint(hello_tptest2
, tptest2_probe
, &hello_struct
);