Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Cristian Simarro
darshan
Commits
6b4f4109
Commit
6b4f4109
authored
Apr 01, 2015
by
Shane Snyder
Browse files
more posix wrappers: mmap
parent
1c701eff
Changes
4
Hide whitespace changes
Inline
Side-by-side
darshan-posix-log-format.h
View file @
6b4f4109
...
...
@@ -16,9 +16,7 @@ enum darshan_posix_indices
POSIX_WRITES
,
/* count of posix writes */
POSIX_SEEKS
,
/* count of posix seeks */
POSIX_STATS
,
/* count of posix stat/lstat/fstats */
#if 0
POSIX_MMAPS
,
/* count of posix mmaps */
#endif
POSIX_FOPENS
,
/* count of posix fopens */
POSIX_FREADS
,
/* count of posix freads */
POSIX_FWRITES
,
/* count of posix fwrites */
...
...
darshan-runtime/darshan-posix-ld-opts
View file @
6b4f4109
...
...
@@ -23,6 +23,8 @@
--wrap=__lxstat64
--wrap=__fxstat
--wrap=__fxstat64
--wrap=mmap
--wrap=mmap64
--wrap=fsync
--wrap=fdatasync
--wrap=close
...
...
darshan-runtime/lib/darshan-posix.c
View file @
6b4f4109
...
...
@@ -62,7 +62,8 @@ DARSHAN_FORWARD_DECL(__lxstat, int, (int vers, const char* path, struct stat *bu
DARSHAN_FORWARD_DECL
(
__lxstat64
,
int
,
(
int
vers
,
const
char
*
path
,
struct
stat64
*
buf
));
DARSHAN_FORWARD_DECL
(
__fxstat
,
int
,
(
int
vers
,
int
fd
,
struct
stat
*
buf
));
DARSHAN_FORWARD_DECL
(
__fxstat64
,
int
,
(
int
vers
,
int
fd
,
struct
stat64
*
buf
));
/* TODO mmaps */
DARSHAN_FORWARD_DECL
(
mmap
,
void
*
,
(
void
*
addr
,
size_t
length
,
int
prot
,
int
flags
,
int
fd
,
off_t
offset
));
DARSHAN_FORWARD_DECL
(
mmap64
,
void
*
,
(
void
*
addr
,
size_t
length
,
int
prot
,
int
flags
,
int
fd
,
off64_t
offset
));
DARSHAN_FORWARD_DECL
(
fsync
,
int
,
(
int
fd
));
DARSHAN_FORWARD_DECL
(
fdatasync
,
int
,
(
int
fd
));
DARSHAN_FORWARD_DECL
(
close
,
int
,
(
int
fd
));
...
...
@@ -993,6 +994,54 @@ int DARSHAN_DECL(__fxstat64)(int vers, int fd, struct stat64 *buf)
return
(
ret
);
}
void
*
DARSHAN_DECL
(
mmap
)(
void
*
addr
,
size_t
length
,
int
prot
,
int
flags
,
int
fd
,
off_t
offset
)
{
void
*
ret
;
struct
posix_file_runtime
*
file
;
MAP_OR_FAIL
(
mmap
);
ret
=
__real_mmap
(
addr
,
length
,
prot
,
flags
,
fd
,
offset
);
if
(
ret
==
MAP_FAILED
)
return
(
ret
);
POSIX_LOCK
();
posix_runtime_initialize
();
file
=
posix_file_by_fd
(
fd
);
if
(
file
)
{
DARSHAN_COUNTER_INC
(
file
->
file_record
,
POSIX_MMAPS
,
1
);
}
POSIX_UNLOCK
();
return
(
ret
);
}
void
*
DARSHAN_DECL
(
mmap64
)(
void
*
addr
,
size_t
length
,
int
prot
,
int
flags
,
int
fd
,
off64_t
offset
)
{
void
*
ret
;
struct
posix_file_runtime
*
file
;
MAP_OR_FAIL
(
mmap64
);
ret
=
__real_mmap64
(
addr
,
length
,
prot
,
flags
,
fd
,
offset
);
if
(
ret
==
MAP_FAILED
)
return
(
ret
);
POSIX_LOCK
();
posix_runtime_initialize
();
file
=
posix_file_by_fd
(
fd
);
if
(
file
)
{
DARSHAN_COUNTER_INC
(
file
->
file_record
,
POSIX_MMAPS
,
1
);
}
POSIX_UNLOCK
();
return
(
ret
);
}
int
DARSHAN_DECL
(
fsync
)(
int
fd
)
{
int
ret
;
...
...
darshan-util/darshan-posix-parser.c
View file @
6b4f4109
...
...
@@ -175,6 +175,7 @@ int main(int argc, char **argv)
"
\t\t
POSIX_WRITES:
\t
%"
PRIu64
"
\n
"
"
\t\t
POSIX_SEEKS:
\t
%"
PRIu64
"
\n
"
"
\t\t
POSIX_STATS:
\t
%"
PRIu64
"
\n
"
"
\t\t
POSIX_MMAPS:
\t
%"
PRIu64
"
\n
"
"
\t\t
POSIX_FOPENS:
\t
%"
PRIu64
"
\n
"
"
\t\t
POSIX_FREADS:
\t
%"
PRIu64
"
\n
"
"
\t\t
POSIX_FWRITES:
\t
%"
PRIu64
"
\n
"
...
...
@@ -210,6 +211,7 @@ int main(int argc, char **argv)
next_file
.
counters
[
POSIX_WRITES
],
next_file
.
counters
[
POSIX_SEEKS
],
next_file
.
counters
[
POSIX_STATS
],
next_file
.
counters
[
POSIX_MMAPS
],
next_file
.
counters
[
POSIX_FOPENS
],
next_file
.
counters
[
POSIX_FREADS
],
next_file
.
counters
[
POSIX_FWRITES
],
...
...
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