Commit 3f30b9ba authored by Philip Carns's avatar Philip Carns

stub in tracker structure for aio_write64 example


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@759 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 45e9d26c
......@@ -60,6 +60,8 @@ struct cp_access_counter
int freq;
};
struct darshan_io_tracker;
/* in memory structure to keep up with file level data */
struct darshan_file_runtime
{
......@@ -80,6 +82,8 @@ struct darshan_file_runtime
double last_mpi_read_end;
double last_posix_meta_end;
double last_mpi_meta_end;
struct darshan_aio_tracker* aio_list_head;
struct darshan_aio_tracker* aio_list_tail;
};
/* handles used by various APIs to refer to files */
......
......@@ -117,6 +117,14 @@ static int my_rank = -1;
static struct stat64 cp_stat_buf;
static int darshan_mem_alignment = 1;
/* struct to track information about aio operations in flight */
struct darshan_aio_tracker
{
double tm1;
struct aio_cb *aiocbp;
struct darshan_aio_tracker* next;
};
/* these are paths that we will not trace */
static char* exclusions[] = {
"/etc/",
......@@ -1085,12 +1093,37 @@ int DARSHAN_DECL(lio_listio64)(int mode, struct aiocb *const aiocb_list[],
int DARSHAN_DECL(aio_write64)(struct aiocb *aiocbp)
{
int ret;
struct darshan_aio_tracker* tracker;
struct darshan_file_runtime* file;
MAP_OR_FAIL(aio_write64);
printf("TESTING: wrapped aio_write64()\n");
ret = __real_aio_write64(aiocbp);
if(ret == 0)
{
file = darshan_file_by_fd(aiocbp->aio_fildes);
if(file)
{
tracker = malloc(sizeof(*tracker));
if(tracker)
{
tracker->tm1 = darshan_wtime();
tracker->aiocbp = aiocbp;
tracker->next = NULL;
if(file->aio_list_tail)
{
file->aio_list_tail->next = tracker;
file->aio_list_tail = tracker;
}
else
{
file->aio_list_head = file->aio_list_tail = tracker;
}
}
}
}
return(ret);
}
......
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