Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
darshan
darshan
Commits
196eae16
Commit
196eae16
authored
Jul 09, 2020
by
Shane Snyder
Browse files
Merge branch 'master' into 'python-package'
# Conflicts: # darshan-util/darshan-logutils.c
parents
a1da405c
e714fec8
Changes
6
Hide whitespace changes
Inline
Side-by-side
darshan-runtime/darshan-common.h
View file @
196eae16
...
...
@@ -95,8 +95,8 @@
if(*(int64_t *)__vals == 0) break; \
for(i_=0; i_<4; i_++) { \
if(__add_flag && \
!memcmp(__val_p + (i_ * __val_size), \
__vals, sizeof(*__vals) * __val_size)) { \
!memcmp(__val_p + (i_ *
(
__val_size)
)
, \
__vals, sizeof(*__vals) *
(
__val_size))
)
{ \
total_count += *(__cnt_p + i_); \
break; \
} \
...
...
@@ -107,9 +107,9 @@
for(i_=0; i_ < 4; i_++) { \
if((*(__cnt_p + i_) > total_count) || \
((*(__cnt_p + i_) == total_count) && \
(*(__val_p + (i_ * __val_size)) > *(int64_t *)__vals))) { \
memcpy(&tmp_val[tmp_ndx * __val_size], __val_p + (i_ * __val_size), \
sizeof(*__vals) * __val_size); \
(*(__val_p + (i_ *
(
__val_size))
)
> *(int64_t *)__vals))) { \
memcpy(&tmp_val[tmp_ndx *
(
__val_size
)
], __val_p + (i_ *
(
__val_size)
)
, \
sizeof(*__vals) *
(
__val_size)
)
; \
tmp_cnt[tmp_ndx] = *(__cnt_p + i_); \
tmp_ndx++; \
} \
...
...
@@ -117,21 +117,21 @@
} \
if(tmp_ndx == 4) break;
/* all done, updated counter is not added */
\
/* next, add the updated counter */
\
memcpy(&tmp_val[tmp_ndx * __val_size], __vals, sizeof(*__vals) * __val_size); \
memcpy(&tmp_val[tmp_ndx *
(
__val_size
)
], __vals, sizeof(*__vals) *
(
__val_size)
)
; \
tmp_cnt[tmp_ndx] = total_count; \
tmp_ndx++; \
/* last, copy over any remaining counters to make sure we have 4 sets total */
\
while(tmp_ndx != 4) { \
if(memcmp(__val_p + (i_ * __val_size), \
__vals, sizeof(*__vals) * __val_size)) { \
memcpy(&tmp_val[tmp_ndx * __val_size], __val_p + (i_ * __val_size), \
sizeof(*__vals) * __val_size); \
if(memcmp(__val_p + (i_ *
(
__val_size)
)
, \
__vals, sizeof(*__vals) *
(
__val_size))
)
{ \
memcpy(&tmp_val[tmp_ndx *
(
__val_size
)
], __val_p + (i_ *
(
__val_size)
)
, \
sizeof(*__vals) *
(
__val_size)
)
; \
tmp_cnt[tmp_ndx] = *(__cnt_p + i_); \
tmp_ndx++; \
} \
i_++; \
} \
memcpy(__val_p, tmp_val, 4*sizeof(int64_t)*__val_size); \
memcpy(__val_p, tmp_val, 4*sizeof(int64_t)*
(
__val_size)
)
; \
memcpy(__cnt_p, tmp_cnt, 4*sizeof(int64_t)); \
} while(0)
...
...
darshan-runtime/lib/darshan-core.c
View file @
196eae16
...
...
@@ -2036,7 +2036,8 @@ static void darshan_core_cleanup(struct darshan_core_runtime* core)
#endif
#ifdef HAVE_MPI
PMPI_Comm_free
(
&
core
->
mpi_comm
);
if
(
using_mpi
)
PMPI_Comm_free
(
&
core
->
mpi_comm
);
#endif
if
(
core
->
comp_buf
)
...
...
darshan-runtime/lib/darshan-posix.c
View file @
196eae16
...
...
@@ -25,6 +25,7 @@
#include <libgen.h>
#include <aio.h>
#include <pthread.h>
#include <limits.h>
#include "utlist.h"
#include "darshan.h"
...
...
@@ -42,6 +43,8 @@ typedef int64_t off64_t;
DARSHAN_FORWARD_DECL
(
open
,
int
,
(
const
char
*
path
,
int
flags
,
...));
DARSHAN_FORWARD_DECL
(
open64
,
int
,
(
const
char
*
path
,
int
flags
,
...));
DARSHAN_FORWARD_DECL
(
__open_2
,
int
,
(
const
char
*
path
,
int
oflag
));
DARSHAN_FORWARD_DECL
(
openat
,
int
,
(
int
dirfd
,
const
char
*
pathname
,
int
flags
,
...));
DARSHAN_FORWARD_DECL
(
openat64
,
int
,
(
int
dirfd
,
const
char
*
pathname
,
int
flags
,
...));
DARSHAN_FORWARD_DECL
(
creat
,
int
,
(
const
char
*
path
,
mode_t
mode
));
DARSHAN_FORWARD_DECL
(
creat64
,
int
,
(
const
char
*
path
,
mode_t
mode
));
DARSHAN_FORWARD_DECL
(
dup
,
int
,
(
int
oldfd
));
...
...
@@ -481,6 +484,148 @@ int DARSHAN_DECL(open64)(const char *path, int flags, ...)
return
(
ret
);
}
int
DARSHAN_DECL
(
openat
)(
int
dirfd
,
const
char
*
pathname
,
int
flags
,
...)
{
int
mode
=
0
;
int
ret
;
double
tm1
,
tm2
;
struct
posix_file_record_ref
*
rec_ref
;
char
tmp_path
[
PATH_MAX
]
=
{
0
};
char
*
dirpath
=
NULL
;
MAP_OR_FAIL
(
openat
);
if
(
flags
&
O_CREAT
)
{
va_list
arg
;
va_start
(
arg
,
flags
);
mode
=
va_arg
(
arg
,
int
);
va_end
(
arg
);
tm1
=
darshan_core_wtime
();
ret
=
__real_openat
(
dirfd
,
pathname
,
flags
,
mode
);
tm2
=
darshan_core_wtime
();
}
else
{
tm1
=
darshan_core_wtime
();
ret
=
__real_openat
(
dirfd
,
pathname
,
flags
);
tm2
=
darshan_core_wtime
();
}
POSIX_PRE_RECORD
();
if
(
pathname
[
0
]
==
'/'
||
dirfd
==
AT_FDCWD
)
{
/* ignore dirfd in these cases:
* - absolute path
* - dirfd equal to CWD
*/
POSIX_RECORD_OPEN
(
ret
,
pathname
,
mode
,
tm1
,
tm2
);
}
else
{
/* construct path relative to dirfd */
rec_ref
=
darshan_lookup_record_ref
(
posix_runtime
->
fd_hash
,
&
dirfd
,
sizeof
(
dirfd
));
if
(
rec_ref
)
{
dirpath
=
darshan_core_lookup_record_name
(
rec_ref
->
file_rec
->
base_rec
.
id
);
if
(
dirpath
)
{
strcat
(
tmp_path
,
dirpath
);
if
(
dirpath
[
strlen
(
dirpath
)
-
1
]
!=
'/'
)
strcat
(
tmp_path
,
"/"
);
strcat
(
tmp_path
,
pathname
);
}
}
if
(
dirpath
)
{
/* we were able to construct an absolute path */
POSIX_RECORD_OPEN
(
ret
,
tmp_path
,
mode
,
tm1
,
tm2
);
}
else
{
/* fallback to relative path if Darshan doesn't know dirfd path */
POSIX_RECORD_OPEN
(
ret
,
pathname
,
mode
,
tm1
,
tm2
);
}
}
POSIX_POST_RECORD
();
return
(
ret
);
}
int
DARSHAN_DECL
(
openat64
)(
int
dirfd
,
const
char
*
pathname
,
int
flags
,
...)
{
int
mode
=
0
;
int
ret
;
double
tm1
,
tm2
;
struct
posix_file_record_ref
*
rec_ref
;
char
tmp_path
[
PATH_MAX
]
=
{
0
};
char
*
dirpath
=
NULL
;
MAP_OR_FAIL
(
openat64
);
if
(
flags
&
O_CREAT
)
{
va_list
arg
;
va_start
(
arg
,
flags
);
mode
=
va_arg
(
arg
,
int
);
va_end
(
arg
);
tm1
=
darshan_core_wtime
();
ret
=
__real_openat64
(
dirfd
,
pathname
,
flags
,
mode
);
tm2
=
darshan_core_wtime
();
}
else
{
tm1
=
darshan_core_wtime
();
ret
=
__real_openat64
(
dirfd
,
pathname
,
flags
);
tm2
=
darshan_core_wtime
();
}
POSIX_PRE_RECORD
();
if
(
pathname
[
0
]
==
'/'
||
dirfd
==
AT_FDCWD
)
{
/* ignore dirfd in these cases:
* - absolute path
* - dirfd equal to CWD
*/
POSIX_RECORD_OPEN
(
ret
,
pathname
,
mode
,
tm1
,
tm2
);
}
else
{
/* construct path relative to dirfd */
rec_ref
=
darshan_lookup_record_ref
(
posix_runtime
->
fd_hash
,
&
dirfd
,
sizeof
(
dirfd
));
if
(
rec_ref
)
{
dirpath
=
darshan_core_lookup_record_name
(
rec_ref
->
file_rec
->
base_rec
.
id
);
if
(
dirpath
)
{
strcat
(
tmp_path
,
dirpath
);
if
(
dirpath
[
strlen
(
dirpath
)
-
1
]
!=
'/'
)
strcat
(
tmp_path
,
"/"
);
strcat
(
tmp_path
,
pathname
);
}
}
if
(
dirpath
)
{
/* we were able to construct an absolute path */
POSIX_RECORD_OPEN
(
ret
,
tmp_path
,
mode
,
tm1
,
tm2
);
}
else
{
/* fallback to relative path if Darshan doesn't know dirfd path */
POSIX_RECORD_OPEN
(
ret
,
pathname
,
mode
,
tm1
,
tm2
);
}
}
POSIX_POST_RECORD
();
return
(
ret
);
}
int
DARSHAN_DECL
(
creat
)(
const
char
*
path
,
mode_t
mode
)
{
int
ret
;
...
...
darshan-runtime/share/ld-opts/darshan-posix-ld-opts
View file @
196eae16
--wrap=open
--wrap=open64
--wrap=__open_2
--wrap=openat
--wrap=openat64
--wrap=creat
--wrap=creat64
--wrap=dup
...
...
darshan-util/darshan-logutils.c
View file @
196eae16
...
...
@@ -2106,7 +2106,7 @@ void darshan_log_get_name_records(darshan_fd fd,
if
(
ret
<
0
)
{
darshan_log_close
(
fd
);
//
return
(-1)
;
return
;
}
int
num
=
HASH_CNT
(
hlink
,
name_hash
);
...
...
darshan-util/darshan-logutils.h
View file @
196eae16
...
...
@@ -70,7 +70,7 @@ struct darshan_mnt_info
struct
darshan_mod_info
{
char
*
name
;
const
char
*
name
;
int
len
;
int
ver
;
int
idx
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment