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
2de80622
Commit
2de80622
authored
Feb 18, 2015
by
Shane Snyder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No longer store unique hash with mount info
parent
7b412204
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
21 deletions
+24
-21
darshan-runtime/lib/darshan-core.c
darshan-runtime/lib/darshan-core.c
+1
-6
darshan-util/darshan-logutils.c
darshan-util/darshan-logutils.c
+7
-10
darshan-util/darshan-logutils.h
darshan-util/darshan-logutils.h
+1
-1
darshan-util/darshan-posix-parser.c
darshan-util/darshan-posix-parser.c
+15
-4
No files found.
darshan-runtime/lib/darshan-core.c
View file @
2de80622
...
...
@@ -42,7 +42,6 @@ static int nprocs = -1;
#define DARSHAN_MAX_MNT_TYPE 32
struct
mnt_data
{
int64_t
hash
;
/* TODO: should it be possible for these to be negative? */
int64_t
block_size
;
char
path
[
DARSHAN_MAX_MNT_PATH
];
char
type
[
DARSHAN_MAX_MNT_TYPE
];
...
...
@@ -778,9 +777,6 @@ static void add_entry(char* trailing_data, int* space_left, struct mntent *entry
DARSHAN_MAX_MNT_PATH
-
1
);
strncpy
(
mnt_data_array
[
mnt_data_count
].
type
,
entry
->
mnt_type
,
DARSHAN_MAX_MNT_TYPE
-
1
);
mnt_data_array
[
mnt_data_count
].
hash
=
darshan_hash
((
void
*
)
mnt_data_array
[
mnt_data_count
].
path
,
strlen
(
mnt_data_array
[
mnt_data_count
].
path
),
0
);
/* NOTE: we now try to detect the preferred block size for each file
* system using fstatfs(). On Lustre we assume a size of 1 MiB
* because fstatfs() reports 4 KiB.
...
...
@@ -797,8 +793,7 @@ static void add_entry(char* trailing_data, int* space_left, struct mntent *entry
mnt_data_array
[
mnt_data_count
].
block_size
=
4096
;
/* store mount information for use in header of darshan log */
ret
=
snprintf
(
tmp_mnt
,
256
,
"
\n
%"
PRId64
"
\t
%s
\t
%s"
,
mnt_data_array
[
mnt_data_count
].
hash
,
ret
=
snprintf
(
tmp_mnt
,
256
,
"
\n
%s
\t
%s"
,
entry
->
mnt_type
,
entry
->
mnt_dir
);
if
(
ret
<
256
&&
strlen
(
tmp_mnt
)
<=
(
*
space_left
))
{
...
...
darshan-util/darshan-logutils.c
View file @
2de80622
...
...
@@ -243,11 +243,11 @@ int darshan_log_getexe(darshan_fd fd, char *buf)
/* darshan_log_getmounts()
*
* retrieves mount table information from the log. Note that
devs, 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 arrays
* 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 arrays
*/
int
darshan_log_getmounts
(
darshan_fd
fd
,
int64_t
**
devs
,
char
***
mnt_pts
,
int
darshan_log_getmounts
(
darshan_fd
fd
,
char
***
mnt_pts
,
char
***
fs_types
,
int
*
count
)
{
int
ret
;
...
...
@@ -274,8 +274,6 @@ int darshan_log_getmounts(darshan_fd fd, int64_t** devs, char*** mnt_pts,
}
/* allocate output arrays */
*
devs
=
malloc
((
*
count
)
*
sizeof
(
int64_t
));
assert
(
*
devs
);
*
mnt_pts
=
malloc
((
*
count
)
*
sizeof
(
char
*
));
assert
(
*
mnt_pts
);
*
fs_types
=
malloc
((
*
count
)
*
sizeof
(
char
*
));
...
...
@@ -292,10 +290,9 @@ int darshan_log_getmounts(darshan_fd fd, int64_t** devs, char*** mnt_pts,
(
*
fs_types
)[
array_index
]
=
malloc
(
CP_EXE_LEN
);
assert
((
*
fs_types
)[
array_index
]);
ret
=
sscanf
(
++
pos
,
"%"
PRId64
"
\t
%s
\t
%s"
,
&
(
*
devs
)[
array_index
],
(
*
fs_types
)[
array_index
],
(
*
mnt_pts
)[
array_index
]);
if
(
ret
!=
3
)
ret
=
sscanf
(
++
pos
,
"%s
\t
%s"
,
(
*
fs_types
)[
array_index
],
(
*
mnt_pts
)[
array_index
]);
if
(
ret
!=
2
)
{
fprintf
(
stderr
,
"Error: poorly formatted mount table in log file.
\n
"
);
return
(
-
1
);
...
...
darshan-util/darshan-logutils.h
View file @
2de80622
...
...
@@ -24,7 +24,7 @@ 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
,
int64_t
**
devs
,
char
***
mnt_pts
,
int
darshan_log_getmounts
(
darshan_fd
fd
,
char
***
mnt_pts
,
char
***
fs_types
,
int
*
count
);
void
darshan_log_close
(
darshan_fd
file
);
...
...
darshan-util/darshan-posix-parser.c
View file @
2de80622
...
...
@@ -30,7 +30,6 @@ int main(int argc, char **argv)
struct
darshan_record_ref
*
rec_hash
=
NULL
;
struct
darshan_record_ref
*
ref
,
*
tmp
;
int
mount_count
;
int64_t
*
devs
;
char
**
mnt_pts
;
char
**
fs_types
;
struct
darshan_posix_file
next_rec
;
...
...
@@ -117,7 +116,7 @@ int main(int argc, char **argv)
}
/* get the mount information for this log */
ret
=
darshan_log_getmounts
(
file
,
&
devs
,
&
mnt_pts
,
&
fs_types
,
&
mount_count
);
ret
=
darshan_log_getmounts
(
file
,
&
mnt_pts
,
&
fs_types
,
&
mount_count
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"darshan_log_getmounts() failed to read mount information.
\n
"
);
...
...
@@ -126,11 +125,11 @@ int main(int argc, char **argv)
}
/* print table of mounted file systems */
printf
(
"
\n
# mounted file systems (
device, mount point,
and fs type)
\n
"
);
printf
(
"
\n
# mounted file systems (
mount point
and fs type)
\n
"
);
printf
(
"# -------------------------------------------------------
\n
"
);
for
(
i
=
0
;
i
<
mount_count
;
i
++
)
{
printf
(
"# mount entry:
%"
PRId64
"
\t
%s
\t
%s
\n
"
,
devs
[
i
]
,
mnt_pts
[
i
],
fs_types
[
i
]);
printf
(
"# mount entry:
\t
%s
\t
%s
\n
"
,
mnt_pts
[
i
],
fs_types
[
i
]);
}
/* read hash of darshan records */
...
...
@@ -176,6 +175,18 @@ int main(int argc, char **argv)
i
++
;
}
while
((
ret
=
darshan_log_getfile
(
file
,
&
next_rec
))
==
1
);
/* 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
);
}
darshan_log_close
(
file
);
return
(
0
);
...
...
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