aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile14
-rw-r--r--trace-cmd.c3
-rw-r--r--trace-view.c10
3 files changed, 17 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 6c00ac9..7533dee 100644
--- a/Makefile
+++ b/Makefile
@@ -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
21TARGETS = libparsevent.a libtracecmd.a trace-cmd plugin_hrtimer.so plugin_mac80211.so \ 21TARGETS = 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
24all: $(TARGETS) 24all: $(TARGETS)
25 25
26LIB_FILE = libtracecmd.a 26LIB_FILE = libtracecmd.a
27 27
28HEADERS = parse-events.h trace-cmd.h trace-local.h trace-view-store.h 28HEADERS = parse-events.h trace-cmd.h trace-local.h
29 29
30trace-read.o:: $(HEADERS) 30trace-read.o:: $(HEADERS)
31trace-cmd.o:: $(HEADERS) $(LIB_FILE) 31trace-cmd.o:: $(HEADERS) $(LIB_FILE)
32trace-util.o:: $(HEADERS) 32trace-util.o:: $(HEADERS)
33trace-ftrace.o:: $(HEADERS) 33trace-ftrace.o:: $(HEADERS)
34trace-input.o:: $(HEADERS) 34trace-input.o:: $(HEADERS)
35trace-view.o:: $(HEADERS) 35trace-view.o:: $(HEADERS) trace-view-store.h
36trace-view-store.o:: $(HEADERS) 36trace-view-store.o:: $(HEADERS) trace-view-store.h
37trace-filter.o:: $(HEADERS) 37trace-filter.o:: $(HEADERS)
38trace-graph.o:: $(HEADERS) 38trace-graph.o:: $(HEADERS)
39 39
40trace-cmd:: trace-cmd.o trace-read.o trace-view.o trace-view-store.o \ 40trace-cmd:: trace-cmd.o trace-read.o
41 trace-filter.o 41 $(CC) $^ -rdynamic -o $@ $(LIBS)
42
43trace-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
44trace-graph:: trace-graph.o trace-compat.o 46trace-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
35enum { 36enum {
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
398int main(int argc, char **argv)
399{
400 trace_view(argc, argv);
401 return 0;
402}