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
darshan
darshan
Commits
d1fc064b
Commit
d1fc064b
authored
Nov 17, 2016
by
Cong Xu
Browse files
Address DXT parser segment fault when Lustre module is disabled
Signed-off-by:
Cong Xu
<
congxu@localhost.localdomain
>
parent
faa23f57
Changes
2
Hide whitespace changes
Inline
Side-by-side
darshan-util/darshan-dxt-logutils.c
View file @
d1fc064b
...
...
@@ -24,7 +24,7 @@ static int dxt_log_put_posix_file(darshan_fd fd, void* dxt_posix_buf);
static
void
dxt_log_print_file
(
void
*
file_rec
,
char
*
file_name
,
char
*
mnt_pt
,
char
*
fs_type
);
void
dxt_log_print_posix_file
(
void
*
file_rec
,
char
*
file_name
,
char
*
mnt_pt
,
char
*
fs_type
,
struct
darshan_
lustre_record
*
ref
);
char
*
mnt_pt
,
char
*
fs_type
,
struct
lustre_record
_ref
*
rec_
ref
);
static
void
dxt_log_print_posix_description
(
int
ver
);
static
void
dxt_log_print_posix_file_diff
(
void
*
file_rec1
,
char
*
file_name1
,
void
*
file_rec2
,
char
*
file_name2
);
...
...
@@ -209,7 +209,7 @@ static void dxt_log_print_file(void *file_rec, char *file_name,
}
void
dxt_log_print_posix_file
(
void
*
posix_file_rec
,
char
*
file_name
,
char
*
mnt_pt
,
char
*
fs_type
,
struct
darshan_
lustre_record
*
ref
)
char
*
mnt_pt
,
char
*
fs_type
,
struct
lustre_record
_ref
*
lustre_rec_
ref
)
{
struct
dxt_file_record
*
file_rec
=
(
struct
dxt_file_record
*
)
posix_file_rec
;
...
...
@@ -228,6 +228,7 @@ void dxt_log_print_posix_file(void *posix_file_rec, char *file_name,
segment_info
*
io_trace
=
(
segment_info
*
)
parser_buf
;
/* Lustre File System */
struct
darshan_lustre_record
*
rec
;
int
lustreFS
=
!
strcmp
(
fs_type
,
"lustre"
);
int32_t
stripe_size
;
int32_t
stripe_count
;
...
...
@@ -235,7 +236,7 @@ void dxt_log_print_posix_file(void *posix_file_rec, char *file_name,
int
print_count
;
int
ost_idx
;
if
(
!
ref
)
{
if
(
!
lustre_rec_
ref
)
{
lustreFS
=
0
;
}
...
...
@@ -245,13 +246,14 @@ void dxt_log_print_posix_file(void *posix_file_rec, char *file_name,
write_count
,
read_count
);
if
(
lustreFS
)
{
stripe_size
=
ref
->
counters
[
LUSTRE_STRIPE_SIZE
];
stripe_count
=
ref
->
counters
[
LUSTRE_STRIPE_WIDTH
];
rec
=
lustre_rec_ref
->
rec
;
stripe_size
=
rec
->
counters
[
LUSTRE_STRIPE_SIZE
];
stripe_count
=
rec
->
counters
[
LUSTRE_STRIPE_WIDTH
];
printf
(
"# DXT, mnt_pt: %s, fs_type: %s
\n
"
,
mnt_pt
,
fs_type
);
printf
(
"# DXT, stripe_size: %d, stripe_count: %d
\n
"
,
stripe_size
,
stripe_count
);
for
(
i
=
0
;
i
<
stripe_count
;
i
++
)
{
printf
(
"# DXT, OST: %d
\n
"
,
(
re
f
->
ost_ids
)[
i
]);
printf
(
"# DXT, OST: %d
\n
"
,
(
re
c
->
ost_ids
)[
i
]);
}
}
...
...
@@ -278,7 +280,7 @@ void dxt_log_print_posix_file(void *posix_file_rec, char *file_name,
print_count
=
0
;
while
(
cur_offset
<
offset
+
length
)
{
printf
(
" [%3d]"
,
(
re
f
->
ost_ids
)[
ost_idx
]);
printf
(
" [%3d]"
,
(
re
c
->
ost_ids
)[
ost_idx
]);
cur_offset
=
(
cur_offset
/
stripe_size
+
1
)
*
stripe_size
;
ost_idx
=
(
ost_idx
==
stripe_count
-
1
)
?
0
:
ost_idx
+
1
;
...
...
@@ -306,7 +308,7 @@ void dxt_log_print_posix_file(void *posix_file_rec, char *file_name,
print_count
=
0
;
while
(
cur_offset
<
offset
+
length
)
{
printf
(
" [%3d]"
,
(
re
f
->
ost_ids
)[
ost_idx
]);
printf
(
" [%3d]"
,
(
re
c
->
ost_ids
)[
ost_idx
]);
cur_offset
=
(
cur_offset
/
stripe_size
+
1
)
*
stripe_size
;
ost_idx
=
(
ost_idx
==
stripe_count
-
1
)
?
0
:
ost_idx
+
1
;
...
...
darshan-util/darshan-dxt-parser.c
View file @
d1fc064b
...
...
@@ -22,7 +22,7 @@
extern
void
dxt_logutils_cleanup
();
extern
void
dxt_log_print_posix_file
(
void
*
file_rec
,
char
*
file_name
,
char
*
mnt_pt
,
char
*
fs_type
,
struct
darshan_
lustre_record
*
ref
);
char
*
mnt_pt
,
char
*
fs_type
,
struct
lustre_record
_ref
*
ref
);
extern
void
dxt_log_print_mpiio_file
(
void
*
file_rec
,
char
*
file_name
,
char
*
mnt_pt
,
char
*
fs_type
);
...
...
@@ -281,7 +281,7 @@ int main(int argc, char **argv)
sizeof
(
darshan_record_id
),
lustre_rec_ref
);
dxt_log_print_posix_file
(
mod_buf
,
rec_name
,
mnt_pt
,
fs_type
,
lustre_rec_ref
->
rec
);
mnt_pt
,
fs_type
,
lustre_rec_ref
);
}
else
if
(
i
==
DXT_MPIIO_MOD
){
dxt_log_print_mpiio_file
(
mod_buf
,
rec_name
,
mnt_pt
,
fs_type
);
...
...
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