diff options
| author | Steven Rostedt <srostedt@redhat.com> | 2009-11-20 10:33:19 -0500 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2009-11-24 19:57:47 -0500 |
| commit | fceb8ae6b632485674ebac8710a4e1554fcb048d (patch) | |
| tree | cd15550c553c9ae0e23a36ab401cbdabfde814fe | |
| parent | e0b688a1ed55419656a2df5b0fe3e6dfcc34b598 (diff) | |
Added trace-cmd.h
Move trace-cmd specific items from parse-event.h to new trace-cmd.h.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| -rw-r--r-- | parse-events.h | 24 | ||||
| -rw-r--r-- | trace-cmd.c | 2 | ||||
| -rw-r--r-- | trace-cmd.h | 33 | ||||
| -rw-r--r-- | trace-read.c | 1 |
4 files changed, 35 insertions, 25 deletions
diff --git a/parse-events.h b/parse-events.h index c5db4dc..2f950dd 100644 --- a/parse-events.h +++ b/parse-events.h | |||
| @@ -45,24 +45,6 @@ extern int trace_seq_do_printf(struct trace_seq *s); | |||
| 45 | 45 | ||
| 46 | /* ----------------------- pevent ----------------------- */ | 46 | /* ----------------------- pevent ----------------------- */ |
| 47 | 47 | ||
| 48 | /* unique to trace-cmd */ | ||
| 49 | extern unsigned int page_size; | ||
| 50 | void usage(char **argv); | ||
| 51 | |||
| 52 | #ifndef PAGE_MASK | ||
| 53 | #define PAGE_MASK (page_size - 1) | ||
| 54 | #endif | ||
| 55 | |||
| 56 | enum { | ||
| 57 | RINGBUF_TYPE_PADDING = 29, | ||
| 58 | RINGBUF_TYPE_TIME_EXTEND = 30, | ||
| 59 | RINGBUF_TYPE_TIME_STAMP = 31, | ||
| 60 | }; | ||
| 61 | |||
| 62 | #ifndef TS_SHIFT | ||
| 63 | #define TS_SHIFT 27 | ||
| 64 | #endif | ||
| 65 | |||
| 66 | #define NSECS_PER_SEC 1000000000ULL | 48 | #define NSECS_PER_SEC 1000000000ULL |
| 67 | #define NSECS_PER_USEC 1000ULL | 49 | #define NSECS_PER_USEC 1000ULL |
| 68 | 50 | ||
| @@ -212,16 +194,10 @@ extern int old_format; | |||
| 212 | 194 | ||
| 213 | void parse_set_info(int nr_cpus, int long_sz); | 195 | void parse_set_info(int nr_cpus, int long_sz); |
| 214 | 196 | ||
| 215 | void trace_report(int argc, char **argv); | ||
| 216 | |||
| 217 | void die(char *fmt, ...); | 197 | void die(char *fmt, ...); |
| 218 | void *malloc_or_die(unsigned int size); | 198 | void *malloc_or_die(unsigned int size); |
| 219 | void warning(char *fmt, ...); | 199 | void warning(char *fmt, ...); |
| 220 | 200 | ||
| 221 | void parse_cmdlines(char *file, int size); | ||
| 222 | void parse_proc_kallsyms(char *file, unsigned int size); | ||
| 223 | void parse_ftrace_printk(char *file, unsigned int size); | ||
| 224 | |||
| 225 | extern int file_bigendian; | 201 | extern int file_bigendian; |
| 226 | extern int host_bigendian; | 202 | extern int host_bigendian; |
| 227 | 203 | ||
diff --git a/trace-cmd.c b/trace-cmd.c index ca1fbfa..4234832 100644 --- a/trace-cmd.c +++ b/trace-cmd.c | |||
| @@ -34,7 +34,7 @@ | |||
| 34 | #include <errno.h> | 34 | #include <errno.h> |
| 35 | 35 | ||
| 36 | #include "parse-events.h" | 36 | #include "parse-events.h" |
| 37 | 37 | #include "trace-cmd.h" | |
| 38 | 38 | ||
| 39 | #define VERSION "0.5" | 39 | #define VERSION "0.5" |
| 40 | 40 | ||
diff --git a/trace-cmd.h b/trace-cmd.h new file mode 100644 index 0000000..369e796 --- /dev/null +++ b/trace-cmd.h | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | #ifndef _TRACE_CMD_H | ||
| 2 | #define _TRACE_CMD_H | ||
| 3 | |||
| 4 | extern int input_fd; | ||
| 5 | extern const char *input_file; | ||
| 6 | |||
| 7 | extern unsigned int page_size; | ||
| 8 | |||
| 9 | #ifndef PAGE_MASK | ||
| 10 | #define PAGE_MASK (page_size - 1) | ||
| 11 | #endif | ||
| 12 | |||
| 13 | void usage(char **argv); | ||
| 14 | int read_trace_header(void); | ||
| 15 | int read_trace_files(void); | ||
| 16 | |||
| 17 | void trace_report(int argc, char **argv); | ||
| 18 | |||
| 19 | void parse_cmdlines(char *file, int size); | ||
| 20 | void parse_proc_kallsyms(char *file, unsigned int size); | ||
| 21 | void parse_ftrace_printk(char *file, unsigned int size); | ||
| 22 | |||
| 23 | enum { | ||
| 24 | RINGBUF_TYPE_PADDING = 29, | ||
| 25 | RINGBUF_TYPE_TIME_EXTEND = 30, | ||
| 26 | RINGBUF_TYPE_TIME_STAMP = 31, | ||
| 27 | }; | ||
| 28 | |||
| 29 | #ifndef TS_SHIFT | ||
| 30 | #define TS_SHIFT 27 | ||
| 31 | #endif | ||
| 32 | |||
| 33 | #endif /* _TRACE_CMD_H */ | ||
diff --git a/trace-read.c b/trace-read.c index 355a811..1c62c4b 100644 --- a/trace-read.c +++ b/trace-read.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #include <errno.h> | 37 | #include <errno.h> |
| 38 | 38 | ||
| 39 | #include "parse-events.h" | 39 | #include "parse-events.h" |
| 40 | #include "trace-cmd.h" | ||
| 40 | 41 | ||
| 41 | int input_fd; | 42 | int input_fd; |
| 42 | const char *input_file = "trace.dat"; | 43 | const char *input_file = "trace.dat"; |
