From a3f2b32e57170b76ab897b1e05b76011dfb22799 Mon Sep 17 00:00:00 2001 From: Shane Snyder Date: Wed, 6 Nov 2024 14:20:52 -0600 Subject: [PATCH] add checks for libuuid to darshan-util configure --- darshan-runtime/lib/darshan-core.c | 2 -- darshan-util/Makefile.am | 2 -- darshan-util/configure.ac | 4 ++++ darshan-util/darshan-daos-logutils.c | 14 +++++++++++++- darshan-util/darshan-dfs-logutils.c | 14 +++++++++++++- include/darshan-daos-log-format.h | 6 ++---- include/darshan-dfs-log-format.h | 6 ++---- 7 files changed, 34 insertions(+), 14 deletions(-) diff --git a/darshan-runtime/lib/darshan-core.c b/darshan-runtime/lib/darshan-core.c index e2031e2c9..96f31ec18 100644 --- a/darshan-runtime/lib/darshan-core.c +++ b/darshan-runtime/lib/darshan-core.c @@ -2645,9 +2645,7 @@ void *darshan_core_register_record( size_t rec_size, struct darshan_fs_info *fs_info) { - struct darshan_core_name_record_ref *ref; void *rec_buf; - int ret; __DARSHAN_CORE_LOCK(); if(!__darshan_core) diff --git a/darshan-util/Makefile.am b/darshan-util/Makefile.am index 36f6e1710..1132b94de 100644 --- a/darshan-util/Makefile.am +++ b/darshan-util/Makefile.am @@ -64,8 +64,6 @@ bin_PROGRAMS = darshan-analyzer \ noinst_PROGRAMS = jenkins-hash-gen -# LIBS += @LIBBZ2@ - jenkins_hash_gen_SOURCES = jenkins-hash-gen.c lookup3.c jenkins_hash_gen_LDADD = libdarshan-util.la diff --git a/darshan-util/configure.ac b/darshan-util/configure.ac index bdec8d7a2..26764d0b0 100644 --- a/darshan-util/configure.ac +++ b/darshan-util/configure.ac @@ -40,6 +40,10 @@ if test "x$enable_darshan_util" = xyes ; then # bz2 is optional CHECK_BZLIB + # uuid headers/library are optional dependencies for DAOS modules + AC_CHECK_HEADER([uuid/uuid.h], + [AC_CHECK_LIB([uuid], [uuid_unparse])]) + # checks to see how we can print 64 bit values on this architecture gt_INTTYPES_PRI if test "x$PRI_MACROS_BROKEN" = x1 ; then diff --git a/darshan-util/darshan-daos-logutils.c b/darshan-util/darshan-daos-logutils.c index f7622ad07..2b0f8b693 100644 --- a/darshan-util/darshan-daos-logutils.c +++ b/darshan-util/darshan-daos-logutils.c @@ -16,6 +16,10 @@ #include "darshan-logutils.h" +#ifdef HAVE_LIBUUID +#include +#endif + /* counter name strings for the DAOS module */ #define X(a) #a, char *daos_counter_names[] = { @@ -209,14 +213,22 @@ static void darshan_log_print_daos_object(void *object_rec, char *object_name, struct darshan_daos_object *daos_object_rec = (struct darshan_daos_object *)object_rec; char oid[64]; - char pool_cont_uuid_str[128]; + char pool_cont_uuid_str[128] = {0}; sprintf(oid, "%lu.%lu", daos_object_rec->oid_hi, daos_object_rec->oid_lo); object_name = oid; +#ifdef HAVE_LIBUUID uuid_unparse(daos_object_rec->pool_uuid, pool_cont_uuid_str); +#else + strcat(pool_cont_uuid_str, "N/A"); +#endif strcat(pool_cont_uuid_str, ":"); +#ifdef HAVE_LIBUUID uuid_unparse(daos_object_rec->cont_uuid, pool_cont_uuid_str+strlen(pool_cont_uuid_str)); +#else + strcat(pool_cont_uuid_str, "N/A"); +#endif mnt_pt = pool_cont_uuid_str; fs_type = "N/A"; diff --git a/darshan-util/darshan-dfs-logutils.c b/darshan-util/darshan-dfs-logutils.c index 4b6c5b4b7..87f00b828 100644 --- a/darshan-util/darshan-dfs-logutils.c +++ b/darshan-util/darshan-dfs-logutils.c @@ -16,6 +16,10 @@ #include "darshan-logutils.h" +#ifdef HAVE_LIBUUID +#include +#endif + /* counter name strings for the DFS module */ #define X(a) #a, char *dfs_counter_names[] = { @@ -206,11 +210,19 @@ static void darshan_log_print_dfs_file(void *file_rec, char *file_name, int i; struct darshan_dfs_file *dfs_file_rec = (struct darshan_dfs_file *)file_rec; - char pool_cont_uuid_str[128]; + char pool_cont_uuid_str[128] = {0}; +#ifdef HAVE_LIBUUID uuid_unparse(dfs_file_rec->pool_uuid, pool_cont_uuid_str); +#else + strcat(pool_cont_uuid_str, "N/A"); +#endif strcat(pool_cont_uuid_str, ":"); +#ifdef HAVE_LIBUUID uuid_unparse(dfs_file_rec->cont_uuid, pool_cont_uuid_str+strlen(pool_cont_uuid_str)); +#else + strcat(pool_cont_uuid_str, "N/A"); +#endif mnt_pt = pool_cont_uuid_str; fs_type = "N/A"; diff --git a/include/darshan-daos-log-format.h b/include/darshan-daos-log-format.h index d9aa699ef..09fda153c 100644 --- a/include/darshan-daos-log-format.h +++ b/include/darshan-daos-log-format.h @@ -6,8 +6,6 @@ #ifndef __DARSHAN_DAOS_LOG_FORMAT_H #define __DARSHAN_DAOS_LOG_FORMAT_H -#include - /* current DAOS log format version */ #define DARSHAN_DAOS_VER 1 @@ -173,8 +171,8 @@ struct darshan_daos_object struct darshan_base_record base_rec; int64_t counters[DAOS_NUM_INDICES]; double fcounters[DAOS_F_NUM_INDICES]; - uuid_t pool_uuid; - uuid_t cont_uuid; + unsigned char pool_uuid[16]; + unsigned char cont_uuid[16]; uint64_t oid_hi; uint64_t oid_lo; }; diff --git a/include/darshan-dfs-log-format.h b/include/darshan-dfs-log-format.h index 803d822c1..38fc0979e 100644 --- a/include/darshan-dfs-log-format.h +++ b/include/darshan-dfs-log-format.h @@ -6,8 +6,6 @@ #ifndef __DARSHAN_DFS_LOG_FORMAT_H #define __DARSHAN_DFS_LOG_FORMAT_H -#include - /* current DFS log format version */ #define DARSHAN_DFS_VER 1 @@ -150,8 +148,8 @@ struct darshan_dfs_file struct darshan_base_record base_rec; int64_t counters[DFS_NUM_INDICES]; double fcounters[DFS_F_NUM_INDICES]; - uuid_t pool_uuid; - uuid_t cont_uuid; + unsigned char pool_uuid[16]; + unsigned char cont_uuid[16]; }; #endif /* __DARSHAN_DFS_LOG_FORMAT_H */