From patchwork Fri Aug 28 15:07:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11743153 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C5BA613A4 for ; Fri, 28 Aug 2020 15:09:31 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9B7452075B for ; Fri, 28 Aug 2020 15:09:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B7452075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kBfzW-00059I-0Q; Fri, 28 Aug 2020 15:08:34 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kBfzV-0004eG-61 for xen-devel@lists.xenproject.org; Fri, 28 Aug 2020 15:08:33 +0000 X-Inumbo-ID: d2b9f8f5-10dd-4235-992a-71adaff343ad Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id d2b9f8f5-10dd-4235-992a-71adaff343ad; Fri, 28 Aug 2020 15:07:56 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id F155DAFBE; Fri, 28 Aug 2020 15:08:26 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v4 22/31] tools: split libxenstat into new tools/libs/stat directory Date: Fri, 28 Aug 2020 17:07:38 +0200 Message-Id: <20200828150747.25305-23-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200828150747.25305-1-jgross@suse.com> References: <20200828150747.25305-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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 Acked-by: Wei Liu --- .gitignore | 8 +- tools/Makefile | 2 +- tools/Rules.mk | 6 - tools/libs/Makefile | 1 + .../{xenstat/libxenstat => libs/stat}/COPYING | 0 .../libxenstat => libs/stat}/Makefile | 105 ++++-------------- .../stat}/bindings/swig/perl/.empty | 0 .../stat}/bindings/swig/python/.empty | 0 .../stat}/bindings/swig/xenstat.i | 0 .../src => libs/stat/include}/xenstat.h | 3 + .../libxenstat/src => libs/stat}/xenstat.c | 0 .../src => libs/stat}/xenstat_freebsd.c | 0 .../src => libs/stat}/xenstat_linux.c | 4 +- .../src => libs/stat}/xenstat_netbsd.c | 0 .../src => libs/stat}/xenstat_priv.h | 0 .../src => libs/stat}/xenstat_qmp.c | 0 .../src => libs/stat}/xenstat_solaris.c | 0 tools/libs/uselibs.mk | 2 + tools/xenstat/Makefile | 10 -- tools/{xenstat => }/xentop/Makefile | 2 +- tools/{xenstat => }/xentop/TODO | 0 tools/{xenstat => }/xentop/xentop.c | 0 22 files changed, 36 insertions(+), 107 deletions(-) rename tools/{xenstat/libxenstat => libs/stat}/COPYING (100%) rename tools/{xenstat/libxenstat => libs/stat}/Makefile (54%) rename tools/{xenstat/libxenstat => libs/stat}/bindings/swig/perl/.empty (100%) rename tools/{xenstat/libxenstat => libs/stat}/bindings/swig/python/.empty (100%) rename tools/{xenstat/libxenstat => libs/stat}/bindings/swig/xenstat.i (100%) rename tools/{xenstat/libxenstat/src => libs/stat/include}/xenstat.h (98%) rename tools/{xenstat/libxenstat/src => libs/stat}/xenstat.c (100%) rename tools/{xenstat/libxenstat/src => libs/stat}/xenstat_freebsd.c (100%) rename tools/{xenstat/libxenstat/src => libs/stat}/xenstat_linux.c (98%) rename tools/{xenstat/libxenstat/src => libs/stat}/xenstat_netbsd.c (100%) rename tools/{xenstat/libxenstat/src => libs/stat}/xenstat_priv.h (100%) rename tools/{xenstat/libxenstat/src => libs/stat}/xenstat_qmp.c (100%) rename tools/{xenstat/libxenstat/src => libs/stat}/xenstat_solaris.c (100%) delete mode 100644 tools/xenstat/Makefile rename tools/{xenstat => }/xentop/Makefile (97%) rename tools/{xenstat => }/xentop/TODO (100%) rename tools/{xenstat => }/xentop/xentop.c (100%) diff --git a/.gitignore b/.gitignore index 364b09506b..5e8c47e2db 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/tools/Makefile b/tools/Makefile index 0db01707a4..ea69675cca 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -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 diff --git a/tools/Rules.mk b/tools/Rules.mk index 071fe364a3..fc121d0d75 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -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 diff --git a/tools/libs/Makefile b/tools/libs/Makefile index 756d059ee7..e8fcd59214 100644 --- a/tools/libs/Makefile +++ b/tools/libs/Makefile @@ -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) diff --git a/tools/xenstat/libxenstat/COPYING b/tools/libs/stat/COPYING similarity index 100% rename from tools/xenstat/libxenstat/COPYING rename to tools/libs/stat/COPYING diff --git a/tools/xenstat/libxenstat/Makefile b/tools/libs/stat/Makefile similarity index 54% rename from tools/xenstat/libxenstat/Makefile rename to tools/libs/stat/Makefile index bdd5a0f469..5463f5f7ca 100644 --- a/tools/xenstat/libxenstat/Makefile +++ b/tools/libs/stat/Makefile @@ -15,85 +15,24 @@ XEN_ROOT=$(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk -LDCONFIG=ldconfig -MAKE_LINK=ln -sf - -MAJOR=4.15 -MINOR=0 - -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-$(CONFIG_SunOS) += -lkstat - -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 - -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 := $(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) +CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninclude) -include $(XEN_ROOT)/tools/config.h -.PHONY: all -all: $(LIB) $(SHLIB) $(SHLIB_LINKS) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) - -$(OBJECTS-y): src/_paths.h - -$(LIB): $(OBJECTS-y) - $(AR) rc $@ $^ - $(RANLIB) $@ +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 -$(SHLIB): $(OBJECTS-y) - $(CC) $(LDFLAGS) $(SONAME_FLAGS) $(SHLIB_LDFLAGS) -o $@ \ - $(OBJECTS-y) $(LDLIBS-y) $(APPEND_LDFLAGS) +LDLIBS-y += -lyajl +LDLIBS-$(CONFIG_SunOS) += -lkstat +APPEND_LDFLAGS += $(LDLIBS-y) -src/libxenstat.so.$(MAJOR): $(SHLIB) - $(MAKE_LINK) $(