mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
tools: split libxenstat into new tools/libs/stat directory
There is no reason why libxenstat is not placed in the tools/libs directory. At the same time move xenstat.h to a dedicated include directory in tools/libs/stat in order to follow the same pattern as the other libraries in tools/libs. As now xentop is the only left directory in xenstat move it directly under tools and get rid of tools/xenstat. Fix some missing prototype errors (add one prototype and make two functions static). Signed-off-by: Juergen Gross <jgross@suse.com> Acked-by: Wei Liu <wl@xen.org>
This commit is contained in:
1 parent
8ab2429f12
commit
6d0ec05390
22 files changed
+35
-106
No files matched your search
+5
-3
@@ -128,6 +128,10 @@ tools/libs/guest/xc_core.h
|
||||
tools/libs/guest/xc_core_arm.h
|
||||
tools/libs/guest/xc_core_x86.h
|
||||
tools/libs/guest/xc_private.h
|
||||
tools/libs/stat/_paths.h
|
||||
tools/libs/stat/headers.chk
|
||||
tools/libs/stat/libxenstat.map
|
||||
tools/libs/stat/xenstat.pc
|
||||
tools/libs/store/headers.chk
|
||||
tools/libs/store/list.h
|
||||
tools/libs/store/utils.h
|
||||
@@ -276,9 +280,6 @@ tools/xenmon/xentrace_setmask
|
||||
tools/xenmon/xenbaked
|
||||
tools/xenpaging/xenpaging
|
||||
tools/xenpmd/xenpmd
|
||||
tools/xenstat/libxenstat/src/_paths.h
|
||||
tools/xenstat/libxenstat/xenstat.pc
|
||||
tools/xenstat/xentop/xentop
|
||||
tools/xenstore/xenstore
|
||||
tools/xenstore/xenstore-chmod
|
||||
tools/xenstore/xenstore-exists
|
||||
@@ -291,6 +292,7 @@ tools/xenstore/xenstore-ls
|
||||
tools/xenstore/xenstored
|
||||
tools/xenstore/xenstored_test
|
||||
tools/xenstore/xs_tdb_dump
|
||||
tools/xentop/xentop
|
||||
tools/xentrace/xentrace_setsize
|
||||
tools/xentrace/tbctl
|
||||
tools/xentrace/xenctx
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ SUBDIRS-$(CONFIG_XCUTILS) += xcutils
|
||||
SUBDIRS-$(CONFIG_X86) += firmware
|
||||
SUBDIRS-y += console
|
||||
SUBDIRS-y += xenmon
|
||||
SUBDIRS-y += xenstat
|
||||
SUBDIRS-y += xentop
|
||||
SUBDIRS-$(CONFIG_NetBSD) += xenbackendd
|
||||
SUBDIRS-y += libfsimage
|
||||
SUBDIRS-$(CONFIG_Linux) += vchan
|
||||
|
||||
@@ -18,7 +18,6 @@ include $(XEN_ROOT)/tools/libs/uselibs.mk
|
||||
XEN_libxenlight = $(XEN_ROOT)/tools/libxl
|
||||
# Currently libxlutil lives in the same directory as libxenlight
|
||||
XEN_libxlutil = $(XEN_libxenlight)
|
||||
XEN_libxenstat = $(XEN_ROOT)/tools/xenstat/libxenstat/src
|
||||
|
||||
CFLAGS_xeninclude = -I$(XEN_INCLUDE)
|
||||
|
||||
@@ -108,11 +107,6 @@ ifeq ($(CONFIG_Linux),y)
|
||||
LDLIBS_libxenstore += -ldl
|
||||
endif
|
||||
|
||||
CFLAGS_libxenstat = -I$(XEN_libxenstat)
|
||||
SHDEPS_libxenstat = $(SHLIB_libxenctrl) $(SHLIB_libxenstore)
|
||||
LDLIBS_libxenstat = $(SHDEPS_libxenstat) $(XEN_libxenstat)/libxenstat$(libextension)
|
||||
SHLIB_libxenstat = $(SHDEPS_libxenstat) -Wl,-rpath-link=$(XEN_libxenstat)
|
||||
|
||||
ifeq ($(debug),y)
|
||||
# Disable optimizations
|
||||
CFLAGS += -O0 -fno-omit-frame-pointer
|
||||
|
||||
@@ -13,6 +13,7 @@ SUBDIRS-y += ctrl
|
||||
SUBDIRS-y += guest
|
||||
SUBDIRS-y += hypfs
|
||||
SUBDIRS-y += store
|
||||
SUBDIRS-y += stat
|
||||
SUBDIRS-$(CONFIG_Linux) += vchan
|
||||
|
||||
ifeq ($(CONFIG_RUMP),y)
|
||||
|
||||
File renamed without changes.
@@ -15,85 +15,24 @@
|
||||
XEN_ROOT=$(CURDIR)/../../..
|
||||
include $(XEN_ROOT)/tools/Rules.mk
|
||||
|
||||
LDCONFIG=ldconfig
|
||||
MAKE_LINK=ln -sf
|
||||
CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninclude) -include $(XEN_ROOT)/tools/config.h
|
||||
|
||||
MAJOR=4.15
|
||||
MINOR=0
|
||||
SRCS-y += xenstat.c
|
||||
SRCS-y += xenstat_qmp.c
|
||||
SRCS-$(CONFIG_Linux) += xenstat_linux.c
|
||||
SRCS-$(CONFIG_SunOS) += xenstat_solaris.c
|
||||
SRCS-$(CONFIG_NetBSD) += xenstat_netbsd.c
|
||||
SRCS-$(CONFIG_FreeBSD) += xenstat_freebsd.c
|
||||
|
||||
LIB=src/libxenstat.a
|
||||
SHLIB=src/libxenstat.so.$(MAJOR).$(MINOR)
|
||||
SHLIB_LINKS=src/libxenstat.so.$(MAJOR) src/libxenstat.so
|
||||
OBJECTS-y=src/xenstat.o src/xenstat_qmp.o
|
||||
OBJECTS-$(CONFIG_Linux) += src/xenstat_linux.o
|
||||
OBJECTS-$(CONFIG_SunOS) += src/xenstat_solaris.o
|
||||
OBJECTS-$(CONFIG_NetBSD) += src/xenstat_netbsd.o
|
||||
OBJECTS-$(CONFIG_FreeBSD) += src/xenstat_freebsd.o
|
||||
SONAME_FLAGS=-Wl,$(SONAME_LDFLAG) -Wl,libxenstat.so.$(MAJOR)
|
||||
|
||||
CFLAGS+=-fPIC -Werror
|
||||
CFLAGS+=-Isrc $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninclude) -include $(XEN_ROOT)/tools/config.h
|
||||
|
||||
LDLIBS-y = $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) -lyajl
|
||||
LDLIBS-y += -lyajl
|
||||
LDLIBS-$(CONFIG_SunOS) += -lkstat
|
||||
APPEND_LDFLAGS += $(LDLIBS-y)
|
||||
|
||||
PKG_CONFIG := xenstat.pc
|
||||
PKG_CONFIG_NAME := Xenstat
|
||||
PKG_CONFIG_DESC := The Xenstat library for Xen hypervisor
|
||||
PKG_CONFIG_VERSION := $(MAJOR).$(MINOR)
|
||||
PKG_CONFIG_USELIBS := $(SHLIB_libxenstat)
|
||||
PKG_CONFIG_LIB := xenstat
|
||||
PKG_CONFIG_REQPRIV := xencontrol,xenstore
|
||||
include $(XEN_ROOT)/tools/libs/libs.mk
|
||||
|
||||
ifneq ($(CONFIG_LIBXC_MINIOS),y)
|
||||
PKG_CONFIG_INST := $(PKG_CONFIG)
|
||||
$(PKG_CONFIG_INST): PKG_CONFIG_PREFIX = $(prefix)
|
||||
$(PKG_CONFIG_INST): PKG_CONFIG_INCDIR = $(includedir)
|
||||
$(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR = $(libdir)
|
||||
endif
|
||||
$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenstat)/include
|
||||
|
||||
PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc))
|
||||
|
||||
$(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT)
|
||||
$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenstat)
|
||||
$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR)
|
||||
|
||||
.PHONY: all
|
||||
all: $(LIB) $(SHLIB) $(SHLIB_LINKS) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL)
|
||||
|
||||
$(OBJECTS-y): src/_paths.h
|
||||
|
||||
$(LIB): $(OBJECTS-y)
|
||||
$(AR) rc $@ $^
|
||||
$(RANLIB) $@
|
||||
|
||||
$(SHLIB): $(OBJECTS-y)
|
||||
$(CC) $(LDFLAGS) $(SONAME_FLAGS) $(SHLIB_LDFLAGS) -o $@ \
|
||||
$(OBJECTS-y) $(LDLIBS-y) $(APPEND_LDFLAGS)
|
||||
|
||||
src/libxenstat.so.$(MAJOR): $(SHLIB)
|
||||
$(MAKE_LINK) $(<F) $@
|
||||
|
||||
src/libxenstat.so: src/libxenstat.so.$(MAJOR)
|
||||
$(MAKE_LINK) $(<F) $@
|
||||
|
||||
.PHONY: install
|
||||
install: all
|
||||
$(INSTALL_DATA) src/xenstat.h $(DESTDIR)$(includedir)
|
||||
$(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/libxenstat.a
|
||||
$(INSTALL_PROG) src/libxenstat.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
|
||||
ln -sf libxenstat.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenstat.so.$(MAJOR)
|
||||
ln -sf libxenstat.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenstat.so
|
||||
$(INSTALL_DATA) xenstat.pc $(DESTDIR)$(PKG_INSTALLDIR)
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xenstat.pc
|
||||
rm -f $(DESTDIR)$(libdir)/libxenstat.so
|
||||
rm -f $(DESTDIR)$(libdir)/libxenstat.so.$(MAJOR)
|
||||
rm -f $(DESTDIR)$(libdir)/libxenstat.so.$(MAJOR).$(MINOR)
|
||||
rm -f $(DESTDIR)$(libdir)/libxenstat.a
|
||||
rm -f $(DESTDIR)$(includedir)/xenstat.h
|
||||
$(LIB_OBJS): _paths.h
|
||||
|
||||
PYLIB=bindings/swig/python/_xenstat.so
|
||||
PYMOD=bindings/swig/python/xenstat.py
|
||||
@@ -114,9 +53,9 @@ install-bindings: install-perl-bindings install-python-bindings
|
||||
.PHONY: uninstall-bindings
|
||||
uninstall-bindings: uninstall-perl-bindings uninstall-python-bindings
|
||||
|
||||
$(BINDINGS): $(SHLIB) $(SHLIB_LINKS) src/xenstat.h
|
||||
$(BINDINGS): $(SHLIB) $(SHLIB_LINKS) include/xenstat.h
|
||||
|
||||
SWIG_FLAGS=-module xenstat -Isrc
|
||||
SWIG_FLAGS=-module xenstat -Iinclude -I.
|
||||
|
||||
# Python bindings
|
||||
PYTHON_VERSION=$(PYTHON:python%=%)
|
||||
@@ -180,16 +119,14 @@ install: install-perl-bindings
|
||||
uninstall: uninstall-perl-bindings
|
||||
endif
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f $(LIB) $(SHLIB) $(SHLIB_LINKS) $(OBJECTS-y) \
|
||||
$(BINDINGS) $(BINDINGSRC) $(DEPS_RM) src/_paths.h
|
||||
rm -f xenstat.pc
|
||||
clean: cleanlocal
|
||||
|
||||
.PHONY: distclean
|
||||
distclean: clean
|
||||
.PHONY: cleanlocal
|
||||
cleanlocal:
|
||||
rm -f $(BINDINGS) $(BINDINGSRC) $(DEPS_RM) _paths.h
|
||||
rm -f libxenstat.map
|
||||
|
||||
-include $(DEPS_INCLUDE)
|
||||
|
||||
genpath-target = $(call buildmakevars2header,src/_paths.h)
|
||||
genpath-target = $(call buildmakevars2header,_paths.h)
|
||||
$(eval $(genpath-target))
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -71,6 +71,9 @@ unsigned long long xenstat_node_tot_mem(xenstat_node * node);
|
||||
/* Get amount of free memory on a node */
|
||||
unsigned long long xenstat_node_free_mem(xenstat_node * node);
|
||||
|
||||
/* Get amount of freeable memory on a node */
|
||||
long xenstat_node_freeable_mb(xenstat_node * node);
|
||||
|
||||
/* Find the number of domains existing on a node */
|
||||
unsigned int xenstat_node_num_domains(xenstat_node * node);
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -64,7 +64,7 @@ static const char PROCNETDEV_HEADER[] =
|
||||
|
||||
/* We need to get the name of the bridge interface for use with bonding interfaces */
|
||||
/* Use excludeName parameter to avoid adding bridges we don't care about, eg. virbr0 */
|
||||
void getBridge(char *excludeName, char *result, size_t resultLen)
|
||||
static void getBridge(char *excludeName, char *result, size_t resultLen)
|
||||
{
|
||||
struct dirent *de;
|
||||
DIR *d;
|
||||
@@ -89,7 +89,7 @@ void getBridge(char *excludeName, char *result, size_t resultLen)
|
||||
|
||||
/* parseNetLine provides regular expression based parsing for lines from /proc/net/dev, all the */
|
||||
/* information are parsed but not all are used in our case, ie. for xenstat */
|
||||
int parseNetDevLine(char *line, char *iface, unsigned long long *rxBytes, unsigned long long *rxPackets,
|
||||
static int parseNetDevLine(char *line, char *iface, unsigned long long *rxBytes, unsigned long long *rxPackets,
|
||||
unsigned long long *rxErrs, unsigned long long *rxDrops, unsigned long long *rxFifo,
|
||||
unsigned long long *rxFrames, unsigned long long *rxComp, unsigned long long *rxMcast,
|
||||
unsigned long long *txBytes, unsigned long long *txPackets, unsigned long long *txErrs,
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -24,3 +24,5 @@ LIBS_LIBS += store
|
||||
USELIBS_store := toolcore
|
||||
LIBS_LIBS += vchan
|
||||
USELIBS_vchan := toollog store gnttab evtchn
|
||||
LIBS_LIBS += stat
|
||||
USELIBS_stat := ctrl store
|
||||
@@ -1,10 +0,0 @@
|
||||
XEN_ROOT = $(CURDIR)/../..
|
||||
include $(XEN_ROOT)/tools/Rules.mk
|
||||
|
||||
SUBDIRS :=
|
||||
SUBDIRS += libxenstat
|
||||
SUBDIRS += xentop
|
||||
|
||||
.PHONY: all install clean distclean uninstall
|
||||
|
||||
all install clean distclean uninstall: %: subdirs-%
|
||||
@@ -10,7 +10,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
XEN_ROOT=$(CURDIR)/../../..
|
||||
XEN_ROOT=$(CURDIR)/../..
|
||||
include $(XEN_ROOT)/tools/Rules.mk
|
||||
|
||||
ifneq ($(XENSTAT_XENTOP),y)
|
||||
File renamed without changes.
File renamed without changes.