From nobody Tue Feb 10 04:14:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1598176017; cv=none; d=zohomail.com; s=zohoarc; b=aQoOzDQq4yUf1pibcz/4IQbqPdyc5EoiNh+REzDqOLLg/q6owTKUS1/muU4GNmggp8SbOh9fom2gSarUdG7SS0AcLnmSsVT7yMLrHibe4mpYYVcjkH6GyO3AAAcwDuZKEP46+t7rpzd90H08t37mW8BBnEOPZJsXch7GnkPSdEs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598176017; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DeBo21FYCnIQimlPmyup0XEquX5HXht43Qex1maTeQ0=; b=Ctuml9y+U/dGL57r/+LLRsbJ+15AaJLQc9PipEnnr34PxGjUias/JjAWPHikbsx+8uIlkm2VmgOi1nrjkmb8kFVr6q1wB3rSWTza6UedX63jAtngERZ2y5loH3waddnwdCSrp8JLZn9juve20pmSoIuDaLOanzyBbKjUyEvqKHw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1598176017349936.7097528062718; Sun, 23 Aug 2020 02:46:57 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9maF-0008Br-Hl; Sun, 23 Aug 2020 09:46:39 +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 1k9mQb-0004t9-Tw for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:41 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 40544d03-8f5f-4fb8-a53a-b5e25912074c; Sun, 23 Aug 2020 09:35:29 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5BA0CADD6; Sun, 23 Aug 2020 09:35:57 +0000 (UTC) X-Inumbo-ID: 40544d03-8f5f-4fb8-a53a-b5e25912074c X-Virus-Scanned: by amavisd-new at test-mx.suse.de 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 v3 30/38] tools: split libxenstat into new tools/libs/stat directory Date: Sun, 23 Aug 2020 11:35:11 +0200 Message-Id: <20200823093519.18386-31-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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" Content-Type: text/plain; charset="utf-8" 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 =3D> libs/stat}/COPYING | 0 .../libxenstat =3D> libs/stat}/Makefile | 100 ++++-------------- .../stat}/bindings/swig/perl/.empty | 0 .../stat}/bindings/swig/python/.empty | 0 .../stat}/bindings/swig/xenstat.i | 0 .../src =3D> libs/stat/include}/xenstat.h | 3 + .../libxenstat/src =3D> libs/stat}/xenstat.c | 0 .../libxenstat =3D> libs/stat}/xenstat.pc.in | 2 +- .../src =3D> libs/stat}/xenstat_freebsd.c | 0 .../src =3D> libs/stat}/xenstat_linux.c | 4 +- .../src =3D> libs/stat}/xenstat_netbsd.c | 0 .../src =3D> libs/stat}/xenstat_priv.h | 0 .../src =3D> libs/stat}/xenstat_qmp.c | 0 .../src =3D> libs/stat}/xenstat_solaris.c | 0 tools/libs/uselibs.mk | 2 + tools/xenstat/Makefile | 10 -- tools/{xenstat =3D> }/xentop/Makefile | 2 +- tools/{xenstat =3D> }/xentop/TODO | 0 tools/{xenstat =3D> }/xentop/xentop.c | 0 23 files changed, 37 insertions(+), 103 deletions(-) rename tools/{xenstat/libxenstat =3D> libs/stat}/COPYING (100%) rename tools/{xenstat/libxenstat =3D> libs/stat}/Makefile (55%) rename tools/{xenstat/libxenstat =3D> libs/stat}/bindings/swig/perl/.empty= (100%) rename tools/{xenstat/libxenstat =3D> libs/stat}/bindings/swig/python/.emp= ty (100%) rename tools/{xenstat/libxenstat =3D> libs/stat}/bindings/swig/xenstat.i (= 100%) rename tools/{xenstat/libxenstat/src =3D> libs/stat/include}/xenstat.h (98= %) rename tools/{xenstat/libxenstat/src =3D> libs/stat}/xenstat.c (100%) rename tools/{xenstat/libxenstat =3D> libs/stat}/xenstat.pc.in (82%) rename tools/{xenstat/libxenstat/src =3D> libs/stat}/xenstat_freebsd.c (10= 0%) rename tools/{xenstat/libxenstat/src =3D> libs/stat}/xenstat_linux.c (98%) rename tools/{xenstat/libxenstat/src =3D> libs/stat}/xenstat_netbsd.c (100= %) rename tools/{xenstat/libxenstat/src =3D> libs/stat}/xenstat_priv.h (100%) rename tools/{xenstat/libxenstat/src =3D> libs/stat}/xenstat_qmp.c (100%) rename tools/{xenstat/libxenstat/src =3D> libs/stat}/xenstat_solaris.c (10= 0%) delete mode 100644 tools/xenstat/Makefile rename tools/{xenstat =3D> }/xentop/Makefile (97%) rename tools/{xenstat =3D> }/xentop/TODO (100%) rename tools/{xenstat =3D> }/xentop/xentop.c (100%) diff --git a/.gitignore b/.gitignore index b7171ff2eb..44abbc7e43 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) +=3D xcutils SUBDIRS-$(CONFIG_X86) +=3D firmware SUBDIRS-y +=3D console SUBDIRS-y +=3D xenmon -SUBDIRS-y +=3D xenstat +SUBDIRS-y +=3D xentop SUBDIRS-$(CONFIG_NetBSD) +=3D xenbackendd SUBDIRS-y +=3D libfsimage SUBDIRS-$(CONFIG_Linux) +=3D vchan diff --git a/tools/Rules.mk b/tools/Rules.mk index c5f7cd26e0..241e8e7d9a 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -18,7 +18,6 @@ include $(XEN_ROOT)/tools/libs/uselibs.mk XEN_libxenlight =3D $(XEN_ROOT)/tools/libxl # Currently libxlutil lives in the same directory as libxenlight XEN_libxlutil =3D $(XEN_libxenlight) -XEN_libxenstat =3D $(XEN_ROOT)/tools/xenstat/libxenstat/src =20 CFLAGS_xeninclude =3D -I$(XEN_INCLUDE) =20 @@ -108,11 +107,6 @@ ifeq ($(CONFIG_Linux),y) LDLIBS_libxenstore +=3D -ldl endif =20 -CFLAGS_libxenstat =3D -I$(XEN_libxenstat) -SHDEPS_libxenstat =3D $(SHLIB_libxenctrl) $(SHLIB_libxenstore) -LDLIBS_libxenstat =3D $(SHDEPS_libxenstat) $(XEN_libxenstat)/libxenstat$(= libextension) -SHLIB_libxenstat =3D $(SHDEPS_libxenstat) -Wl,-rpath-link=3D$(XEN_libxen= stat) - ifeq ($(debug),y) # Disable optimizations CFLAGS +=3D -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 +=3D ctrl SUBDIRS-y +=3D guest SUBDIRS-y +=3D hypfs SUBDIRS-y +=3D store +SUBDIRS-y +=3D stat SUBDIRS-$(CONFIG_Linux) +=3D vchan =20 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 55% rename from tools/xenstat/libxenstat/Makefile rename to tools/libs/stat/Makefile index b5e623b155..5463f5f7ca 100644 --- a/tools/xenstat/libxenstat/Makefile +++ b/tools/libs/stat/Makefile @@ -15,80 +15,24 @@ XEN_ROOT=3D$(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk =20 -LDCONFIG=3Dldconfig -MAKE_LINK=3Dln -sf - -MAJOR=3D4.15 -MINOR=3D0 - -LIB=3Dsrc/libxenstat.a -SHLIB=3Dsrc/libxenstat.so.$(MAJOR).$(MINOR) -SHLIB_LINKS=3Dsrc/libxenstat.so.$(MAJOR) src/libxenstat.so -OBJECTS-y=3Dsrc/xenstat.o src/xenstat_qmp.o -OBJECTS-$(CONFIG_Linux) +=3D src/xenstat_linux.o -OBJECTS-$(CONFIG_SunOS) +=3D src/xenstat_solaris.o -OBJECTS-$(CONFIG_NetBSD) +=3D src/xenstat_netbsd.o -OBJECTS-$(CONFIG_FreeBSD) +=3D src/xenstat_freebsd.o -SONAME_FLAGS=3D-Wl,$(SONAME_LDFLAG) -Wl,libxenstat.so.$(MAJOR) - -CFLAGS+=3D-fPIC -Werror -CFLAGS+=3D-Isrc $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninc= lude) -include $(XEN_ROOT)/tools/config.h - -LDLIBS-y =3D $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) -lyajl -LDLIBS-$(CONFIG_SunOS) +=3D -lkstat - -PKG_CONFIG :=3D xenstat.pc -PKG_CONFIG_VERSION :=3D $(MAJOR).$(MINOR) - -ifneq ($(CONFIG_LIBXC_MINIOS),y) -PKG_CONFIG_INST :=3D $(PKG_CONFIG) -$(PKG_CONFIG_INST): PKG_CONFIG_PREFIX =3D $(prefix) -$(PKG_CONFIG_INST): PKG_CONFIG_INCDIR =3D $(includedir) -$(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR =3D $(libdir) -endif - -PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) +CFLAGS +=3D $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninclude= ) -include $(XEN_ROOT)/tools/config.h =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX =3D $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenstat) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) +SRCS-y +=3D xenstat.c +SRCS-y +=3D xenstat_qmp.c +SRCS-$(CONFIG_Linux) +=3D xenstat_linux.c +SRCS-$(CONFIG_SunOS) +=3D xenstat_solaris.c +SRCS-$(CONFIG_NetBSD) +=3D xenstat_netbsd.c +SRCS-$(CONFIG_FreeBSD) +=3D xenstat_freebsd.c =20 -.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) +LDLIBS-y +=3D -lyajl +LDLIBS-$(CONFIG_SunOS) +=3D -lkstat +APPEND_LDFLAGS +=3D $(LDLIBS-y) =20 -src/libxenstat.so.$(MAJOR): $(SHLIB) - $(MAKE_LINK) $(