Skip to content

Commit

Permalink
add checks for libuuid to darshan-util configure
Browse files Browse the repository at this point in the history
  • Loading branch information
shanedsnyder committed Nov 6, 2024
1 parent 31f45f2 commit a3f2b32
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 14 deletions.
2 changes: 0 additions & 2 deletions darshan-runtime/lib/darshan-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions darshan-util/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions darshan-util/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 13 additions & 1 deletion darshan-util/darshan-daos-logutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

#include "darshan-logutils.h"

#ifdef HAVE_LIBUUID
#include <uuid/uuid.h>
#endif

/* counter name strings for the DAOS module */
#define X(a) #a,
char *daos_counter_names[] = {
Expand Down Expand Up @@ -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";
Expand Down
14 changes: 13 additions & 1 deletion darshan-util/darshan-dfs-logutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

#include "darshan-logutils.h"

#ifdef HAVE_LIBUUID
#include <uuid/uuid.h>
#endif

/* counter name strings for the DFS module */
#define X(a) #a,
char *dfs_counter_names[] = {
Expand Down Expand Up @@ -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";
Expand Down
6 changes: 2 additions & 4 deletions include/darshan-daos-log-format.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#ifndef __DARSHAN_DAOS_LOG_FORMAT_H
#define __DARSHAN_DAOS_LOG_FORMAT_H

#include <uuid/uuid.h>

/* current DAOS log format version */
#define DARSHAN_DAOS_VER 1

Expand Down Expand Up @@ -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;
};
Expand Down
6 changes: 2 additions & 4 deletions include/darshan-dfs-log-format.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#ifndef __DARSHAN_DFS_LOG_FORMAT_H
#define __DARSHAN_DFS_LOG_FORMAT_H

#include <uuid/uuid.h>

/* current DFS log format version */
#define DARSHAN_DFS_VER 1

Expand Down Expand Up @@ -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 */

0 comments on commit a3f2b32

Please sign in to comment.