Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
darshan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
72
Issues
72
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
darshan
darshan
Commits
77323cd7
Commit
77323cd7
authored
Jul 06, 2016
by
Shane Snyder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add back-compat code for the POSIX module ver=2
parent
5c5e4452
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
23 deletions
+45
-23
darshan-posix-log-format.h
darshan-posix-log-format.h
+1
-9
darshan-util/darshan-parser.c
darshan-util/darshan-parser.c
+3
-4
darshan-util/darshan-posix-logutils.c
darshan-util/darshan-posix-logutils.c
+41
-10
No files found.
darshan-posix-log-format.h
View file @
77323cd7
...
...
@@ -7,7 +7,7 @@
#define __DARSHAN_POSIX_LOG_FORMAT_H
/* current POSIX log format version */
#define DARSHAN_POSIX_VER
1
#define DARSHAN_POSIX_VER
2
#define POSIX_COUNTERS \
/* count of posix opens */
\
...
...
@@ -22,14 +22,6 @@
X(POSIX_STATS) \
/* count of posix mmaps */
\
X(POSIX_MMAPS) \
/* count of posix fopens */
\
X(POSIX_FOPENS) \
/* count of posix freads */
\
X(POSIX_FREADS) \
/* count of posix fwrites */
\
X(POSIX_FWRITES) \
/* count of posix fseeks */
\
X(POSIX_FSEEKS) \
/* count of posix fsyncs */
\
X(POSIX_FSYNCS) \
/* count of posix fdatasyncs */
\
...
...
darshan-util/darshan-parser.c
View file @
77323cd7
...
...
@@ -1223,11 +1223,10 @@ void posix_calc_file(hash_entry_t *file_hash,
bytes
=
file_rec
->
counters
[
POSIX_BYTES_READ
]
+
file_rec
->
counters
[
POSIX_BYTES_WRITTEN
];
r
=
(
file_rec
->
counters
[
POSIX_READS
]
+
file_rec
->
counters
[
POSIX_FREADS
])
;
/* XXX: need to update this to account for stdio counters, too */
r
=
file_rec
->
counters
[
POSIX_READS
]
;
w
=
(
file_rec
->
counters
[
POSIX_WRITES
]
+
file_rec
->
counters
[
POSIX_FWRITES
]);
w
=
file_rec
->
counters
[
POSIX_WRITES
];
fdata
->
total
+=
1
;
fdata
->
total_size
+=
bytes
;
...
...
darshan-util/darshan-posix-logutils.c
View file @
77323cd7
...
...
@@ -30,6 +30,8 @@ char *posix_f_counter_names[] = {
};
#undef X
#define DARSHAN_POSIX_FILE_SIZE_1 680
static
int
darshan_log_get_posix_file
(
darshan_fd
fd
,
void
*
posix_buf
);
static
int
darshan_log_put_posix_file
(
darshan_fd
fd
,
void
*
posix_buf
,
int
ver
);
static
void
darshan_log_print_posix_file
(
void
*
file_rec
,
...
...
@@ -51,19 +53,52 @@ struct darshan_mod_logutil_funcs posix_logutils =
static
int
darshan_log_get_posix_file
(
darshan_fd
fd
,
void
*
posix_buf
)
{
struct
darshan_posix_file
*
file
;
struct
darshan_posix_file
*
file
=
(
struct
darshan_posix_file
*
)
posix_buf
;
int
rec_len
;
char
*
buffer
,
*
p
;
int
i
;
int
ret
;
int
ret
=
-
1
;
/* read the POSIX record from file, checking the version first so we
* can correctly up-convert to the current darshan version
*/
if
(
fd
->
mod_ver
[
DARSHAN_POSIX_MOD
]
==
1
)
{
buffer
=
malloc
(
DARSHAN_POSIX_FILE_SIZE_1
);
if
(
!
buffer
)
return
(
-
1
);
rec_len
=
DARSHAN_POSIX_FILE_SIZE_1
;
ret
=
darshan_log_get_mod
(
fd
,
DARSHAN_POSIX_MOD
,
buffer
,
rec_len
);
if
(
ret
==
rec_len
)
{
/* copy record data directly from the temporary buffer into the
* corresponding locations in the output file record
*/
p
=
buffer
;
memcpy
(
&
(
file
->
base_rec
),
p
,
sizeof
(
struct
darshan_base_record
));
p
+=
sizeof
(
struct
darshan_base_record
);
memcpy
(
&
(
file
->
counters
[
0
]),
p
,
6
*
sizeof
(
int64_t
));
p
+=
(
6
*
sizeof
(
int64_t
));
p
+=
(
4
*
sizeof
(
int64_t
));
/* skip old stdio counters */
memcpy
(
&
(
file
->
counters
[
6
]),
p
,
58
*
sizeof
(
int64_t
));
p
+=
(
58
*
sizeof
(
int64_t
));
memcpy
(
&
(
file
->
fcounters
[
0
]),
p
,
15
*
sizeof
(
double
));
}
free
(
buffer
);
}
else
if
(
fd
->
mod_ver
[
DARSHAN_POSIX_MOD
]
==
2
)
{
rec_len
=
sizeof
(
struct
darshan_posix_file
);
ret
=
darshan_log_get_mod
(
fd
,
DARSHAN_POSIX_MOD
,
posix_buf
,
rec_len
);
}
ret
=
darshan_log_get_mod
(
fd
,
DARSHAN_POSIX_MOD
,
posix_buf
,
sizeof
(
struct
darshan_posix_file
));
if
(
ret
<
0
)
return
(
-
1
);
else
if
(
ret
<
sizeof
(
struct
darshan_posix_file
)
)
else
if
(
ret
<
rec_len
)
return
(
0
);
else
{
file
=
(
struct
darshan_posix_file
*
)
posix_buf
;
if
(
fd
->
swap_flag
)
{
/* swap bytes if necessary */
...
...
@@ -263,10 +298,6 @@ static void darshan_log_agg_posix_files(void *rec, void *agg_rec, int init_flag)
case
POSIX_SEEKS
:
case
POSIX_STATS
:
case
POSIX_MMAPS
:
case
POSIX_FOPENS
:
case
POSIX_FREADS
:
case
POSIX_FWRITES
:
case
POSIX_FSEEKS
:
case
POSIX_FSYNCS
:
case
POSIX_FDSYNCS
:
case
POSIX_BYTES_READ
:
...
...
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