2 * Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as published by the
6 * Free Software Foundation; version 2.1 of the License.
8 * This library is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #include <arpa/inet.h>
26 #include <sys/types.h>
30 #define TRACEPOINT_DEFINE
33 int main(int argc
, char **argv
)
35 int i
, netint
, ret
= 0;
36 long values
[] = { 1, 2, 3 };
37 char text
[10] = "test";
40 unsigned int nr_iter
= 100;
41 useconds_t nr_usec
= 0;
44 nr_iter
= atoi(argv
[1]);
48 /* By default, don't wait unless user specifies. */
49 nr_usec
= atoi(argv
[2]);
52 for (i
= 0; i
< nr_iter
; i
++) {
54 tracepoint(tp
, tptest1
, i
, netint
, values
, text
, strlen(text
),
56 tracepoint(tp
, tptest2
, i
, netint
, values
, text
, strlen(text
),
58 tracepoint(tp
, tptest3
, i
, netint
, values
, text
, strlen(text
),
60 tracepoint(tp
, tptest4
, i
, netint
, values
, text
, strlen(text
),
62 tracepoint(tp
, tptest5
, i
, netint
, values
, text
, strlen(text
),
65 if (usleep_safe(nr_usec
)) {
73 exit(!ret
? EXIT_SUCCESS
: EXIT_FAILURE
);
This page took 0.031413 seconds and 4 git commands to generate.