From: Artem Blagodarenko Date: Mon, 21 May 2012 13:49:38 +0000 (+0400) Subject: LU-1425 build: make Lustre build ready for gcov X-Git-Tag: 2.3.51~142 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=bfb38a047e0fc12e68a7aa3a2d2ec7a6e9d696ed LU-1425 build: make Lustre build ready for gcov gcov requires profiled code to be built with compiler options -fprofile-arcs -ftest-coverage. To profile all project this options should be passed during every source file compilation. This option enable debug logging. No all Lustre parts are ready for debug logging now. To patch adds debug librarias where needed and resolve linking conflicts. Do not influence when no -fprofile-arcs -ftest-coverage compile options are passed. Xyratex-bug-id: MRP-526 Reviewed-by: Alexey Lyashkov Reviewed-by: Alexander Boyko Signed-off-by: Artem Blagodarenko Change-Id: If5c1742f3263faf48c2c5d8457c1af36a29408d4 Reviewed-on: http://review.whamcloud.com/2844 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Brian J. Murrell --- diff --git a/libcfs/libcfs/posix/posix-debug.c b/libcfs/libcfs/posix/posix-debug.c index c91eb7b..0d16d26 100644 --- a/libcfs/libcfs/posix/posix-debug.c +++ b/libcfs/libcfs/posix/posix-debug.c @@ -42,6 +42,8 @@ #include static char debug_file_name[1024]; +unsigned int libcfs_subsystem_debug = ~(S_LNET | S_LND); +unsigned int libcfs_debug = 0; #ifdef HAVE_NETDB_H #include diff --git a/lnet/utils/Makefile.am b/lnet/utils/Makefile.am index ce257d2..9f28a28 100644 --- a/lnet/utils/Makefile.am +++ b/lnet/utils/Makefile.am @@ -38,6 +38,7 @@ #COMPILE = $(CC) -Wall -g -I$(srcdir)/../include -I../../include #LINK = $(CC) -o $@ +LIBCFS= $(top_builddir)/libcfs/libcfs/libcfs.a LIBCFSUTIL= $(top_builddir)/libcfs/libcfs/libcfsutil.a if LIBLUSTRE @@ -69,7 +70,7 @@ endif wirecheck_SOURCES = wirecheck.c ptlctl_SOURCES = ptlctl.c -ptlctl_LDADD = -L. -lptlctl $(LIBCFSUTIL) $(LIBREADLINE) $(LIBEFENCE) +ptlctl_LDADD = -L. -lptlctl $(LIBCFSUTIL) $(LIBCFS) $(LIBREADLINE) $(LIBEFENCE) ptlctl_DEPENDENCIES = libptlctl.a routerstat_SOURCES = routerstat.c @@ -79,7 +80,7 @@ debugctl_LDADD = -L. -lptlctl $(LIBCFSUTIL) $(LIBREADLINE) $(LIBEFENCE) debugctl_DEPENDENCIES = libptlctl.a lst_SOURCES = lst.c -lst_LDADD = -L. -lptlctl $(LIBCFSUTIL) $(LIBREADLINE) $(LIBEFENCE) +lst_LDADD = -L. -lptlctl $(LIBCFSUTIL) $(LIBCFS) $(LIBREADLINE) $(LIBEFENCE) lst_DEPENDENCIES = libptlctl.a LND_LIBS = diff --git a/lnet/utils/lstclient.c b/lnet/utils/lstclient.c index e440b41..e6c9659 100644 --- a/lnet/utils/lstclient.c +++ b/lnet/utils/lstclient.c @@ -49,8 +49,6 @@ static int lstjn_stopping = 0; static int lstjn_intialized = 0; -unsigned int libcfs_subsystem_debug = ~0 - (S_LNET | S_LND); -unsigned int libcfs_debug = 0; static struct option lstjn_options[] = { diff --git a/lustre/liblustre/Makefile.am b/lustre/liblustre/Makefile.am index 34fe48d..4aa8e67 100644 --- a/lustre/liblustre/Makefile.am +++ b/lustre/liblustre/Makefile.am @@ -28,8 +28,7 @@ LND_LIBS += $(top_builddir)/lnet/ulnds/socklnd/libsocklnd.a endif LNET_LIBS = $(top_builddir)/lnet/utils/libuptlctl.a \ - $(top_builddir)/lnet/lnet/liblnet.a \ - $(top_builddir)/libcfs/libcfs/libcfsutil.a + $(top_builddir)/lnet/lnet/liblnet.a SYSIO_LIBS = $(SYSIO)/lib/libsysio.a diff --git a/lustre/liblustre/lutil.c b/lustre/liblustre/lutil.c index 68ed5f7..4d03caf 100644 --- a/lustre/liblustre/lutil.c +++ b/lustre/liblustre/lutil.c @@ -61,8 +61,6 @@ #include "lutil.h" -unsigned int libcfs_subsystem_debug = ~0 - (S_LNET | S_LND); -unsigned int libcfs_debug = 0; struct task_struct *current; diff --git a/lustre/tests/Makefile.am b/lustre/tests/Makefile.am index c8dd697..0836686 100644 --- a/lustre/tests/Makefile.am +++ b/lustre/tests/Makefile.am @@ -1,3 +1,5 @@ +LIBCFS := $(top_builddir)/libcfs/libcfs/libcfs.a + # Lustre test Makefile AM_CPPFLAGS = $(LLCPPFLAGS) -I/opt/lam/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS AM_CFLAGS = $(LLCFLAGS) @@ -73,11 +75,13 @@ endif # TESTS mmap_sanity_SOURCES= mmap_sanity.c LIBLUSTREAPI := $(top_builddir)/lustre/utils/liblustreapi.a -multiop_LDADD=$(LIBLUSTREAPI) -lrt $(PTHREAD_LIBS) -copytool_LDADD=$(LIBLUSTREAPI) +multiop_LDADD=$(LIBLUSTREAPI) -lrt $(PTHREAD_LIBS) $(LIBCFS) +copytool_LDADD=$(LIBLUSTREAPI) $(LIBCFS) +it_test_LDADD=$(LIBCFS) +rwv_LDADD=$(LIBCFS) ll_dirstripe_verify_SOURCES= ll_dirstripe_verify.c -ll_dirstripe_verify_LDADD= -L$(top_builddir)/lustre/utils -llustreapi +ll_dirstripe_verify_LDADD= -L$(top_builddir)/lustre/utils -llustreapi $(LIBCFS) flocks_test_SOURCES=flocks_test.c flocks_test_LDADD=-lpthread diff --git a/lustre/tests/mpi/Makefile.am b/lustre/tests/mpi/Makefile.am index 5fc673f..9344098 100644 --- a/lustre/tests/mpi/Makefile.am +++ b/lustre/tests/mpi/Makefile.am @@ -1,6 +1,7 @@ # Lustre MPI test Makefile AM_CPPFLAGS = $(LLCPPFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS AM_CFLAGS = $(LLCFLAGS) +LIBCFS := $(top_builddir)/libcfs/libcfs/libcfs.a CC = @MPICC_WRAPPER@ @@ -16,4 +17,4 @@ parallel_grouplock_SOURCES=parallel_grouplock.c lp_utils.c lp_utils.h cascading_rw_SOURCES=cascading_rw.c lp_utils.c lp_utils.h cascading_rw_LDADD=-L$(top_builddir)/lustre/utils -llustreapi mdsrate_SOURCES=mdsrate.c -mdsrate_LDADD=-L$(top_builddir)/lustre/utils -llustreapi +mdsrate_LDADD=-L$(top_builddir)/lustre/utils -llustreapi $(LIBCFS) diff --git a/lustre/utils/Makefile.am b/lustre/utils/Makefile.am index a6aeb9f..dcf340f 100644 --- a/lustre/utils/Makefile.am +++ b/lustre/utils/Makefile.am @@ -8,7 +8,9 @@ AM_CFLAGS=$(LLCFLAGS) AM_CPPFLAGS=$(LLCPPFLAGS) -DLUSTRE_UTILS=1 AM_LDFLAGS := -L$(top_builddir)/lnet/utils -LIBPTLCTL := $(top_builddir)/lnet/utils/libptlctl.a $(top_builddir)/libcfs/libcfs/libcfsutil.a +LIBPTLCTL := $(top_builddir)/lnet/utils/libptlctl.a \ + $(top_builddir)/libcfs/libcfs/libcfsutil.a \ + $(top_builddir)/libcfs/libcfs/libcfs.a sbin_scripts = lrun bin_scripts = llstat llobdstat plot-llstat llbackup diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index bcfab94..436a341 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -78,8 +78,6 @@ #include #include "obdctl.h" -unsigned int libcfs_subsystem_debug = 0; - /* all functions */ static int lfs_setstripe(int argc, char **argv); static int lfs_find(int argc, char **argv);