Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ptaskTracer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Forget Julien
ptaskTracer
Commits
e9fe3a55
Commit
e9fe3a55
authored
Feb 18, 2019
by
Amine El Messaoudi
Committed by
GitHub
Feb 18, 2019
Browse files
Options
Downloads
Plain Diff
Merge pull request #1 from glipari/master
added an option to specify program arguments
parents
32ed98fb
5c19e5b9
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ptaskTracer.sh
+22
-7
22 additions, 7 deletions
ptaskTracer.sh
with
22 additions
and
7 deletions
ptaskTracer.sh
+
22
−
7
View file @
e9fe3a55
...
...
@@ -22,6 +22,11 @@ while [[ $# -gt 0 ]]; do
shift
# past argument
shift
# past value
;;
-a
|
--args
)
ARGS
=
"
$2
"
shift
shift
;;
-p
|
--path
)
APPPATH
=
"
$2
"
shift
...
...
@@ -95,8 +100,9 @@ if [[ "$HELP" = true ]]; then # showing help
echo
""
echo
"With option --old no tracing is performed, the trace analysed will be build/[APP_NAME]_raw.txt"
echo
"These parameters are optional :"
echo
"<-o|--output OUTPUT> to specifie directory where all output in build/ is generated"
echo
"<-i|--input INPUT> to specifie directory of old build/[APP_NAME]_raw.txt"
echo
"<-a|--args ARGS> to specify arguments to the program"
echo
"<-o|--output OUTPUT> to specify directory where all output in build/ is generated"
echo
"<-i|--input INPUT> to specify directory of old build/[APP_NAME]_raw.txt"
echo
"<-t|--time TRACING_TIME> for tracing time in second, must be unsigned double (default: 4s)"
echo
"<-s|--scale PRINT_SCALE> for printing scale, must be unsigned double (default: 1000.0px/s)"
echo
"<-h|--theight TASK_HEIGTH> for printing task height in px, must be unsigned double (default: 20.0px)"
...
...
@@ -123,6 +129,9 @@ if [[ -n "$OLD" ]]; then # svg option
if
[[
-n
"
$TIME
"
]]
;
then
echo
"[warning] argument
${
TIME
}
not needed with --old option"
fi
if
[[
-n
"
$ARG
"
]]
;
then
echo
"[warning] argument
${
ARG
}
not needed with --old option"
fi
if
[[
-n
"
$IN
"
]]
;
then
if
!
[[
-d
"
$IN
"
]]
;
then
echo
"Bad -i --input argument, must be directory, type ptaskTracer --help for help"
...
...
@@ -147,9 +156,15 @@ else # no svg option
fi
else
echo
"Unspecified application path -p or --path"
echo
"Using current dir
r
ecory"
echo
"Using current direc
t
ory"
APPPATH
=
"."
fi
if
[[
-n
"
$ARG
"
]]
;
then
if
!
[[
-f
"
$ARG
"
]]
;
then
echo
"Bad -a --args argument, must be file, type ptaskTracer --help for help"
exit
1
fi
fi
if
[[
-n
"
$TIME
"
]]
;
then
if
!
[[
$TIME
=
~ ^[0-9]+
([
.][0-9]+
)
?
$
]]
;
then
echo
"Bad -t --time argument, must be unsigned double, type ptaskTracer --help for help"
...
...
@@ -218,13 +233,13 @@ if ! [[ -f "/usr/local/lib/w3c.jar" ]]; then # checking jar java libs
echo
"Java jar lib w3c not found in /usr/local/lib, please run inslall.sh"
exit
1
elif
!
[[
-f
"/usr/local/lib/antlr-4.7.2-complete.jar"
]]
;
then
echo
"Java jar lib antlr-4.7.2-complete not found in /usr/local/lib, please run ins
l
all.sh"
echo
"Java jar lib antlr-4.7.2-complete not found in /usr/local/lib, please run ins
t
all.sh"
exit
1
elif
!
[[
-f
"/usr/local/lib/batik-1.10/lib/batik-all-1.10.jar"
]]
;
then
echo
"Java jar lib batik-all-1.10 not found in /usr/local/lib/batik-1.10/lib, please run ins
l
all.sh"
echo
"Java jar lib batik-all-1.10 not found in /usr/local/lib/batik-1.10/lib, please run ins
t
all.sh"
exit
1
elif
!
[[
-f
"/usr/local/lib/ptaskTracer-1.0.jar"
]]
;
then
echo
"Java jar lib ptaskTracer-1.0 not found in /usr/local/lib, please run ins
l
all.sh"
echo
"Java jar lib ptaskTracer-1.0 not found in /usr/local/lib, please run ins
t
all.sh"
exit
1
fi
echo
-e
"[
\0
33[0;32mOK
\0
33[0m]"
...
...
@@ -277,7 +292,7 @@ if [[ -z "$OLD" ]]; then
if
[
$?
-eq
1
]
;
then
echo
"lttng start error: session not started"
fi
sudo
sh
-c
"exec ./
${
APPPATH
}
/
${
APP
}
> /dev/null &"
sudo
sh
-c
"exec ./
${
APPPATH
}
/
${
APP
}
${
ARGS
}
> /dev/null &"
if
[
$?
-eq
1
]
;
then
echo
"Application
$APP
not started"
exit
1
...
...
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