Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
chaosframework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
chaos-lnf-control
chaosframework
Commits
a5a7499a
Commit
a5a7499a
authored
6 years ago
by
Andrea Michelotti
Browse files
Options
Downloads
Patches
Plain Diff
tool to generate pdf of profiles
parent
0829d8df
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config/CMakeChaos.txt
+8
-0
8 additions, 0 deletions
config/CMakeChaos.txt
tools/common_util.sh
+16
-8
16 additions, 8 deletions
tools/common_util.sh
tools/generateGoogleProfilePdf.sh
+21
-0
21 additions, 0 deletions
tools/generateGoogleProfilePdf.sh
with
45 additions
and
8 deletions
config/CMakeChaos.txt
+
8
−
0
View file @
a5a7499a
...
@@ -69,6 +69,14 @@ ELSE()
...
@@ -69,6 +69,14 @@ ELSE()
MESG("BUILD TYPE:${CMAKE_BUILD_TYPE}")
MESG("BUILD TYPE:${CMAKE_BUILD_TYPE}")
ENDIF()
ENDIF()
if(CMAKE_BUILD_TYPE MATCHES SANITIZE)
MESG("ENABLING PROFILE")
set (CHAOS_CXX_FLAGS "${CHAOS_CXX_FLAGS} -g -fsanitize=address")
set (CHAOS_C_FLAGS "${CHAOS_C_FLAGS} -g -fsanitize=address")
ELSE()
MESG("BUILD TYPE:${CMAKE_BUILD_TYPE}")
ENDIF()
set (BOOST_CXX_ADDITIONAL_FLAGS "")
set (BOOST_CXX_ADDITIONAL_FLAGS "")
IF(CHAOS_ENABLE_C11 AND NOT CHAOS_TARGET)
IF(CHAOS_ENABLE_C11 AND NOT CHAOS_TARGET)
set (CHAOS_CXX_FLAGS "${CHAOS_CXX_FLAGS} -std=c++11")
set (CHAOS_CXX_FLAGS "${CHAOS_CXX_FLAGS} -std=c++11")
...
...
This diff is collapsed.
Click to expand it.
tools/common_util.sh
+
16
−
8
View file @
a5a7499a
...
@@ -365,12 +365,17 @@ stop_proc(){
...
@@ -365,12 +365,17 @@ stop_proc(){
pid
=
`
get_pid
"
$1
"
`
pid
=
`
get_pid
"
$1
"
`
for
p
in
$pid
;
do
for
p
in
$pid
;
do
if
[
-n
"
$p
"
]
;
then
if
[
-n
"
$p
"
]
;
then
if
!
kill
-9
$p
;
then
## kill gently
error_mesg
"cannot kill process
$p
"
kill
-SIGQUIT
$p
exit
1
sleep
1
else
pid
=
`
get_pid
"
$p
"
`
ok_mesg
"process
$1
(
$p
) killed"
if
[
-n
"
$pid
"
]
;
then
if
!
kill
-9
$p
;
then
error_mesg
"cannot kill process
$p
"
exit
1
fi
fi
fi
ok_mesg
"process
$1
(
$p
) killed"
else
else
warn_mesg
"process
$1
(
$p
) "
"not running"
warn_mesg
"process
$1
(
$p
) "
"not running"
...
@@ -467,7 +472,7 @@ run_proc(){
...
@@ -467,7 +472,7 @@ run_proc(){
debug
=
""
debug
=
""
if
[
-n
"
$GOOGLE_PROFILE
"
]
;
then
if
[
-n
"
$GOOGLE_PROFILE
"
]
;
then
debug
=
"
$GOOGLE_PROFILE
"
debug
=
"
$GOOGLE_PROFILE
"
info_mesg
"google heap check "
"enabled"
info_mesg
"google heap check
for '
$process_name
'
"
"enabled"
elif
[
-n
"
$CHAOS_DEBUG_CMD
"
]
;
then
elif
[
-n
"
$CHAOS_DEBUG_CMD
"
]
;
then
echo
"set disable-randomization off"
>
/tmp/gdbbatch
echo
"set disable-randomization off"
>
/tmp/gdbbatch
echo
"run"
>>
/tmp/gdbbatch
echo
"run"
>>
/tmp/gdbbatch
...
@@ -487,7 +492,10 @@ run_proc(){
...
@@ -487,7 +492,10 @@ run_proc(){
cmdline
=
"
$debug
$run_prefix
$command_line
"
cmdline
=
"
$debug
$run_prefix
$command_line
"
fi
fi
eval
$cmdline
eval
$cmdline
if
[
-n
"
$GOOGLE_PROFILE
"
]
;
then
sleep
1
fi
if
[
$?
-eq
0
]
;
then
if
[
$?
-eq
0
]
;
then
pid
=
$!
pid
=
$!
sleep
1
sleep
1
...
@@ -512,7 +520,7 @@ run_proc(){
...
@@ -512,7 +520,7 @@ run_proc(){
else
else
echo
"
$cmdline
"
>
$CHAOS_PREFIX
/log/
$process_name
.cmdline.errlaunch.log
echo
"
$cmdline
"
>
$CHAOS_PREFIX
/log/
$process_name
.cmdline.errlaunch.log
error_mesg
"error lunching
$process_name
"
error_mesg
"error lunching
$process_name
cmdline: '
$cmdline
'
"
exit
1
exit
1
fi
fi
return
0
return
0
...
...
This diff is collapsed.
Click to expand it.
tools/generateGoogleProfilePdf.sh
0 → 100755
+
21
−
0
View file @
a5a7499a
#!/bin/bash
echo
"* looking .heap in
$1
using prefix
$2
"
heapls
=
`
find
$1
-name
"*.heap"
`
for
heapf
in
$heapls
;
do
echo
"* processing
$heapf
"
if
[[
$heapf
=
~
\/
([[
:alpha:]]+
)
\.
(
.+
)
\.
(
.+
)
\.
heap
$
]]
;
then
pname
=
${
BASH_REMATCH
[1]
}
ppid
=
${
BASH_REMATCH
[2]
}
# echo "program name:$pname"
# echo "program pid:$ppid"
if
[
!
-x
$2
/
$pname
]
;
then
echo
"## cannot find executable
$2
/
$pname
"
exit
1
fi
if
google-pprof
$2
/
$pname
"
$heapf
"
--inuse_objects
--lines
--heapcheck
--edgefraction
=
1e-10
--nodefraction
=
1e-10
--pdf
>
$pname
.
$ppid
.pdf
;
then
echo
"* generated
$pname
.
$ppid
.pdf"
else
echo
"## error processing
$heapf
"
fi
fi
done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment