Commit b989ffe4 authored by Shane Snyder's avatar Shane Snyder

integrate new darshan-diff util in mmap branch

parent cc498bfa
all: libdarshan-util.a darshan-null-logutils.o darshan-analyzer darshan-convert darshan-parser darshan-stitch-logs jenkins-hash-gen all: libdarshan-util.a darshan-null-logutils.o darshan-analyzer darshan-convert darshan-diff darshan-parser darshan-stitch-logs jenkins-hash-gen
DESTDIR = DESTDIR =
srcdir = @srcdir@ srcdir = @srcdir@
...@@ -98,10 +98,8 @@ darshan-analyzer: darshan-analyzer.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) $( ...@@ -98,10 +98,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 darshan-convert: darshan-convert.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) libdarshan-util.a lookup3.o | uthash-1.9.2
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS) $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
#darshan-diff: darshan-diff.o $(DARSHAN_LOG_FORMAT) darshan-logutils.o darshan-logutils.h 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) $< darshan-logutils.o -o $@ $(LIBS) $(CC) $(CFLAGS) $(LDFLAGS) $< libdarshan-util.a -o $@ $(LIBS)
#darshan-diff.o: darshan-diff.c
# $(CC) $(CFLAGS) -c $< -o $@
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 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) $^ -o $@ $(LIBS) $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
......
This diff is collapsed.
...@@ -81,6 +81,13 @@ struct darshan_mod_logutil_funcs ...@@ -81,6 +81,13 @@ struct darshan_mod_logutil_funcs
void *agg_rec, void *agg_rec,
int init_flag int init_flag
); );
/* 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[]; extern struct darshan_mod_logutil_funcs *mod_logutils[];
......
...@@ -35,13 +35,16 @@ static int darshan_log_put_posix_file(darshan_fd fd, void* posix_buf); ...@@ -35,13 +35,16 @@ static int darshan_log_put_posix_file(darshan_fd fd, void* posix_buf);
static void darshan_log_print_posix_file(void *file_rec, static void darshan_log_print_posix_file(void *file_rec,
char *file_name, char *mnt_pt, char *fs_type); char *file_name, char *mnt_pt, char *fs_type);
static void darshan_log_agg_posix_files(void *rec, void *agg_rec, int init_flag); static void darshan_log_agg_posix_files(void *rec, void *agg_rec, int init_flag);
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 = struct darshan_mod_logutil_funcs posix_logutils =
{ {
.log_get_record = &darshan_log_get_posix_file, .log_get_record = &darshan_log_get_posix_file,
.log_put_record = &darshan_log_put_posix_file, .log_put_record = &darshan_log_put_posix_file,
.log_print_record = &darshan_log_print_posix_file, .log_print_record = &darshan_log_print_posix_file,
.log_agg_records = &darshan_log_agg_posix_files .log_agg_records = &darshan_log_agg_posix_files,
.log_print_diff = &darshan_log_print_posix_file_diff
}; };
static int darshan_log_get_posix_file(darshan_fd fd, void* posix_buf) static int darshan_log_get_posix_file(darshan_fd fd, void* posix_buf)
...@@ -297,6 +300,78 @@ static void darshan_log_agg_posix_files(void *rec, void *agg_rec, int init_flag) ...@@ -297,6 +300,78 @@ static void darshan_log_agg_posix_files(void *rec, void *agg_rec, int init_flag)
return; 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->base_rec.rank, file1->base_rec.id, posix_counter_names[i],
file1->counters[i], file_name1, "", "");
}
else if(!file1)
{
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD],
file2->base_rec.rank, file2->base_rec.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->base_rec.rank, file1->base_rec.id, posix_counter_names[i],
file1->counters[i], file_name1, "", "");
printf("+ ");
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD],
file2->base_rec.rank, file2->base_rec.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->base_rec.rank, file1->base_rec.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->base_rec.rank, file2->base_rec.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->base_rec.rank, file1->base_rec.id, posix_f_counter_names[i],
file1->fcounters[i], file_name1, "", "");
printf("+ ");
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD],
file2->base_rec.rank, file2->base_rec.id, posix_f_counter_names[i],
file2->fcounters[i], file_name2, "", "");
}
}
return;
}
/* /*
* Local variables: * Local variables:
* c-indent-level: 4 * 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