Commit b5bba287 authored by Shane Snyder's avatar Shane Snyder

add the darshan-diff utility back

parent 72937c9a
all: libdarshan-util.a darshan-null-logutils.o darshan-analyzer darshan-convert darshan-parser jenkins-hash-gen
all: libdarshan-util.a darshan-null-logutils.o darshan-analyzer darshan-convert darshan-diff darshan-parser jenkins-hash-gen
DESTDIR =
srcdir = @srcdir@
......@@ -99,10 +99,8 @@ darshan-analyzer: darshan-analyzer.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) $(
darshan-convert: darshan-convert.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) libdarshan-util.a lookup3.o | uthash-1.9.2
$(CC) $(CFLAGS) $(LDFLAGS) $< lookup3.o libdarshan-util.a -o $@ $(LIBS)
#darshan-diff: darshan-diff.o $(DARSHAN_LOG_FORMAT) darshan-logutils.o darshan-logutils.h
# $(CC) $(CFLAGS) $(LDFLAGS) $< darshan-logutils.o -o $@ $(LIBS)
#darshan-diff.o: darshan-diff.c
# $(CC) $(CFLAGS) -c $< -o $@
darshan-diff: darshan-diff.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) $(DARSHAN_MOD_LOGUTIL_HEADERS) $(DARSHAN_MOD_LOG_FORMATS) libdarshan-util.a | uthash-1.9.2
$(CC) $(CFLAGS) $(LDFLAGS) $< libdarshan-util.a -o $@ $(LIBS)
darshan-parser: darshan-parser.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) $(DARSHAN_MOD_LOGUTIL_HEADERS) $(DARSHAN_MOD_LOG_FORMATS) libdarshan-util.a | uthash-1.9.2
$(CC) $(CFLAGS) $(LDFLAGS) $< libdarshan-util.a -o $@ $(LIBS)
......@@ -120,7 +118,7 @@ install:: all
install -d $(pkgconfigdir)
install -m 755 darshan-analyzer $(bindir)
install -m 755 darshan-convert $(bindir)
# install -m 755 darshan-diff $(bindir)
install -m 755 darshan-diff $(bindir)
install -m 755 darshan-parser $(bindir)
install -m 755 $(srcdir)/darshan-summary-per-file.sh $(bindir)
install -m 755 libdarshan-util.a $(libdir)
......
This diff is collapsed.
......@@ -91,6 +91,13 @@ struct darshan_mod_logutil_funcs
);
/* print module-specific description of I/O characterization data */
void (*log_print_description)(void);
/* print a text diff of 2 module I/O records */
void (*log_print_diff)(
void *rec1,
char *name1,
void *rec2,
char *name2
);
};
extern struct darshan_mod_logutil_funcs *mod_logutils[];
......
......@@ -36,13 +36,16 @@ static int darshan_log_put_posix_file(darshan_fd fd, void* posix_buf, int ver);
static void darshan_log_print_posix_file(void *file_rec,
char *file_name, char *mnt_pt, char *fs_type, int ver);
static void darshan_log_print_posix_description(void);
static void darshan_log_print_posix_file_diff(void *file_rec1, char *file_name1,
void *file_rec2, char *file_name2);
struct darshan_mod_logutil_funcs posix_logutils =
{
.log_get_record = &darshan_log_get_posix_file,
.log_put_record = &darshan_log_put_posix_file,
.log_print_record = &darshan_log_print_posix_file,
.log_print_description = &darshan_log_print_posix_description
.log_print_description = &darshan_log_print_posix_description,
.log_print_diff = &darshan_log_print_posix_file_diff
};
static int darshan_log_get_posix_file(darshan_fd fd, void* posix_buf,
......@@ -149,6 +152,78 @@ static void darshan_log_print_posix_description()
return;
}
static void darshan_log_print_posix_file_diff(void *file_rec1, char *file_name1,
void *file_rec2, char *file_name2)
{
struct darshan_posix_file *file1 = (struct darshan_posix_file *)file_rec1;
struct darshan_posix_file *file2 = (struct darshan_posix_file *)file_rec2;
int i;
/* NOTE: we assume that both input records are the same module format version */
for(i=0; i<POSIX_NUM_INDICES; i++)
{
if(!file2)
{
printf("- ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD],
file1->rank, file1->f_id, posix_counter_names[i],
file1->counters[i], file_name1, "", "");
}
else if(!file1)
{
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD],
file2->rank, file2->f_id, posix_counter_names[i],
file2->counters[i], file_name2, "", "");
}
else if(file1->counters[i] != file2->counters[i])
{
printf("- ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD],
file1->rank, file1->f_id, posix_counter_names[i],
file1->counters[i], file_name1, "", "");
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD],
file2->rank, file2->f_id, posix_counter_names[i],
file2->counters[i], file_name2, "", "");
}
}
for(i=0; i<POSIX_F_NUM_INDICES; i++)
{
if(!file2)
{
printf("- ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD],
file1->rank, file1->f_id, posix_f_counter_names[i],
file1->fcounters[i], file_name1, "", "");
}
else if(!file1)
{
printf("+ ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD],
file2->rank, file2->f_id, posix_f_counter_names[i],
file2->fcounters[i], file_name2, "", "");
}
else if(file1->fcounters[i] != file2->fcounters[i])
{
printf("- ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD],
file1->rank, file1->f_id, posix_f_counter_names[i],
file1->fcounters[i], file_name1, "", "");
printf("+ ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD],
file2->rank, file2->f_id, posix_f_counter_names[i],
file2->fcounters[i], file_name2, "", "");
}
}
return;
}
/*
* Local variables:
* c-indent-level: 4
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment