Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
e3-require
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Anders Lindh Olsson
e3-require
Commits
82812321
Commit
82812321
authored
7 years ago
by
Dirk Zimoch
Browse files
Options
Downloads
Patches
Plain Diff
add support for perf, valgrind and gdb to iocsh
parent
af23a6aa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
iocsh
+40
-19
40 additions, 19 deletions
iocsh
with
40 additions
and
19 deletions
iocsh
+
40
−
19
View file @
82812321
...
@@ -2,29 +2,41 @@
...
@@ -2,29 +2,41 @@
help
()
{
help
()
{
{
{
echo
"
u
sage: iocsh [options] [files] [macro=value] ..."
echo
"
U
sage: iocsh [options] [files] [macro=value] ..."
echo
"Start an EPICS iocsh and load files"
echo
"Start an EPICS iocsh and load files"
echo
echo
echo
"Possible options:"
echo
"Options:"
echo
" -? or -h or --help: Show this page and exit"
echo
" -?, -h, --help Show this page and exit."
echo
" -v or --version: Show version and exit"
echo
" -v, --version Show version and exit."
echo
" -32: Force 32 bit host architecture (on 64 bit systems)"
echo
" -32 Force 32 bit version (on 64 bit systems)."
echo
" -x.z.y: (Up to 3 numbers) Use specific EPICS base version"
echo
" -x.z.y Use EPICS base version x.z.y (e.g. 3.14.8, 3.15, 7)."
echo
" -c: The next string is executed as a command by the EPICS shell"
echo
" -d, --debug Run IOC with gdb."
echo
" -s: The next string is a sequencer program (and arguments), run with 'seq'"
echo
" -dv Run IOC with valgrind."
echo
" This forces an 'iocInit' before running the program."
echo
" -dp Run IOC with perf record."
echo
" -r: The next string is a module (and version), loaded via 'require'"
echo
" -c The next string is executed as a command by the EPICS shell."
echo
" -n: The next string is the IOC name (used for prompt)"
echo
" -s The next string is a sequencer program (and arguments), run with 'seq'."
echo
" Default: dirname if parent dir is
\"
ioc
\"
otherwise hostname"
echo
" This forces an 'iocInit' before running the program."
echo
" -r The next string is a module (and version), loaded via 'require'."
echo
" -n The next string is the IOC name (used for prompt)."
echo
" Default: dirname if parent dir is
\"
ioc
\"
otherwise hostname"
echo
echo
echo
"Supported filetypes:"
echo
"Supported filetypes:"
echo
"*.db, *.dbt
and
*.template
are
loaded via 'dbLoadRecords'"
echo
"
*.db, *.dbt
,
*.template loaded via 'dbLoadRecords'"
echo
"*.subs
and
*.subst
are
loaded via 'dbLoadTemplate'"
echo
"
*.subs
,
*.subst
loaded via 'dbLoadTemplate'"
echo
"*.dbd
is
loaded via 'dbLoadDatabase'"
echo
"
*.dbd
loaded via 'dbLoadDatabase'"
echo
"After the above files, you can specify macro substitutions like m1=v1 m2=v1"
echo
"After the above files, you can specify macro substitutions like m1=v1 m2=v1"
echo
"*.so is loaded via 'dlload' (or 'ld' before 3.14.12)"
echo
" *.so loaded via 'dlload' (or 'ld' before 3.14.12)"
echo
"If an argument is @file, more arguments are read from that file"
echo
echo
"If a file is preceeded with an at sign (@file), more arguments are"
echo
"read from that file."
echo
"All other files are executed as startup scripts by the EPICS shell"
echo
"All other files are executed as startup scripts by the EPICS shell"
echo
echo
"Examples:"
echo
" iocsh st.cmd"
echo
" iocsh my_database.template P=XY M=3"
echo
" iocsh -r my_module,version -c 'initModule()'"
echo
" iocsh -3.15.4 -dp st.cmd"
echo
" iocsh -c 'var requireDebug 1' st.cmd"
}
>
&2
}
>
&2
exit
exit
}
}
...
@@ -221,6 +233,15 @@ do
...
@@ -221,6 +233,15 @@ do
(
@
*
)
(
@
*
)
loadFiles
$(
cat
${
file
#@
}
)
loadFiles
$(
cat
${
file
#@
}
)
;;
;;
(
-d
|
-dg
|
--debug
)
LOADER
=
"gdb --eval-command run --args
$LOADER
"
;;
(
-dv
)
LOADER
=
"valgrind --leak-check=full
$LOADER
"
;;
(
-dp
)
LOADER
=
"perf record
$LOADER
"
;;
(
*
.db
|
*
.template
|
*
.subs
|
*
.subst
|
*
.dbd
)
(
*
.db
|
*
.template
|
*
.subs
|
*
.subst
|
*
.dbd
)
subst
=
""
subst
=
""
while
[
"$#"
-gt
1
]
while
[
"$#"
-gt
1
]
...
@@ -303,7 +324,7 @@ done
...
@@ -303,7 +324,7 @@ done
startup
=
/tmp/iocsh.startup.
$$
startup
=
/tmp/iocsh.startup.
$$
# clean up and kill the softIoc when killed by any signal
# clean up and kill the softIoc when killed by any signal
trap
"kill -s SIGTERM 0; stty sane
;
echo; rm -f
$startup
; "
EXIT
trap
"kill -s SIGTERM 0;
(
stty sane
&&
echo
) 2>/dev/null
; rm -f
$startup
; "
EXIT
{
{
echo
"# date=
\"
$(
date
)
\"
"
echo
"# date=
\"
$(
date
)
\"
"
...
@@ -333,7 +354,7 @@ then
...
@@ -333,7 +354,7 @@ then
LDCMD
=
"dlload"
LDCMD
=
"dlload"
else
else
# get rid of the compiled-in rpath because at PSI that is a link pointing to current EPICS version.
# get rid of the compiled-in rpath because at PSI that is a link pointing to current EPICS version.
LOADER
=
/lib/ld-linux.so.2
LOADER
=
"
$LOADER
/lib/ld-linux.so.2
"
LOADERARGS
=
"--library-path
$EPICS_BASE
/lib/
$EPICS_HOST_ARCH
--inhibit-rpath ''"
LOADERARGS
=
"--library-path
$EPICS_BASE
/lib/
$EPICS_HOST_ARCH
--inhibit-rpath ''"
APP
=
ioc
APP
=
ioc
EXE
=
$EPICS_EXTENSIONS
/bin/
$EPICS_HOST_ARCH
/
$APP
EXE
=
$EPICS_EXTENSIONS
/bin/
$EPICS_HOST_ARCH
/
$APP
...
...
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