Commit 145ad9ea authored by Jialin Li's avatar Jialin Li
Browse files

experiments: enable/disable pcap file in run script

parent ffe2c856
......@@ -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)
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment