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
76
Issues
76
List
Boards
Labels
Milestones
Merge Requests
14
Merge Requests
14
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
db5a2150
Commit
db5a2150
authored
Apr 29, 2016
by
Philip Carns
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into dev-stdio
parents
ebbe6421
85698250
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
56 deletions
+56
-56
darshan-util/configure
darshan-util/configure
+1
-1
darshan-util/darshan-convert.c
darshan-util/darshan-convert.c
+4
-13
darshan-util/darshan-logutils.c
darshan-util/darshan-logutils.c
+31
-23
darshan-util/darshan-logutils.h
darshan-util/darshan-logutils.h
+10
-4
darshan-util/darshan-parser.c
darshan-util/darshan-parser.c
+9
-14
maint/config/check_bzlib.m4
maint/config/check_bzlib.m4
+1
-1
No files found.
darshan-util/configure
View file @
db5a2150
...
...
@@ -3538,7 +3538,7 @@ then
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: yes"
>
&5
$as_echo
"yes"
>
&6
;
}
BZLIB_OLD_LDFLAGS
=
$LDFLAGS
BZLIB_OLD_CPPFLAGS
=
$
LD
FLAGS
BZLIB_OLD_CPPFLAGS
=
$
CPP
FLAGS
LDFLAGS
=
"
$LDFLAGS
-L
${
BZLIB_HOME
}
/lib"
CPPFLAGS
=
"
$CPPFLAGS
-I
${
BZLIB_HOME
}
/include"
...
...
darshan-util/darshan-convert.c
View file @
db5a2150
...
...
@@ -230,8 +230,7 @@ int main(int argc, char **argv)
darshan_fd
outfile
;
int
i
;
int
mount_count
;
char
**
mnt_pts
;
char
**
fs_types
;
struct
darshan_mnt_info
*
mnt_data_array
;
struct
darshan_record_ref
*
rec_hash
=
NULL
;
struct
darshan_record_ref
*
ref
,
*
tmp
;
char
mod_buf
[
DEF_MOD_BUF_SIZE
];
...
...
@@ -299,7 +298,7 @@ int main(int argc, char **argv)
return
(
-
1
);
}
ret
=
darshan_log_getmounts
(
infile
,
&
mnt_
pts
,
&
fs_types
,
&
mount_count
);
ret
=
darshan_log_getmounts
(
infile
,
&
mnt_
data_array
,
&
mount_count
);
if
(
ret
<
0
)
{
darshan_log_close
(
infile
);
...
...
@@ -308,7 +307,7 @@ int main(int argc, char **argv)
return
(
-
1
);
}
ret
=
darshan_log_putmounts
(
outfile
,
mnt_
pts
,
fs_types
,
mount_count
);
ret
=
darshan_log_putmounts
(
outfile
,
mnt_
data_array
,
mount_count
);
if
(
ret
<
0
)
{
darshan_log_close
(
infile
);
...
...
@@ -389,16 +388,8 @@ int main(int argc, char **argv)
darshan_log_close
(
infile
);
darshan_log_close
(
outfile
);
for
(
i
=
0
;
i
<
mount_count
;
i
++
)
{
free
(
mnt_pts
[
i
]);
free
(
fs_types
[
i
]);
}
if
(
mount_count
>
0
)
{
free
(
mnt_pts
);
free
(
fs_types
);
}
free
(
mnt_data_array
);
HASH_ITER
(
hlink
,
rec_hash
,
ref
,
tmp
)
{
...
...
darshan-util/darshan-logutils.c
View file @
db5a2150
...
...
@@ -66,6 +66,7 @@ struct darshan_fd_int_state
struct
darshan_dz_state
dz
;
};
static
int
darshan_mnt_info_cmp
(
const
void
*
a
,
const
void
*
b
);
static
int
darshan_log_getheader
(
darshan_fd
fd
);
static
int
darshan_log_putheader
(
darshan_fd
fd
);
static
int
darshan_log_seek
(
darshan_fd
fd
,
off_t
offset
);
...
...
@@ -374,14 +375,14 @@ int darshan_log_putexe(darshan_fd fd, char *buf)
/* darshan_log_getmounts()
*
* retrieves mount table information from the log. Note that mnt_
pts and
*
fs_types are arrays
that will be allocated by the function and must be
* freed by the caller. count will indicate the size of the array
s
* retrieves mount table information from the log. Note that mnt_
data_array
*
is an array
that will be allocated by the function and must be
* freed by the caller. count will indicate the size of the array
*
* returns 0 on success, -1 on failure
*/
int
darshan_log_getmounts
(
darshan_fd
fd
,
char
***
mnt_pts
,
char
***
fs_types
,
int
*
count
)
int
darshan_log_getmounts
(
darshan_fd
fd
,
struct
darshan_mnt_info
**
mnt_data_array
,
int
*
count
)
{
struct
darshan_fd_int_state
*
state
=
fd
->
state
;
char
*
pos
;
...
...
@@ -416,34 +417,27 @@ int darshan_log_getmounts(darshan_fd fd, char*** mnt_pts,
}
/* allocate output arrays */
*
mnt_pts
=
malloc
((
*
count
)
*
sizeof
(
char
*
));
assert
(
*
mnt_pts
);
*
fs_types
=
malloc
((
*
count
)
*
sizeof
(
char
*
));
assert
(
*
fs_types
);
*
mnt_data_array
=
malloc
((
*
count
)
*
sizeof
(
**
mnt_data_array
));
assert
(
*
mnt_data_array
);
/* work
backwards
through the table and parse each line (except for
/* work through the table and parse each line (except for
* first, which holds command line information)
*/
while
((
pos
=
strrchr
(
state
->
exe_mnt_data
,
'\n'
))
!=
NULL
)
pos
=
state
->
exe_mnt_data
;
while
((
pos
=
strchr
(
pos
,
'\n'
))
!=
NULL
)
{
/* overestimate string lengths */
(
*
mnt_pts
)[
array_index
]
=
malloc
(
DARSHAN_EXE_LEN
);
assert
((
*
mnt_pts
)[
array_index
]);
(
*
fs_types
)[
array_index
]
=
malloc
(
DARSHAN_EXE_LEN
);
assert
((
*
fs_types
)[
array_index
]);
ret
=
sscanf
(
++
pos
,
"%s
\t
%s"
,
(
*
fs_types
)[
array_index
],
(
*
mnt_pts
)[
array_index
]);
ret
=
sscanf
(
++
pos
,
"%s
\t
%s"
,
(
*
mnt_data_array
)[
array_index
].
mnt_type
,
(
*
mnt_data_array
)[
array_index
].
mnt_path
);
if
(
ret
!=
2
)
{
fprintf
(
stderr
,
"Error: poorly formatted mount table in darshan log file.
\n
"
);
return
(
-
1
);
}
pos
--
;
*
pos
=
'\0'
;
array_index
++
;
}
qsort
(
*
mnt_data_array
,
*
count
,
sizeof
(
**
mnt_data_array
),
darshan_mnt_info_cmp
);
return
(
0
);
}
...
...
@@ -456,7 +450,8 @@ int darshan_log_getmounts(darshan_fd fd, char*** mnt_pts,
*
* returns 0 on success, -1 on failure
*/
int
darshan_log_putmounts
(
darshan_fd
fd
,
char
**
mnt_pts
,
char
**
fs_types
,
int
count
)
int
darshan_log_putmounts
(
darshan_fd
fd
,
struct
darshan_mnt_info
*
mnt_data_array
,
int
count
)
{
struct
darshan_fd_int_state
*
state
=
fd
->
state
;
int
i
;
...
...
@@ -472,7 +467,7 @@ int darshan_log_putmounts(darshan_fd fd, char** mnt_pts, char** fs_types, int co
tmp
=
mnt_dat
;
for
(
i
=
count
-
1
;
i
>=
0
;
i
--
)
{
sprintf
(
line
,
"
\n
%s
\t
%s"
,
fs_types
[
i
],
mnt_pts
[
i
]
);
sprintf
(
line
,
"
\n
%s
\t
%s"
,
mnt_data_array
[
i
].
mnt_type
,
mnt_data_array
[
i
].
mnt_path
);
memcpy
(
tmp
,
line
,
strlen
(
line
));
tmp
+=
strlen
(
line
);
...
...
@@ -827,6 +822,19 @@ void darshan_log_close(darshan_fd fd)
/* **************************************************** */
static
int
darshan_mnt_info_cmp
(
const
void
*
a
,
const
void
*
b
)
{
struct
darshan_mnt_info
*
m_a
=
(
struct
darshan_mnt_info
*
)
a
;
struct
darshan_mnt_info
*
m_b
=
(
struct
darshan_mnt_info
*
)
b
;
if
(
strlen
(
m_a
->
mnt_path
)
>
strlen
(
m_b
->
mnt_path
))
return
(
-
1
);
else
if
(
strlen
(
m_a
->
mnt_path
)
<
strlen
(
m_b
->
mnt_path
))
return
(
1
);
else
return
(
0
);
}
/* read the header of the darshan log and set internal fd data structures
* NOTE: this is the only portion of the darshan log that is uncompressed
*
...
...
darshan-util/darshan-logutils.h
View file @
db5a2150
...
...
@@ -47,6 +47,12 @@ struct darshan_record_ref
UT_hash_handle
hlink
;
};
struct
darshan_mnt_info
{
char
mnt_type
[
DARSHAN_EXE_LEN
];
char
mnt_path
[
DARSHAN_EXE_LEN
];
};
/* functions to be implemented by each module for integration with
* darshan log file utilities (e.g., parser & convert tools)
*/
...
...
@@ -116,10 +122,10 @@ int darshan_log_getjob(darshan_fd fd, struct darshan_job *job);
int
darshan_log_putjob
(
darshan_fd
fd
,
struct
darshan_job
*
job
);
int
darshan_log_getexe
(
darshan_fd
fd
,
char
*
buf
);
int
darshan_log_putexe
(
darshan_fd
fd
,
char
*
buf
);
int
darshan_log_getmounts
(
darshan_fd
fd
,
char
***
mnt_pts
,
char
***
fs_types
,
int
*
count
);
int
darshan_log_putmounts
(
darshan_fd
fd
,
char
**
mnt_pts
,
char
**
fs_types
,
int
count
);
int
darshan_log_getmounts
(
darshan_fd
fd
,
struct
darshan_mnt_info
**
mnt_data_array
,
int
*
count
);
int
darshan_log_putmounts
(
darshan_fd
fd
,
struct
darshan_mnt_info
*
mnt_data_array
,
int
count
);
int
darshan_log_gethash
(
darshan_fd
fd
,
struct
darshan_record_ref
**
hash
);
int
darshan_log_puthash
(
darshan_fd
fd
,
struct
darshan_record_ref
*
hash
);
int
darshan_log_getmod
(
darshan_fd
fd
,
darshan_module_id
mod_id
,
...
...
darshan-util/darshan-parser.c
View file @
db5a2150
...
...
@@ -205,8 +205,7 @@ int main(int argc, char **argv)
struct
darshan_record_ref
*
rec_hash
=
NULL
;
struct
darshan_record_ref
*
ref
,
*
tmp_ref
;
int
mount_count
;
char
**
mnt_pts
;
char
**
fs_types
;
struct
darshan_mnt_info
*
mnt_data_array
;
time_t
tmp_time
=
0
;
char
*
token
;
char
*
save
;
...
...
@@ -248,7 +247,7 @@ int main(int argc, char **argv)
}
/* get the mount information for this log */
ret
=
darshan_log_getmounts
(
fd
,
&
mnt_
pts
,
&
fs_types
,
&
mount_count
);
ret
=
darshan_log_getmounts
(
fd
,
&
mnt_
data_array
,
&
mount_count
);
if
(
ret
<
0
)
{
darshan_log_close
(
fd
);
...
...
@@ -318,7 +317,8 @@ int main(int argc, char **argv)
printf
(
"# -------------------------------------------------------
\n
"
);
for
(
i
=
0
;
i
<
mount_count
;
i
++
)
{
printf
(
"# mount entry:
\t
%s
\t
%s
\n
"
,
mnt_pts
[
i
],
fs_types
[
i
]);
printf
(
"# mount entry:
\t
%s
\t
%s
\n
"
,
mnt_data_array
[
i
].
mnt_path
,
mnt_data_array
[
i
].
mnt_type
);
}
if
(
mask
&
OPTION_BASE
)
...
...
@@ -417,10 +417,11 @@ int main(int argc, char **argv)
/* get mount point and fs type associated with this record */
for
(
j
=
0
;
j
<
mount_count
;
j
++
)
{
if
(
strncmp
(
mnt_pts
[
j
],
ref
->
rec
.
name
,
strlen
(
mnt_pts
[
j
]))
==
0
)
if
(
strncmp
(
mnt_data_array
[
j
].
mnt_path
,
ref
->
rec
.
name
,
strlen
(
mnt_data_array
[
j
].
mnt_path
))
==
0
)
{
mnt_pt
=
mnt_
pts
[
j
]
;
fs_type
=
fs_types
[
j
]
;
mnt_pt
=
mnt_
data_array
[
j
].
mnt_path
;
fs_type
=
mnt_data_array
[
j
].
mnt_type
;
break
;
}
}
...
...
@@ -633,15 +634,9 @@ cleanup:
}
/* free mount info */
for
(
i
=
0
;
i
<
mount_count
;
i
++
)
{
free
(
mnt_pts
[
i
]);
free
(
fs_types
[
i
]);
}
if
(
mount_count
>
0
)
{
free
(
mnt_pts
);
free
(
fs_types
);
free
(
mnt_data_array
);
}
return
(
ret
);
...
...
maint/config/check_bzlib.m4
View file @
db5a2150
...
...
@@ -57,7 +57,7 @@ if test -z "${DISABLE_BZLIB}"
then
AC_MSG_RESULT(yes)
BZLIB_OLD_LDFLAGS=$LDFLAGS
BZLIB_OLD_CPPFLAGS=$
LD
FLAGS
BZLIB_OLD_CPPFLAGS=$
CPP
FLAGS
LDFLAGS="$LDFLAGS -L${BZLIB_HOME}/lib"
CPPFLAGS="$CPPFLAGS -I${BZLIB_HOME}/include"
AC_LANG_SAVE
...
...
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