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
0d1f6e80
Commit
0d1f6e80
authored
Aug 16, 2016
by
Glenn K. Lockwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prepend file system mount point to hashed file name to retain file system info for obfuscated files
parent
def2fe28
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
4 deletions
+26
-4
darshan-util/darshan-convert.c
darshan-util/darshan-convert.c
+26
-4
No files found.
darshan-util/darshan-convert.c
View file @
0d1f6e80
...
...
@@ -138,19 +138,41 @@ void obfuscate_exe(int key, char *exe)
return
;
}
void
obfuscate_filenames
(
int
key
,
struct
darshan_name_record_ref
*
name_hash
)
void
obfuscate_filenames
(
int
key
,
struct
darshan_name_record_ref
*
name_hash
,
struct
darshan_mnt_info
*
mnt_data_array
,
int
mount_count
)
{
struct
darshan_name_record_ref
*
ref
,
*
tmp
;
uint32_t
hashed
;
char
tmp_string
[
128
]
=
{
0
};
char
tmp_string
[
PATH_MAX
+
128
]
=
{
0
};
darshan_record_id
tmp_id
;
HASH_ITER
(
hlink
,
name_hash
,
ref
,
tmp
)
{
/* find file system */
int
j
;
char
*
mnt_pt
=
NULL
;
/* get mount point and fs type associated with this record */
for
(
j
=
0
;
j
<
mount_count
;
j
++
)
{
if
(
strncmp
(
mnt_data_array
[
j
].
mnt_path
,
ref
->
name_record
->
name
,
strlen
(
mnt_data_array
[
j
].
mnt_path
))
==
0
)
{
mnt_pt
=
mnt_data_array
[
j
].
mnt_path
;
break
;
}
}
tmp_id
=
ref
->
name_record
->
id
;
hashed
=
darshan_hashlittle
(
ref
->
name_record
->
name
,
strlen
(
ref
->
name_record
->
name
),
key
);
sprintf
(
tmp_string
,
"%u"
,
hashed
);
if
(
mnt_pt
!=
NULL
)
{
sprintf
(
tmp_string
,
"%s/%u"
,
mnt_pt
,
hashed
);
}
else
{
sprintf
(
tmp_string
,
"%u"
,
hashed
);
}
free
(
ref
->
name_record
);
ref
->
name_record
=
malloc
(
sizeof
(
struct
darshan_name_record
)
+
strlen
(
tmp_string
));
...
...
@@ -330,7 +352,7 @@ int main(int argc, char **argv)
/* NOTE: obfuscating filepaths breaks the ability to map files
* to the corresponding FS & mount info maintained by darshan
*/
if
(
obfuscate
)
obfuscate_filenames
(
key
,
name_hash
);
if
(
obfuscate
)
obfuscate_filenames
(
key
,
name_hash
,
mnt_data_array
,
mount_count
);
if
(
hash
)
remove_hash_recs
(
&
name_hash
,
hash
);
ret
=
darshan_log_put_namehash
(
outfile
,
name_hash
);
...
...
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