diff options
-rw-r--r-- | Makefile | 14 | ||||
-rw-r--r-- | trace-cmd.c | 3 | ||||
-rw-r--r-- | trace-view.c | 10 |
3 files changed, 17 insertions, 10 deletions
@@ -19,26 +19,28 @@ CFLAGS = -g -Wall $(CONFIG_FLAGS) | |||
19 | $(CC) -c $(CFLAGS) $(EXT) $(INCLUDES) $< -o $@ | 19 | $(CC) -c $(CFLAGS) $(EXT) $(INCLUDES) $< -o $@ |
20 | 20 | ||
21 | TARGETS = libparsevent.a libtracecmd.a trace-cmd plugin_hrtimer.so plugin_mac80211.so \ | 21 | TARGETS = libparsevent.a libtracecmd.a trace-cmd plugin_hrtimer.so plugin_mac80211.so \ |
22 | plugin_sched_switch.so trace-graph | 22 | plugin_sched_switch.so trace-graph trace-view |
23 | 23 | ||
24 | all: $(TARGETS) | 24 | all: $(TARGETS) |
25 | 25 | ||
26 | LIB_FILE = libtracecmd.a | 26 | LIB_FILE = libtracecmd.a |
27 | 27 | ||
28 | HEADERS = parse-events.h trace-cmd.h trace-local.h trace-view-store.h | 28 | HEADERS = parse-events.h trace-cmd.h trace-local.h |
29 | 29 | ||
30 | trace-read.o:: $(HEADERS) | 30 | trace-read.o:: $(HEADERS) |
31 | trace-cmd.o:: $(HEADERS) $(LIB_FILE) | 31 | trace-cmd.o:: $(HEADERS) $(LIB_FILE) |
32 | trace-util.o:: $(HEADERS) | 32 | trace-util.o:: $(HEADERS) |
33 | trace-ftrace.o:: $(HEADERS) | 33 | trace-ftrace.o:: $(HEADERS) |
34 | trace-input.o:: $(HEADERS) | 34 | trace-input.o:: $(HEADERS) |
35 | trace-view.o:: $(HEADERS) | 35 | trace-view.o:: $(HEADERS) trace-view-store.h |
36 | trace-view-store.o:: $(HEADERS) | 36 | trace-view-store.o:: $(HEADERS) trace-view-store.h |
37 | trace-filter.o:: $(HEADERS) | 37 | trace-filter.o:: $(HEADERS) |
38 | trace-graph.o:: $(HEADERS) | 38 | trace-graph.o:: $(HEADERS) |
39 | 39 | ||
40 | trace-cmd:: trace-cmd.o trace-read.o trace-view.o trace-view-store.o \ | 40 | trace-cmd:: trace-cmd.o trace-read.o |
41 | trace-filter.o | 41 | $(CC) $^ -rdynamic -o $@ $(LIBS) |
42 | |||
43 | trace-view:: trace-view.o trace-view-store.o trace-filter.o | ||
42 | $(CC) $^ -rdynamic -o $@ $(CONFIG_LIBS) $(LIBS) | 44 | $(CC) $^ -rdynamic -o $@ $(CONFIG_LIBS) $(LIBS) |
43 | 45 | ||
44 | trace-graph:: trace-graph.o trace-compat.o | 46 | trace-graph:: trace-graph.o trace-compat.o |
diff --git a/trace-cmd.c b/trace-cmd.c index cd45a6e..b755ebe 100644 --- a/trace-cmd.c +++ b/trace-cmd.c | |||
@@ -785,9 +785,6 @@ int main (int argc, char **argv) | |||
785 | if (strcmp(argv[1], "report") == 0) { | 785 | if (strcmp(argv[1], "report") == 0) { |
786 | trace_report(argc, argv); | 786 | trace_report(argc, argv); |
787 | exit(0); | 787 | exit(0); |
788 | } else if (strcmp(argv[1], "view") == 0) { | ||
789 | trace_view(argc, argv); | ||
790 | exit(0); | ||
791 | } else if ((record = (strcmp(argv[1], "record") == 0)) || | 788 | } else if ((record = (strcmp(argv[1], "record") == 0)) || |
792 | (strcmp(argv[1], "start") == 0) || | 789 | (strcmp(argv[1], "start") == 0) || |
793 | ((extract = strcmp(argv[1], "extract") == 0))) { | 790 | ((extract = strcmp(argv[1], "extract") == 0))) { |
diff --git a/trace-view.c b/trace-view.c index 1a372a4..dc0cd90 100644 --- a/trace-view.c +++ b/trace-view.c | |||
@@ -31,6 +31,7 @@ | |||
31 | 31 | ||
32 | #define TRACE_WIDTH 800 | 32 | #define TRACE_WIDTH 800 |
33 | #define TRACE_HEIGHT 600 | 33 | #define TRACE_HEIGHT 600 |
34 | #define input_file "trace.dat" | ||
34 | 35 | ||
35 | enum { | 36 | enum { |
36 | COL_CPU, | 37 | COL_CPU, |
@@ -224,7 +225,8 @@ void trace_view(int argc, char **argv) | |||
224 | GtkWidget *label; | 225 | GtkWidget *label; |
225 | GtkWidget *spin; | 226 | GtkWidget *spin; |
226 | 227 | ||
227 | handle = read_trace_header(); | 228 | handle = tracecmd_open(input_file); |
229 | |||
228 | if (!handle) | 230 | if (!handle) |
229 | die("error reading header"); | 231 | die("error reading header"); |
230 | 232 | ||
@@ -392,3 +394,9 @@ void trace_view(int argc, char **argv) | |||
392 | gtk_widget_show (window); | 394 | gtk_widget_show (window); |
393 | gtk_main (); | 395 | gtk_main (); |
394 | } | 396 | } |
397 | |||
398 | int main(int argc, char **argv) | ||
399 | { | ||
400 | trace_view(argc, argv); | ||
401 | return 0; | ||
402 | } | ||