debuggers.hg

view tools/xenstore/Makefile @ 16986:a6c037d8cba3

Add DTrace support to xenstored

Add USDT probes for significant xenstore operations to allow dynamic
tracing.

Signed-off-by: John Levon <john.levon@sun.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jan 31 09:13:27 2008 +0000 (2008-01-31)
parents ddf454872de4
children e534d7c9029c
line source
1 XEN_ROOT=../..
2 include $(XEN_ROOT)/tools/Rules.mk
3 XEN_LIBXC = $(XEN_ROOT)/tools/libxc
5 MAJOR = 3.0
6 MINOR = 0
8 PROFILE=#-pg
9 BASECFLAGS=-Werror
10 # Make gcc generate dependencies.
11 BASECFLAGS += -Wp,-MD,.$(@F).d
12 PROG_DEP = .*.d
13 BASECFLAGS+= $(PROFILE)
14 BASECFLAGS+= $(CFLAGS_libxenctrl)
15 BASECFLAGS+= -I.
17 CFLAGS += $(BASECFLAGS)
18 LDFLAGS += $(PROFILE)
20 CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
21 CLIENTS += xenstore-write
22 CLIENTS_OBJS := $(patsubst xenstore-%,xenstore_%.o,$(CLIENTS))
24 XENSTORED_OBJS = xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o tdb.o hashtable.o
26 XENSTORED_OBJS_$(CONFIG_Linux) = xenstored_linux.o
27 XENSTORED_OBJS_$(CONFIG_SunOS) = xenstored_solaris.o xenstored_probes.o
28 XENSTORED_OBJS_$(CONFIG_NetBSD) = xenstored_netbsd.o
30 XENSTORED_OBJS += $(XENSTORED_OBJS_y)
32 .PHONY: all
33 all: libxenstore.so libxenstore.a xenstored $(CLIENTS) xs_tdb_dump xenstore-control xenstore-ls
35 ifeq ($(CONFIG_SunOS),y)
36 xenstored_probes.h: xenstored_probes.d
37 dtrace -C -h -s xenstored_probes.d
39 xenstored_solaris.o: xenstored_probes.h
41 xenstored_probes.o: xenstored_solaris.o
42 dtrace -C -G -s xenstored_probes.d xenstored_solaris.o
44 CFLAGS += -DHAVE_DTRACE=1
45 endif
47 xenstored: $(XENSTORED_OBJS)
48 $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) $(LDFLAGS_libxenctrl) $(SOCKET_LIBS) -o $@
50 $(CLIENTS): xenstore-%: xenstore_%.o libxenstore.so
51 $(CC) $(CFLAGS) $(LDFLAGS) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore $(SOCKET_LIBS) -o $@
53 $(CLIENTS_OBJS): xenstore_%.o: xenstore_client.c
54 $(COMPILE.c) -DCLIENT_$(*F) -o $@ $<
56 xenstore-control: xenstore_control.o libxenstore.so
57 $(CC) $(CFLAGS) $(LDFLAGS) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore $(SOCKET_LIBS) -o $@
59 xenstore-ls: xsls.o libxenstore.so
60 $(CC) $(CFLAGS) $(LDFLAGS) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore $(SOCKET_LIBS) -o $@
62 xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o
63 $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
65 libxenstore.so: libxenstore.so.$(MAJOR)
66 ln -sf $< $@
67 libxenstore.so.$(MAJOR): libxenstore.so.$(MAJOR).$(MINOR)
68 ln -sf $< $@
70 libxenstore.so.$(MAJOR).$(MINOR): xs.opic xs_lib.opic
71 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenstore.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^ $(SOCKET_LIBS) -lpthread
73 libxenstore.a: xs.o xs_lib.o
74 $(AR) rcs libxenstore.a $^
76 .PHONY: clean
77 clean:
78 rm -f *.a *.o *.opic *.so* xenstored_probes.h
79 rm -f xenstored xs_random xs_stress xs_crashme
80 rm -f xs_tdb_dump xenstore-control xenstore-ls
81 rm -f $(CLIENTS)
82 $(RM) $(PROG_DEP)
84 .PHONY: TAGS
85 TAGS:
86 etags `find . -name '*.[ch]'`
88 .PHONY: tarball
89 tarball: clean
90 cd .. && tar -c -j -v -h -f xenstore.tar.bz2 xenstore/
92 .PHONY: install
93 install: all
94 $(INSTALL_DIR) $(DESTDIR)/var/run/xenstored
95 $(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored
96 $(INSTALL_DIR) $(DESTDIR)$(BINDIR)
97 $(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
98 $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
99 $(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR)
100 $(INSTALL_PROG) $(CLIENTS) $(DESTDIR)$(BINDIR)
101 $(INSTALL_PROG) xenstore-control $(DESTDIR)$(BINDIR)
102 $(INSTALL_PROG) xenstore-ls $(DESTDIR)$(BINDIR)
103 $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
104 $(INSTALL_PROG) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
105 ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR)
106 ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenstore.so
107 $(INSTALL_DATA) libxenstore.a $(DESTDIR)$(LIBDIR)
108 $(INSTALL_DATA) xs.h $(DESTDIR)$(INCLUDEDIR)
109 $(INSTALL_DATA) xs_lib.h $(DESTDIR)$(INCLUDEDIR)
111 -include $(PROG_DEP)
113 # never delete any intermediate files.
114 .SECONDARY: