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
8f85fd08
Commit
8f85fd08
authored
Feb 20, 2015
by
Shane Snyder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log compression good to go, revamped logutils
parent
efd500f0
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
412 additions
and
105 deletions
+412
-105
darshan-runtime/darshan-core.h
darshan-runtime/darshan-core.h
+5
-0
darshan-runtime/lib/darshan-core.c
darshan-runtime/lib/darshan-core.c
+159
-54
darshan-util/darshan-logutils.c
darshan-util/darshan-logutils.c
+221
-33
darshan-util/darshan-logutils.h
darshan-util/darshan-logutils.h
+2
-1
darshan-util/darshan-posix-parser.c
darshan-util/darshan-posix-parser.c
+25
-17
No files found.
darshan-runtime/darshan-core.h
View file @
8f85fd08
...
...
@@ -15,6 +15,10 @@
/* TODO: enforce this when handing out ids */
#define DARSHAN_CORE_MAX_RECORDS 1024
/* default compression buffer size of 2 MiB */
/* TODO: revisit this default size if we change memory per module */
#define DARSHAN_COMP_BUF_SIZE (2 * 1024 * 1024)
struct
darshan_core_module
{
darshan_module_id
id
;
...
...
@@ -28,6 +32,7 @@ struct darshan_core_runtime
char
exe
[
DARSHAN_EXE_LEN
+
1
];
struct
darshan_core_record_ref
*
rec_hash
;
struct
darshan_core_module
*
mod_array
[
DARSHAN_MAX_MODS
];
char
comp_buf
[
DARSHAN_COMP_BUF_SIZE
];
double
wtime_offset
;
char
*
trailing_data
;
};
...
...
darshan-runtime/lib/darshan-core.c
View file @
8f85fd08
This diff is collapsed.
Click to expand it.
darshan-util/darshan-logutils.c
View file @
8f85fd08
This diff is collapsed.
Click to expand it.
darshan-util/darshan-logutils.h
View file @
8f85fd08
...
...
@@ -22,10 +22,11 @@ darshan_fd darshan_log_open(const char *name, const char* mode);
int
darshan_log_getheader
(
darshan_fd
file
,
struct
darshan_header
*
header
);
int
darshan_log_getjob
(
darshan_fd
file
,
struct
darshan_job
*
job
);
int
darshan_log_gethash
(
darshan_fd
file
,
struct
darshan_record_ref
**
hash
);
int
darshan_log_getfile
(
darshan_fd
fd
,
struct
darshan_posix_file
*
file
);
int
darshan_log_getexe
(
darshan_fd
fd
,
char
*
buf
);
int
darshan_log_getmounts
(
darshan_fd
fd
,
char
***
mnt_pts
,
char
***
fs_types
,
int
*
count
);
int
darshan_log_getmod
(
darshan_fd
fd
,
int
mod_id
,
void
**
mod_buf
,
int
*
mod_buf_sz
);
void
darshan_log_close
(
darshan_fd
file
);
/* convenience macros for printing out counters */
...
...
darshan-util/darshan-posix-parser.c
View file @
8f85fd08
...
...
@@ -32,11 +32,12 @@ int main(int argc, char **argv)
int
mount_count
;
char
**
mnt_pts
;
char
**
fs_types
;
struct
darshan_posix_file
next_rec
;
time_t
tmp_time
=
0
;
char
*
token
;
char
*
save
;
char
buffer
[
DARSHAN_JOB_METADATA_LEN
];
struct
darshan_posix_file
*
posix_mod_buf
;
int
posix_mod_buf_sz
=
0
;
assert
(
argc
==
2
);
filename
=
argv
[
1
];
...
...
@@ -80,8 +81,8 @@ int main(int argc, char **argv)
/* print job summary */
printf
(
"# darshan log version: %s
\n
"
,
header
.
version_string
);
printf
(
"# size of POSIX file statistics: %zu bytes
\n
"
,
sizeof
(
next_rec
));
printf
(
"# size of job statistics: %zu bytes
\n
"
,
sizeof
(
job
));
printf
(
"# size of POSIX file statistics: %zu bytes
\n
"
,
sizeof
(
struct
darshan_posix_file
));
printf
(
"# size of job statistics: %zu bytes
\n
"
,
sizeof
(
struct
darshan_
job
));
printf
(
"# exe: %s
\n
"
,
tmp_string
);
printf
(
"# uid: %"
PRId64
"
\n
"
,
job
.
uid
);
printf
(
"# jobid: %"
PRId64
"
\n
"
,
job
.
jobid
);
...
...
@@ -132,6 +133,13 @@ int main(int argc, char **argv)
printf
(
"# mount entry:
\t
%s
\t
%s
\n
"
,
mnt_pts
[
i
],
fs_types
[
i
]);
}
uint64_t
job_size
=
header
.
rec_map
.
off
-
sizeof
(
struct
darshan_header
);
printf
(
"
\n
Darshan log file module sizes:
\n
"
);
printf
(
"
\t
HEADER size = %"
PRIu64
"
\n\t
JOB size = %"
PRIu64
"
\n\t
REC_HASH size = %"
PRIu64
"
\n
"
,
sizeof
(
struct
darshan_header
),
job_size
,
header
.
rec_map
.
len
);
printf
(
"
\t
%s MODULE size = %"
PRIu64
"
\n
"
,
darshan_module_names
[
DARSHAN_POSIX_MOD
],
header
.
mod_map
[
DARSHAN_POSIX_MOD
].
len
);
/* read hash of darshan records */
ret
=
darshan_log_gethash
(
file
,
&
rec_hash
);
if
(
ret
<
0
)
...
...
@@ -141,15 +149,18 @@ int main(int argc, char **argv)
return
(
-
1
);
}
/* try to retrieve first record (may not exist) */
ret
=
darshan_log_getfile
(
file
,
&
next_rec
);
if
(
ret
<
0
)
printf
(
"
\n
*** FILE RECORD DATA ***
\n
"
);
/* get the log data for the POSIX module */
ret
=
darshan_log_getmod
(
file
,
DARSHAN_POSIX_MOD
,
(
void
**
)
&
posix_mod_buf
,
&
posix_mod_buf_sz
);
if
(
ret
<
0
||
posix_mod_buf_sz
%
sizeof
(
struct
darshan_posix_file
))
{
fprintf
(
stderr
,
"
Error: failed to parse log file
.
\n
"
);
fflush
(
stderr
);
fprintf
(
stderr
,
"
darshan_log_getmod() failed to read POSIX module data
.
\n
"
);
darshan_log_close
(
file
);
return
(
-
1
);
}
if
(
ret
==
0
)
if
(
posix_mod_buf_sz
==
0
)
{
/* it looks like the app didn't open any files */
printf
(
"# no files opened.
\n
"
);
...
...
@@ -157,11 +168,10 @@ int main(int argc, char **argv)
return
(
0
);
}
/* iterate the posix file records stored in the darshan log */
printf
(
"
\n
*** FILE RECORD DATA ***
\n
"
);
i
=
0
;
do
{
struct
darshan_record_ref
*
ref
;
/* loop over the POSIX file records and print out counters */
for
(
i
=
0
;
i
<
(
posix_mod_buf_sz
/
sizeof
(
struct
darshan_posix_file
));
i
++
)
{
struct
darshan_posix_file
next_rec
=
posix_mod_buf
[
i
];
/* get the pathname for this record */
HASH_FIND
(
hlink
,
rec_hash
,
&
next_rec
.
f_id
,
sizeof
(
darshan_record_id
),
ref
);
...
...
@@ -172,9 +182,7 @@ int main(int argc, char **argv)
printf
(
"
\t\t
POSIX_OPENS:
\t
%"
PRIu64
"
\n\t\t
F_OPEN_TIMESTAMP:
\t
%lf
\n\t\t
F_CLOSE_TIMESTAMP:
\t
%lf
\n
"
,
next_rec
.
counters
[
CP_POSIX_OPENS
],
next_rec
.
fcounters
[
CP_F_OPEN_TIMESTAMP
],
next_rec
.
fcounters
[
CP_F_CLOSE_TIMESTAMP
]);
i
++
;
}
while
((
ret
=
darshan_log_getfile
(
file
,
&
next_rec
))
==
1
);
}
/* free mount info */
for
(
i
=
0
;
i
<
mount_count
;
i
++
)
...
...
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