Whamcloud - gitweb
LU-16502 lutf: add proper config option and fix bugs 00/53200/3
authorTimothy Day <timday@amazon.com>
Tue, 21 Nov 2023 19:19:24 +0000 (19:19 +0000)
committerOleg Drokin <green@whamcloud.com>
Wed, 20 Dec 2023 01:57:08 +0000 (01:57 +0000)
LUTF did not have a proper configuration option. Since
no message was printed at configure time, this made it
hard to debug why LUTF was not being built.

Fix a few minor bugs in headers that prevented shared
libraries from being `import`ed by python.

Fix a small Clang error in liblutf_agent.c.

Test-Parameters: @lnet
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I6680b203bef08b7afa326a1cbe30c96b5c29e95c
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53200
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
config/lustre-build.m4
libcfs/include/libcfs/util/string.h
lnet/include/uapi/linux/lnet/nidstr.h
lustre/tests/lutf/src/liblutf_agent.c

index df3b81c..68b623b 100644 (file)
@@ -222,20 +222,11 @@ AC_MSG_RESULT([$enable_utils])
 ]) # LB_CONFIG_UTILS
 
 #
-# LB_CONFIG_TESTS
-#
-# Build tests?
-#
-AC_DEFUN([LB_CONFIG_TESTS], [
-AC_MSG_CHECKING([whether to build Lustre tests])
-AC_ARG_ENABLE([tests],
-       AS_HELP_STRING([--disable-tests],
-               [disable building of Lustre tests]),
-       [], [enable_tests="yes"])
-
+# LB_CONFIG_LUTF
 #
-# Check to see if we can build the lutf
+# Build LNet Unit Test Framework?
 #
+AC_DEFUN([LB_CONFIG_LUTF], [
 AX_PYTHON_DEVEL()
 AS_IF([test "x$enable_dist" != xno], [
        enable_lutf="yes"
@@ -247,7 +238,25 @@ AS_IF([test "x$enable_dist" != xno], [
                         [ enable_lutf="no" ])
   ])
 ])
+AC_ARG_ENABLE([lutf],
+       AS_HELP_STRING([--disable-lutf],
+               [disable building of LUTF]),
+       [], [enable_lutf="yes"])
+AC_MSG_CHECKING([whether to build LUTF (LNet Unit Test Framework)])
+AC_MSG_RESULT([$enable_lutf])
+]) # LB_CONFIG_LUTF
 
+#
+# LB_CONFIG_TESTS
+#
+# Build Lustre/LNet regression tests?
+#
+AC_DEFUN([LB_CONFIG_TESTS], [
+AC_MSG_CHECKING([whether to build Lustre tests])
+AC_ARG_ENABLE([tests],
+       AS_HELP_STRING([--disable-tests],
+               [disable building of Lustre tests]),
+       [], [enable_tests="yes"])
 AC_MSG_RESULT([$enable_tests])
 ]) # LB_CONFIG_TESTS
 
@@ -614,6 +623,7 @@ LB_CONFIG_DOCS
 LB_CONFIG_MANPAGES
 LB_CONFIG_UTILS
 LB_CONFIG_TESTS
+LB_CONFIG_LUTF
 LC_CONFIG_CLIENT
 LB_CONFIG_MPITESTS
 LB_CONFIG_SERVERS
index dcfe29e..97edf59 100644 (file)
@@ -126,7 +126,6 @@ int cfs_expr_list_values(struct cfs_expr_list *expr_list, int max, __u32 **valpp
 int cfs_gettok(struct cfs_lstr *next, char delim, struct cfs_lstr *res);
 int cfs_str2num_check(char *str, int nob, unsigned *num,
                      unsigned min, unsigned max);
-int cfs_human_readable2long(unsigned long *sizep, char *str);
 int cfs_expr2str(struct list_head *list, char *str, size_t size);
 int cfs_expr_list_print(char *buffer, int count,
                        struct cfs_expr_list *expr_list);
index bfa17fd..58cf09d 100644 (file)
@@ -96,7 +96,9 @@ static inline char *libcfs_nidstr(const struct lnet_nid *nid)
 }
 
 int libcfs_strnid(struct lnet_nid *nid, const char *str);
+#ifdef __KERNEL__
 char *libcfs_idstr(struct lnet_processid *id);
+#endif
 __u32 libcfs_str2net(const char *str);
 lnet_nid_t libcfs_str2nid(const char *str);
 int libcfs_str2anynid(lnet_nid_t *nid, const char *str);
index 6597383..4f024ed 100644 (file)
@@ -547,7 +547,7 @@ out:
 lutf_rc_t lutf_send_rpc(char *agent, char *yaml, int timeout, char **rsp)
 {
        lutf_rc_t rc = EN_LUTF_RC_RPC_FAIL;
-       lutf_agent_blk_t *agent_blk;
+       lutf_agent_blk_t *agent_blk = NULL;
        char *default_rsp;
        lutf_message_hdr_t hdr;
        char *recvBuf = NULL;