Commit 991aaa2f authored by Shane Snyder's avatar Shane Snyder
Browse files

refactor file desciptor in logutils

parent 200e9d71
This diff is collapsed.
...@@ -17,31 +17,23 @@ ...@@ -17,31 +17,23 @@
#include "darshan-log-format.h" #include "darshan-log-format.h"
/* TODO: can we refactor this def out of header? modules currently poke at swap_flag struct darshan_fd_int_state;
* directly, but other than that there's no reason for another module to know this
* definition. /* darshan file descriptor definition */
struct darshan_fd_s struct darshan_fd_s
{ {
int fildes; /* log file version */
int o_flags;
int64_t pos;
enum darshan_comp_type comp_type;
char logfile_path[PATH_MAX];
char version[8]; char version[8];
/* flag indicating whether byte swapping needs to be
* performed on log file data */
int swap_flag; int swap_flag;
char *exe_mnt_data; /* log file offset/length maps for each log file region */
struct darshan_log_map job_map; struct darshan_log_map job_map;
struct darshan_log_map rec_map; struct darshan_log_map rec_map;
struct darshan_log_map mod_map[DARSHAN_MAX_MODS]; struct darshan_log_map mod_map[DARSHAN_MAX_MODS];
int err;
/* KEEP OUT -- remaining state hidden in logutils source */
/* XXX */ struct darshan_fd_int_state *state;
void *dz_strm;
int dz_size;
unsigned char *dz_buf;
int dz_eor;
int dz_prev_reg_id;
}; };
typedef struct darshan_fd_s* darshan_fd; typedef struct darshan_fd_s* darshan_fd;
...@@ -51,17 +43,23 @@ struct darshan_record_ref ...@@ -51,17 +43,23 @@ struct darshan_record_ref
UT_hash_handle hlink; UT_hash_handle hlink;
}; };
/* functions to be implemented by each module for integration with
* darshan log file utilities (e.g., parser & convert tools)
struct darshan_mod_logutil_funcs struct darshan_mod_logutil_funcs
{ {
/* retrieve a single module record from the log file */
int (*log_get_record)( int (*log_get_record)(
darshan_fd fd, darshan_fd fd,
void* buf, void* buf,
darshan_record_id* rec_id darshan_record_id* rec_id
); );
/* put a single module record into the log file */
int (*log_put_record)( int (*log_put_record)(
darshan_fd fd, darshan_fd fd,
void *buf void *buf
); );
/* print the counters for a given log file record */
void (*log_print_record)( void (*log_print_record)(
void *file_rec, void *file_rec,
char *file_name, char *file_name,
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