From e0613df4027003c51cf1be0a84edbd5ffadd36d5 Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Tue, 21 Nov 2023 19:19:24 +0000 Subject: [PATCH] LU-16502 lutf: add proper config option and fix bugs 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 Change-Id: I6680b203bef08b7afa326a1cbe30c96b5c29e95c Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53200 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Shaun Tancheff Reviewed-by: Frank Sehr Reviewed-by: Oleg Drokin --- config/lustre-build.m4 | 34 ++++++++++++++++++++++------------ libcfs/include/libcfs/util/string.h | 1 - lnet/include/uapi/linux/lnet/nidstr.h | 2 ++ lustre/tests/lutf/src/liblutf_agent.c | 2 +- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index df3b81c..68b623b 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -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 diff --git a/libcfs/include/libcfs/util/string.h b/libcfs/include/libcfs/util/string.h index dcfe29e..97edf59 100644 --- a/libcfs/include/libcfs/util/string.h +++ b/libcfs/include/libcfs/util/string.h @@ -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); diff --git a/lnet/include/uapi/linux/lnet/nidstr.h b/lnet/include/uapi/linux/lnet/nidstr.h index bfa17fd..58cf09d 100644 --- a/lnet/include/uapi/linux/lnet/nidstr.h +++ b/lnet/include/uapi/linux/lnet/nidstr.h @@ -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); diff --git a/lustre/tests/lutf/src/liblutf_agent.c b/lustre/tests/lutf/src/liblutf_agent.c index 6597383..4f024ed 100644 --- a/lustre/tests/lutf/src/liblutf_agent.c +++ b/lustre/tests/lutf/src/liblutf_agent.c @@ -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; -- 1.8.3.1