diff options
-rw-r--r-- | Makefile | 19 | ||||
-rw-r--r-- | trace-cmd.c | 3 | ||||
-rw-r--r-- | trace-cmd.h | 3 | ||||
-rw-r--r-- | trace-local.h | 11 | ||||
-rw-r--r-- | trace-read.c | 3 | ||||
-rw-r--r-- | trace-util.c | 1 |
6 files changed, 27 insertions, 13 deletions
@@ -4,21 +4,21 @@ EXT = -std=gnu99 | |||
4 | CFLAGS = -g -Wall # -O2 | 4 | CFLAGS = -g -Wall # -O2 |
5 | INCLUDES = -I. -I/usr/local/include | 5 | INCLUDES = -I. -I/usr/local/include |
6 | 6 | ||
7 | LIBS = -L. -lparsevent -ldl | 7 | LIBS = -L. -ltracecmd -ldl |
8 | 8 | ||
9 | %.o: %.c | 9 | %.o: %.c |
10 | $(CC) -c $(CFLAGS) $(EXT) $(INCLUDES) $< -o $@ | 10 | $(CC) -c $(CFLAGS) $(EXT) $(INCLUDES) $< -o $@ |
11 | 11 | ||
12 | TARGETS = libparsevent.a trace-cmd plugin_hrtimer.so plugin_mac80211.so | 12 | TARGETS = libparsevent.a libtracecmd.a trace-cmd plugin_hrtimer.so plugin_mac80211.so |
13 | 13 | ||
14 | all: $(TARGETS) | 14 | all: $(TARGETS) |
15 | 15 | ||
16 | LIB_FILE = libparsevent.a | 16 | LIB_FILE = libtracecmd.a |
17 | 17 | ||
18 | trace-read.o:: parse-events.h | 18 | trace-read.o:: parse-events.h |
19 | trace-cmd.o:: parse-events.h $(LIB_FILE) | 19 | trace-cmd.o:: parse-events.h $(LIB_FILE) |
20 | 20 | ||
21 | trace-cmd:: trace-cmd.o trace-read.o trace-util.o | 21 | trace-cmd:: trace-cmd.o trace-read.o |
22 | $(CC) $^ $(LIBS) -rdynamic -o $@ | 22 | $(CC) $^ $(LIBS) -rdynamic -o $@ |
23 | 23 | ||
24 | parse-events.o: parse-events.c parse-events.h | 24 | parse-events.o: parse-events.c parse-events.h |
@@ -27,12 +27,17 @@ parse-events.o: parse-events.c parse-events.h | |||
27 | trace-seq.o: trace-seq.c parse-events.h | 27 | trace-seq.o: trace-seq.c parse-events.h |
28 | $(CC) -c $(CFLAGS) $(EXT) $(INCLUDES) -fPIC $< -o $@ | 28 | $(CC) -c $(CFLAGS) $(EXT) $(INCLUDES) -fPIC $< -o $@ |
29 | 29 | ||
30 | LIB_OBJS = parse-events.o trace-seq.o | 30 | PEVENT_LIB_OBJS = parse-events.o trace-seq.o |
31 | 31 | ||
32 | libparsevent.so: $(LIB_OBJS) | 32 | libparsevent.so: $(PEVENT_LIB_OBJS) |
33 | $(CC) --shared $^ -o $@ | 33 | $(CC) --shared $^ -o $@ |
34 | 34 | ||
35 | libparsevent.a: $(LIB_OBJS) | 35 | libparsevent.a: $(PEVENT_LIB_OBJS) |
36 | $(RM) $@; $(AR) rcs $@ $^ | ||
37 | |||
38 | TCMD_LIB_OBJS = $(PEVENT_LIB_OBJS) trace-util.o | ||
39 | |||
40 | libtracecmd.a: $(TCMD_LIB_OBJS) | ||
36 | $(RM) $@; $(AR) rcs $@ $^ | 41 | $(RM) $@; $(AR) rcs $@ $^ |
37 | 42 | ||
38 | plugin_hrtimer.o: plugin_hrtimer.c parse-events.h | 43 | plugin_hrtimer.o: plugin_hrtimer.c parse-events.h |
diff --git a/trace-cmd.c b/trace-cmd.c index 7d41744..6719fc3 100644 --- a/trace-cmd.c +++ b/trace-cmd.c | |||
@@ -33,8 +33,7 @@ | |||
33 | #include <ctype.h> | 33 | #include <ctype.h> |
34 | #include <errno.h> | 34 | #include <errno.h> |
35 | 35 | ||
36 | #include "parse-events.h" | 36 | #include "trace-local.h" |
37 | #include "trace-cmd.h" | ||
38 | 37 | ||
39 | #define VERSION "0.5" | 38 | #define VERSION "0.5" |
40 | 39 | ||
diff --git a/trace-cmd.h b/trace-cmd.h index 1a33d04..667ab3e 100644 --- a/trace-cmd.h +++ b/trace-cmd.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _TRACE_CMD_H | 1 | #ifndef _TRACE_CMD_H |
2 | #define _TRACE_CMD_H | 2 | #define _TRACE_CMD_H |
3 | 3 | ||
4 | #include "parse-events.h" | ||
5 | |||
4 | extern int input_fd; | 6 | extern int input_fd; |
5 | extern const char *input_file; | 7 | extern const char *input_file; |
6 | 8 | ||
@@ -10,7 +12,6 @@ extern unsigned int page_size; | |||
10 | #define PAGE_MASK (page_size - 1) | 12 | #define PAGE_MASK (page_size - 1) |
11 | #endif | 13 | #endif |
12 | 14 | ||
13 | void usage(char **argv); | ||
14 | int read_trace_header(void); | 15 | int read_trace_header(void); |
15 | int read_trace_files(void); | 16 | int read_trace_files(void); |
16 | 17 | ||
diff --git a/trace-local.h b/trace-local.h new file mode 100644 index 0000000..d3fddff --- /dev/null +++ b/trace-local.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef __TRACE_LOCAL_H | ||
2 | #define __TRACE_LOCAL_H | ||
3 | |||
4 | #include "trace-cmd.h" | ||
5 | |||
6 | /* for local shared information with trace-cmd executable */ | ||
7 | |||
8 | void usage(char **argv); | ||
9 | |||
10 | |||
11 | #endif /* __TRACE_LOCAL_H */ | ||
diff --git a/trace-read.c b/trace-read.c index 9be0817..cb358b0 100644 --- a/trace-read.c +++ b/trace-read.c | |||
@@ -36,8 +36,7 @@ | |||
36 | #include <ctype.h> | 36 | #include <ctype.h> |
37 | #include <errno.h> | 37 | #include <errno.h> |
38 | 38 | ||
39 | #include "parse-events.h" | 39 | #include "trace-local.h" |
40 | #include "trace-cmd.h" | ||
41 | 40 | ||
42 | int input_fd; | 41 | int input_fd; |
43 | const char *input_file = "trace.dat"; | 42 | const char *input_file = "trace.dat"; |
diff --git a/trace-util.c b/trace-util.c index 0bdf009..542e712 100644 --- a/trace-util.c +++ b/trace-util.c | |||
@@ -9,7 +9,6 @@ | |||
9 | #include <sys/types.h> | 9 | #include <sys/types.h> |
10 | #include <sys/stat.h> | 10 | #include <sys/stat.h> |
11 | 11 | ||
12 | #include "parse-events.h" | ||
13 | #include "trace-cmd.h" | 12 | #include "trace-cmd.h" |
14 | 13 | ||
15 | #define PLUGIN_DIR ".trace-cmd/plugins" | 14 | #define PLUGIN_DIR ".trace-cmd/plugins" |