darshan-posix-logutils.h 921 Bytes
Newer Older
Shane Snyder's avatar
Shane Snyder committed
1
/*
Shane Snyder's avatar
Shane Snyder committed
2 3 4
 * Copyright (C) 2015 University of Chicago.
 * See COPYRIGHT notice in top-level directory.
 *
Shane Snyder's avatar
Shane Snyder committed
5 6 7 8 9 10 11 12
 */

#ifndef __DARSHAN_POSIX_LOG_UTILS_H
#define __DARSHAN_POSIX_LOG_UTILS_H

#include "darshan-logutils.h"
#include "darshan-posix-log-format.h"

13 14 15
extern char *posix_counter_names[];
extern char *posix_f_counter_names[];

Shane Snyder's avatar
Shane Snyder committed
16 17
int darshan_log_get_posix_file(darshan_fd fd, struct darshan_posix_file *file);

18 19 20 21 22 23 24 25 26 27 28 29
#define POSIX_COUNTER_PRINT(__file_rec, __counter) do { \
    printf("%" PRId64 "\t%" PRIu64 "\t%s\t%" PRId64 "\n", \
        (__file_rec)->rank, (__file_rec)->f_id, posix_counter_names[__counter], \
        (__file_rec)->counters[__counter]); \
} while(0)

#define POSIX_F_COUNTER_PRINT(__file_rec, __counter) do { \
    printf("%" PRId64 "\t%" PRIu64 "\t%s\t%f\n", \
        (__file_rec)->rank, (__file_rec)->f_id, posix_f_counter_names[__counter], \
        (__file_rec)->fcounters[__counter]); \
} while(0)

Shane Snyder's avatar
Shane Snyder committed
30
#endif