net: hns: Fixed bug that netdev was opened twice
[linux/fpc-iii.git] / tools / lib / traceevent / parse-utils.c
blob77e4ec6402dd3fef5e7832cbe1afe41f83db3906
1 // SPDX-License-Identifier: LGPL-2.1
2 /*
3 * Copyright (C) 2010 Red Hat Inc, Steven Rostedt <srostedt@redhat.com>
5 */
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <string.h>
9 #include <stdarg.h>
10 #include <errno.h>
12 #define __weak __attribute__((weak))
14 void __vwarning(const char *fmt, va_list ap)
16 if (errno)
17 perror("trace-cmd");
18 errno = 0;
20 fprintf(stderr, " ");
21 vfprintf(stderr, fmt, ap);
23 fprintf(stderr, "\n");
26 void __warning(const char *fmt, ...)
28 va_list ap;
30 va_start(ap, fmt);
31 __vwarning(fmt, ap);
32 va_end(ap);
35 void __weak warning(const char *fmt, ...)
37 va_list ap;
39 va_start(ap, fmt);
40 __vwarning(fmt, ap);
41 va_end(ap);
44 void __vpr_stat(const char *fmt, va_list ap)
46 vprintf(fmt, ap);
47 printf("\n");
50 void __pr_stat(const char *fmt, ...)
52 va_list ap;
54 va_start(ap, fmt);
55 __vpr_stat(fmt, ap);
56 va_end(ap);
59 void __weak vpr_stat(const char *fmt, va_list ap)
61 __vpr_stat(fmt, ap);
64 void __weak pr_stat(const char *fmt, ...)
66 va_list ap;
68 va_start(ap, fmt);
69 __vpr_stat(fmt, ap);
70 va_end(ap);