Merge tag 'locks-v3.16-2' of git://git.samba.org/jlayton/linux
[linux/fpc-iii.git] / tools / lib / traceevent / parse-utils.c
blobeda07fa31dca1058a72989669e1cc99bc5958ab3
1 /*
2 * Copyright (C) 2010 Red Hat Inc, Steven Rostedt <srostedt@redhat.com>
4 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 * This program 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;
8 * version 2.1 of the License (not later!)
10 * This program 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
13 * GNU 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 program; if not, see <http://www.gnu.org/licenses>
18 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include <string.h>
23 #include <stdarg.h>
24 #include <errno.h>
26 #define __weak __attribute__((weak))
28 void __vwarning(const char *fmt, va_list ap)
30 if (errno)
31 perror("trace-cmd");
32 errno = 0;
34 fprintf(stderr, " ");
35 vfprintf(stderr, fmt, ap);
37 fprintf(stderr, "\n");
40 void __warning(const char *fmt, ...)
42 va_list ap;
44 va_start(ap, fmt);
45 __vwarning(fmt, ap);
46 va_end(ap);
49 void __weak warning(const char *fmt, ...)
51 va_list ap;
53 va_start(ap, fmt);
54 __vwarning(fmt, ap);
55 va_end(ap);
58 void __vpr_stat(const char *fmt, va_list ap)
60 vprintf(fmt, ap);
61 printf("\n");
64 void __pr_stat(const char *fmt, ...)
66 va_list ap;
68 va_start(ap, fmt);
69 __vpr_stat(fmt, ap);
70 va_end(ap);
73 void __weak vpr_stat(const char *fmt, va_list ap)
75 __vpr_stat(fmt, ap);
78 void __weak pr_stat(const char *fmt, ...)
80 va_list ap;
82 va_start(ap, fmt);
83 __vpr_stat(fmt, ap);
84 va_end(ap);