diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-10-13 00:55:35 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-10-13 00:55:35 -0400 |
commit | f8766a8266ecbfd46190fb97a393bf7d01971850 (patch) | |
tree | 5fe00ce6b69f12539d19ff4c2cbb89aa432bce6c /trace-cmd.c | |
parent | 62989922ff2e9b53738acd60a2b6e202ca403e6d (diff) |
do not exit when parser fails on an event
If an event fails to parse, just warn about it, and continue.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'trace-cmd.c')
-rw-r--r-- | trace-cmd.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/trace-cmd.c b/trace-cmd.c index c452c8f..3657dd3 100644 --- a/trace-cmd.c +++ b/trace-cmd.c | |||
@@ -147,6 +147,21 @@ void die(char *fmt, ...) | |||
147 | exit(ret); | 147 | exit(ret); |
148 | } | 148 | } |
149 | 149 | ||
150 | void warn(char *fmt, ...) | ||
151 | { | ||
152 | va_list ap; | ||
153 | |||
154 | if (errno) | ||
155 | perror("trace-cmd"); | ||
156 | |||
157 | va_start(ap, fmt); | ||
158 | fprintf(stderr, " "); | ||
159 | vfprintf(stderr, fmt, ap); | ||
160 | va_end(ap); | ||
161 | |||
162 | fprintf(stderr, "\n"); | ||
163 | } | ||
164 | |||
150 | void *malloc_or_die(unsigned int size) | 165 | void *malloc_or_die(unsigned int size) |
151 | { | 166 | { |
152 | void *data; | 167 | void *data; |