Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
145ad9ea
Commit
145ad9ea
authored
Apr 30, 2021
by
Jialin Li
Browse files
experiments: enable/disable pcap file in run script
parent
ffe2c856
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
experiments/run.py
experiments/run.py
+5
-0
experiments/simbricks/simulators.py
experiments/simbricks/simulators.py
+2
-0
No files found.
experiments/run.py
View file @
145ad9ea
...
...
@@ -52,6 +52,8 @@ parser.add_argument('--force', action='store_const', const=True, default=False,
parser
.
add_argument
(
'--verbose'
,
action
=
'store_const'
,
const
=
True
,
default
=
False
,
help
=
'Verbose output'
)
parser
.
add_argument
(
'--pcap'
,
action
=
'store_const'
,
const
=
True
,
default
=
False
,
help
=
'Dump pcap file (if supported by simulator)'
)
g_env
=
parser
.
add_argument_group
(
'Environment'
)
g_env
.
add_argument
(
'--repo'
,
metavar
=
'DIR'
,
type
=
str
,
...
...
@@ -104,6 +106,9 @@ def add_exp(e, run, prereq, create_cp, restore_cp):
env
=
exp
.
ExpEnv
(
args
.
repo
,
workdir
,
cpdir
)
env
.
create_cp
=
create_cp
env
.
restore_cp
=
restore_cp
env
.
pcap_file
=
''
if
args
.
pcap
:
env
.
pcap_file
=
workdir
+
'/pcap'
run
=
runtime
.
Run
(
e
,
run
,
env
,
outpath
,
prereq
)
rt
.
add_run
(
run
)
...
...
experiments/simbricks/simulators.py
View file @
145ad9ea
...
...
@@ -248,6 +248,8 @@ class SwitchNet(NetSim):
def
run_cmd
(
self
,
env
):
cmd
=
env
.
repodir
+
'/sims/net/switch/net_switch'
cmd
+=
f
' -m
{
self
.
sync_mode
}
-S
{
self
.
sync_period
}
-E
{
self
.
eth_latency
}
'
if
len
(
env
.
pcap_file
)
>
0
:
cmd
+=
' -p '
+
env
.
pcap_file
for
n
in
self
.
nics
:
cmd
+=
' -s '
+
env
.
nic_eth_path
(
n
)
return
cmd
...
...
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