diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-11-24 20:42:30 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-11-24 20:45:59 -0500 |
commit | e46cb5cdd97734282a68af67675c0fe40a779a00 (patch) | |
tree | 02acbae3aa452c75293b169f5c30c7f2024e8410 /Makefile | |
parent | fceb8ae6b632485674ebac8710a4e1554fcb048d (diff) |
Add method to load plugins at trace-cmd report time
This adds a method to load a plugin. It looks in the users directory
~/.trace-cmd/plugins
and tries to load any file there. To create a plugin simply make
a C file that has this minimum format:
#include "parse-events.h"
int PEVENT_PLUGIN_LOADER(void)
{
...
}
Then compile it with the following method:
gcc -c plugin.c -fPIC -o plugin.o
gcc -shared -nostartfiles -o plugin
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -4,12 +4,12 @@ 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 | 7 | LIBS = -L. -lparsevent -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 | 12 | TARGETS = libparsevent.a trace-cmd test_plugin |
13 | 13 | ||
14 | all: $(TARGETS) | 14 | all: $(TARGETS) |
15 | 15 | ||
@@ -35,6 +35,12 @@ libparsevent.so: $(LIB_OBJS) | |||
35 | libparsevent.a: $(LIB_OBJS) | 35 | libparsevent.a: $(LIB_OBJS) |
36 | $(RM) $@; $(AR) rcs $@ $^ | 36 | $(RM) $@; $(AR) rcs $@ $^ |
37 | 37 | ||
38 | test_plugin.o: test_plugin.c parse-events.h | ||
39 | $(CC) -c $(CFLAGS) -fPIC -o $@ $< | ||
40 | |||
41 | test_plugin: test_plugin.o | ||
42 | $(CC) -shared -nostartfiles -o $@ $< | ||
43 | |||
38 | .PHONY: force | 44 | .PHONY: force |
39 | force: | 45 | force: |
40 | 46 | ||