From 108fc82596e3b66b819df9d28c1ebbc9ab5de14c Mon Sep 17 00:00:00 2001 From: Yoshihiro YUNOMAE Date: Thu, 9 Aug 2012 21:31:30 +0900 Subject: tools: Add guest trace agent as a user tool This patch adds a user tool, "trace agent" for sending trace data of a guest to a Host in low overhead. This agent has the following functions: - splice a page of ring-buffer to read_pipe without memory copying - splice the page from write_pipe to virtio-console without memory copying - write trace data to stdout by using -o option - controlled by start/stop orders from a Host Changes in v2: - Cleanup (change fprintf() to pr_err() and an include guard) Signed-off-by: Yoshihiro YUNOMAE Acked-by: Amit Shah Signed-off-by: Rusty Russell --- tools/virtio/virtio-trace/Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tools/virtio/virtio-trace/Makefile (limited to 'tools/virtio/virtio-trace/Makefile') diff --git a/tools/virtio/virtio-trace/Makefile b/tools/virtio/virtio-trace/Makefile new file mode 100644 index 000000000000..ef3adfce594c --- /dev/null +++ b/tools/virtio/virtio-trace/Makefile @@ -0,0 +1,14 @@ +CC = gcc +CFLAGS = -O2 -Wall +LFLAG = -lpthread + +all: trace-agent + +.c.o: + $(CC) $(CFLAGS) $(LFLAG) -c $^ -o $@ + +trace-agent: trace-agent.o trace-agent-ctl.o trace-agent-rw.o + $(CC) $(CFLAGS) $(LFLAG) -o $@ $^ + +clean: + rm -f *.o trace-agent -- cgit v1.2.3 From 5b8fa822b71fa91b17c9fb38bcca31e771f7650d Mon Sep 17 00:00:00 2001 From: Yoshihiro YUNOMAE Date: Tue, 4 Sep 2012 09:53:39 +0900 Subject: tools: Fix pthread flag for Makefile of trace-agent used by virtio-trace pthread flag should not be -lpthread but -pthread using gcc. The -lpthread links the external multithread library. On the other hand, the -pthread manages both the gcc's preprocessor and linker to be able to compile with pthread. Signed-off-by: Yoshihiro YUNOMAE Signed-off-by: Rusty Russell --- tools/virtio/virtio-trace/Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tools/virtio/virtio-trace/Makefile') diff --git a/tools/virtio/virtio-trace/Makefile b/tools/virtio/virtio-trace/Makefile index ef3adfce594c..0d2381633475 100644 --- a/tools/virtio/virtio-trace/Makefile +++ b/tools/virtio/virtio-trace/Makefile @@ -1,14 +1,13 @@ CC = gcc -CFLAGS = -O2 -Wall -LFLAG = -lpthread +CFLAGS = -O2 -Wall -pthread all: trace-agent .c.o: - $(CC) $(CFLAGS) $(LFLAG) -c $^ -o $@ + $(CC) $(CFLAGS) -c $^ -o $@ trace-agent: trace-agent.o trace-agent-ctl.o trace-agent-rw.o - $(CC) $(CFLAGS) $(LFLAG) -o $@ $^ + $(CC) $(CFLAGS) -o $@ $^ clean: rm -f *.o trace-agent -- cgit v1.2.3