Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Shane Snyder
darshan
Commits
77323cd7
Commit
77323cd7
authored
Jul 06, 2016
by
Shane Snyder
Browse files
add back-compat code for the POSIX module ver=2
parent
5c5e4452
Changes
3
Hide whitespace changes
Inline
Side-by-side
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_
F
READS
]
)
;
/* 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_fi
le
)
)
else
if
(
ret
<
rec_
le
n
)
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
Supports
Markdown
0%
Try again
or
attach a new 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