Whamcloud - gitweb
LU-1425 build: make Lustre build ready for gcov
authorArtem Blagodarenko <artem_blagodarenko@xyratex.com>
Mon, 21 May 2012 13:49:38 +0000 (17:49 +0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 6 Sep 2012 14:22:58 +0000 (10:22 -0400)
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 <alexey_lyashkov@xyratex.com>
Reviewed-by: Alexander Boyko <alexander_boyko@xyratex.com>
Signed-off-by: Artem Blagodarenko <artem_blagodarenko@xyratex.com>
Change-Id: If5c1742f3263faf48c2c5d8457c1af36a29408d4
Reviewed-on: http://review.whamcloud.com/2844
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Brian J. Murrell <brian@whamcloud.com>
libcfs/libcfs/posix/posix-debug.c
lnet/utils/Makefile.am
lnet/utils/lstclient.c
lustre/liblustre/Makefile.am
lustre/liblustre/lutil.c
lustre/tests/Makefile.am
lustre/tests/mpi/Makefile.am
lustre/utils/Makefile.am
lustre/utils/lfs.c

index c91eb7b..0d16d26 100644 (file)
@@ -42,6 +42,8 @@
 #include <libcfs/libcfs.h>
 
 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 <sys/utsname.h>
index ce257d2..9f28a28 100644 (file)
@@ -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 =
index e440b41..e6c9659 100644 (file)
@@ -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[] =
 {
index 34fe48d..4aa8e67 100644 (file)
@@ -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
 
index 68ed5f7..4d03caf 100644 (file)
@@ -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;
 
index c8dd697..0836686 100644 (file)
@@ -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
index 5fc673f..9344098 100644 (file)
@@ -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)
index a6aeb9f..dcf340f 100644 (file)
@@ -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
index bcfab94..436a341 100644 (file)
@@ -78,8 +78,6 @@
 #include <libcfs/libcfsutil.h>
 #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);