|
|
76adc4 |
--- crash-trace-command-2.0/trace.c.orig
|
|
|
76adc4 |
+++ crash-trace-command-2.0/trace.c
|
|
|
76adc4 |
@@ -15,6 +15,7 @@
|
|
|
76adc4 |
#include <stdio.h>
|
|
|
76adc4 |
#include <ctype.h>
|
|
|
76adc4 |
#include <setjmp.h>
|
|
|
76adc4 |
+#include <stdlib.h>
|
|
|
76adc4 |
|
|
|
76adc4 |
static int verbose = 0;
|
|
|
76adc4 |
|
|
|
76adc4 |
@@ -892,7 +893,7 @@ out_fail:
|
|
|
76adc4 |
|
|
|
76adc4 |
static int ftrace_init_event_type(ulong call, struct event_type *aevent_type)
|
|
|
76adc4 |
{
|
|
|
76adc4 |
- ulong fields_head;
|
|
|
76adc4 |
+ ulong fields_head = 0;
|
|
|
76adc4 |
|
|
|
76adc4 |
if (ftrace_get_event_type_fields(call, &fields_head) < 0)
|
|
|
76adc4 |
return -1;
|
|
|
76adc4 |
@@ -1443,6 +1444,8 @@ static void ftrace_show(int argc, char *
|
|
|
76adc4 |
int fd;
|
|
|
76adc4 |
FILE *file;
|
|
|
76adc4 |
size_t ret;
|
|
|
76adc4 |
+ size_t nitems __attribute__ ((__unused__));
|
|
|
76adc4 |
+ char *unused __attribute__ ((__unused__));
|
|
|
76adc4 |
|
|
|
76adc4 |
/* check trace-cmd */
|
|
|
76adc4 |
if (env_trace_cmd)
|
|
|
76adc4 |
@@ -1465,7 +1468,7 @@ static void ftrace_show(int argc, char *
|
|
|
76adc4 |
}
|
|
|
76adc4 |
|
|
|
76adc4 |
/* dump trace.dat to the temp file */
|
|
|
76adc4 |
- mktemp(tmp);
|
|
|
76adc4 |
+ unused = mktemp(tmp);
|
|
|
76adc4 |
fd = open(tmp, O_WRONLY | O_CREAT | O_TRUNC, 0644);
|
|
|
76adc4 |
if (trace_cmd_data_output(fd) < 0)
|
|
|
76adc4 |
goto out;
|
|
|
76adc4 |
@@ -1478,7 +1481,7 @@ static void ftrace_show(int argc, char *
|
|
|
76adc4 |
ret = fread(buf, 1, sizeof(buf), file);
|
|
|
76adc4 |
if (ret == 0)
|
|
|
76adc4 |
break;
|
|
|
76adc4 |
- fwrite(buf, 1, ret, fp);
|
|
|
76adc4 |
+ nitems = fwrite(buf, 1, ret, fp);
|
|
|
76adc4 |
}
|
|
|
76adc4 |
pclose(file);
|
|
|
76adc4 |
out:
|