Skip to content

Commit a3f2b32

Browse files
author
Shane Snyder
committed
add checks for libuuid to darshan-util configure
1 parent 31f45f2 commit a3f2b32

File tree

7 files changed

+34
-14
lines changed

7 files changed

+34
-14
lines changed

darshan-runtime/lib/darshan-core.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2645,9 +2645,7 @@ void *darshan_core_register_record(
26452645
size_t rec_size,
26462646
struct darshan_fs_info *fs_info)
26472647
{
2648-
struct darshan_core_name_record_ref *ref;
26492648
void *rec_buf;
2650-
int ret;
26512649

26522650
__DARSHAN_CORE_LOCK();
26532651
if(!__darshan_core)

darshan-util/Makefile.am

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ bin_PROGRAMS = darshan-analyzer \
6464

6565
noinst_PROGRAMS = jenkins-hash-gen
6666

67-
# LIBS += @LIBBZ2@
68-
6967
jenkins_hash_gen_SOURCES = jenkins-hash-gen.c lookup3.c
7068
jenkins_hash_gen_LDADD = libdarshan-util.la
7169

darshan-util/configure.ac

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ if test "x$enable_darshan_util" = xyes ; then
4040
# bz2 is optional
4141
CHECK_BZLIB
4242

43+
# uuid headers/library are optional dependencies for DAOS modules
44+
AC_CHECK_HEADER([uuid/uuid.h],
45+
[AC_CHECK_LIB([uuid], [uuid_unparse])])
46+
4347
# checks to see how we can print 64 bit values on this architecture
4448
gt_INTTYPES_PRI
4549
if test "x$PRI_MACROS_BROKEN" = x1 ; then

darshan-util/darshan-daos-logutils.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
#include "darshan-logutils.h"
1818

19+
#ifdef HAVE_LIBUUID
20+
#include <uuid/uuid.h>
21+
#endif
22+
1923
/* counter name strings for the DAOS module */
2024
#define X(a) #a,
2125
char *daos_counter_names[] = {
@@ -209,14 +213,22 @@ static void darshan_log_print_daos_object(void *object_rec, char *object_name,
209213
struct darshan_daos_object *daos_object_rec =
210214
(struct darshan_daos_object *)object_rec;
211215
char oid[64];
212-
char pool_cont_uuid_str[128];
216+
char pool_cont_uuid_str[128] = {0};
213217

214218
sprintf(oid, "%lu.%lu", daos_object_rec->oid_hi, daos_object_rec->oid_lo);
215219
object_name = oid;
216220

221+
#ifdef HAVE_LIBUUID
217222
uuid_unparse(daos_object_rec->pool_uuid, pool_cont_uuid_str);
223+
#else
224+
strcat(pool_cont_uuid_str, "N/A");
225+
#endif
218226
strcat(pool_cont_uuid_str, ":");
227+
#ifdef HAVE_LIBUUID
219228
uuid_unparse(daos_object_rec->cont_uuid, pool_cont_uuid_str+strlen(pool_cont_uuid_str));
229+
#else
230+
strcat(pool_cont_uuid_str, "N/A");
231+
#endif
220232

221233
mnt_pt = pool_cont_uuid_str;
222234
fs_type = "N/A";

darshan-util/darshan-dfs-logutils.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
#include "darshan-logutils.h"
1818

19+
#ifdef HAVE_LIBUUID
20+
#include <uuid/uuid.h>
21+
#endif
22+
1923
/* counter name strings for the DFS module */
2024
#define X(a) #a,
2125
char *dfs_counter_names[] = {
@@ -206,11 +210,19 @@ static void darshan_log_print_dfs_file(void *file_rec, char *file_name,
206210
int i;
207211
struct darshan_dfs_file *dfs_file_rec =
208212
(struct darshan_dfs_file *)file_rec;
209-
char pool_cont_uuid_str[128];
213+
char pool_cont_uuid_str[128] = {0};
210214

215+
#ifdef HAVE_LIBUUID
211216
uuid_unparse(dfs_file_rec->pool_uuid, pool_cont_uuid_str);
217+
#else
218+
strcat(pool_cont_uuid_str, "N/A");
219+
#endif
212220
strcat(pool_cont_uuid_str, ":");
221+
#ifdef HAVE_LIBUUID
213222
uuid_unparse(dfs_file_rec->cont_uuid, pool_cont_uuid_str+strlen(pool_cont_uuid_str));
223+
#else
224+
strcat(pool_cont_uuid_str, "N/A");
225+
#endif
214226

215227
mnt_pt = pool_cont_uuid_str;
216228
fs_type = "N/A";

include/darshan-daos-log-format.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#ifndef __DARSHAN_DAOS_LOG_FORMAT_H
77
#define __DARSHAN_DAOS_LOG_FORMAT_H
88

9-
#include <uuid/uuid.h>
10-
119
/* current DAOS log format version */
1210
#define DARSHAN_DAOS_VER 1
1311

@@ -173,8 +171,8 @@ struct darshan_daos_object
173171
struct darshan_base_record base_rec;
174172
int64_t counters[DAOS_NUM_INDICES];
175173
double fcounters[DAOS_F_NUM_INDICES];
176-
uuid_t pool_uuid;
177-
uuid_t cont_uuid;
174+
unsigned char pool_uuid[16];
175+
unsigned char cont_uuid[16];
178176
uint64_t oid_hi;
179177
uint64_t oid_lo;
180178
};

include/darshan-dfs-log-format.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#ifndef __DARSHAN_DFS_LOG_FORMAT_H
77
#define __DARSHAN_DFS_LOG_FORMAT_H
88

9-
#include <uuid/uuid.h>
10-
119
/* current DFS log format version */
1210
#define DARSHAN_DFS_VER 1
1311

@@ -150,8 +148,8 @@ struct darshan_dfs_file
150148
struct darshan_base_record base_rec;
151149
int64_t counters[DFS_NUM_INDICES];
152150
double fcounters[DFS_F_NUM_INDICES];
153-
uuid_t pool_uuid;
154-
uuid_t cont_uuid;
151+
unsigned char pool_uuid[16];
152+
unsigned char cont_uuid[16];
155153
};
156154

157155
#endif /* __DARSHAN_DFS_LOG_FORMAT_H */

0 commit comments

Comments
 (0)