Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
margo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
17
Issues
17
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
sds
margo
Commits
d6973c44
Commit
d6973c44
authored
Aug 11, 2017
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ability to uniquify diag output
parent
a97c0951
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
5 deletions
+23
-5
examples/margo-example-client.c
examples/margo-example-client.c
+1
-1
examples/my-rpc.c
examples/my-rpc.c
+1
-1
include/margo.h
include/margo.h
+3
-1
src/margo.c
src/margo.c
+18
-2
No files found.
examples/margo-example-client.c
View file @
d6973c44
...
...
@@ -176,7 +176,7 @@ int main(int argc, char **argv)
HG_Addr_free
(
hg_class
,
svr_addr
);
/* shut down everything */
margo_diag_dump
(
mid
,
"-"
);
margo_diag_dump
(
mid
,
"-"
,
0
);
margo_finalize
(
mid
);
ABT_finalize
();
...
...
examples/my-rpc.c
View file @
d6973c44
...
...
@@ -102,7 +102,7 @@ static void my_rpc_shutdown_ult(hg_handle_t handle)
HG_Destroy
(
handle
);
margo_diag_dump
(
mid
,
"-"
);
margo_diag_dump
(
mid
,
"-"
,
0
);
/* NOTE: we assume that the server daemon is using
* margo_wait_for_finalize() to suspend until this RPC executes, so there
...
...
include/margo.h
View file @
d6973c44
...
...
@@ -223,9 +223,11 @@ void margo_diag_start(margo_instance_id mid);
*
* @param [in] mid Margo instance
* @param [in] file output file ("-" for stdout)
* @param [in] uniquify flag indicating if file name should have additional
* information added to it to make output from different processes unique
* @returns void
*/
void
margo_diag_dump
(
margo_instance_id
mid
,
const
char
*
file
);
void
margo_diag_dump
(
margo_instance_id
mid
,
const
char
*
file
,
int
uniquify
);
#define MARGO_REGISTER(__mid, __func_name, __in_t, __out_t, __handler, __mplex_id, __pool) do { \
hg_return_t __hret; \
...
...
src/margo.c
View file @
d6973c44
...
...
@@ -935,20 +935,36 @@ static void print_diag_data(FILE *file, const char* name, const char *descriptio
return
;
}
void
margo_diag_dump
(
margo_instance_id
mid
,
const
char
*
file
)
void
margo_diag_dump
(
margo_instance_id
mid
,
const
char
*
file
,
int
uniquify
)
{
FILE
*
outfile
;
time_t
ltime
;
char
revised_file_name
[
256
]
=
{
0
};
assert
(
mid
->
diag_enabled
);
if
(
uniquify
)
{
char
hostname
[
128
]
=
{
0
};
int
pid
;
gethostname
(
hostname
,
128
);
pid
=
getpid
();
sprintf
(
revised_file_name
,
"%s-%s-%d"
,
file
,
hostname
,
pid
);
}
else
{
sprintf
(
revised_file_name
,
"%s"
,
file
);
}
if
(
strcmp
(
"-"
,
file
)
==
0
)
{
outfile
=
stdout
;
}
else
{
outfile
=
fopen
(
fil
e
,
"a"
);
outfile
=
fopen
(
revised_file_nam
e
,
"a"
);
if
(
!
outfile
)
{
perror
(
"fopen"
);
...
...
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