aboutsummaryrefslogtreecommitdiffstats
path: root/trace-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'trace-util.c')
-rw-r--r--trace-util.c67
1 files changed, 0 insertions, 67 deletions
diff --git a/trace-util.c b/trace-util.c
index 6605f1f..b8b6faf 100644
--- a/trace-util.c
+++ b/trace-util.c
@@ -38,8 +38,6 @@
38int tracecmd_disable_sys_plugins; 38int tracecmd_disable_sys_plugins;
39int tracecmd_disable_plugins; 39int tracecmd_disable_plugins;
40 40
41#define __weak __attribute__((weak))
42
43#define _STR(x) #x 41#define _STR(x) #x
44#define STR(x) _STR(x) 42#define STR(x) _STR(x)
45 43
@@ -53,71 +51,6 @@ struct plugin_list {
53 void *handle; 51 void *handle;
54}; 52};
55 53
56void __weak die(char *fmt, ...)
57{
58 va_list ap;
59 int ret = errno;
60
61 if (errno)
62 perror("trace-cmd");
63 else
64 ret = -1;
65
66 va_start(ap, fmt);
67 fprintf(stderr, " ");
68 vfprintf(stderr, fmt, ap);
69 va_end(ap);
70
71 fprintf(stderr, "\n");
72 exit(ret);
73}
74
75void __weak warning(char *fmt, ...)
76{
77 va_list ap;
78
79 if (errno)
80 perror("trace-cmd");
81 errno = 0;
82
83 va_start(ap, fmt);
84 fprintf(stderr, " ");
85 vfprintf(stderr, fmt, ap);
86 va_end(ap);
87
88 fprintf(stderr, "\n");
89}
90
91void __weak pr_stat(char *fmt, ...)
92{
93 va_list ap;
94
95 va_start(ap, fmt);
96 vprintf(fmt, ap);
97 va_end(ap);
98
99 printf("\n");
100}
101
102void __weak *malloc_or_die(unsigned int size)
103{
104 void *data;
105
106 data = malloc(size);
107 if (!data)
108 die("malloc");
109 return data;
110}
111
112int __weak bigendian(void)
113{
114 unsigned char str[] = { 0x1, 0x2, 0x3, 0x4 };
115 unsigned int *ptr;
116
117 ptr = (unsigned int *)str;
118 return *ptr == 0x01020304;
119}
120
121void parse_cmdlines(struct pevent *pevent, 54void parse_cmdlines(struct pevent *pevent,
122 char *file, int size __unused) 55 char *file, int size __unused)
123{ 56{