Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lisa/microsoft/testsuites/performance/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@ def perf_ntttcp( # noqa: C901
lagscope_server_ip
if lagscope_server_ip is not None
else server.internal_address
)
),
no_debug_log=True,
)

# Start ntttcp server asynchronously to accept incoming
Expand All @@ -507,6 +508,7 @@ def perf_ntttcp( # noqa: C901
buffer_size=buffer_size,
dev_differentiator=dev_differentiator,
udp_mode=udp_mode,
no_debug_log=True,
)

# Start lagscope client to measure latency during the
Expand All @@ -521,6 +523,7 @@ def perf_ntttcp( # noqa: C901
length_of_histogram_intervals=0,
count_of_histogram_intervals=0,
dump_csv=False,
no_debug_log=True,
)

# Run ntttcp client and monitor for hangs
Expand All @@ -533,6 +536,7 @@ def perf_ntttcp( # noqa: C901
ports_count=num_threads_p,
dev_differentiator=dev_differentiator,
udp_mode=udp_mode,
no_debug_log=True,
)

# Stop the server and collect results from both client
Expand Down
16 changes: 12 additions & 4 deletions lisa/tools/lagscope.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,17 @@ def restore_busy_poll(self) -> None:
for key in self._busy_pool_keys:
sysctl.write(key, self._original_settings[key])

def run_as_server_async(self, ip: str = "") -> Process:
def run_as_server_async(self, ip: str = "", no_debug_log: bool = False) -> Process:
# -r: run as a receiver
# -rip: run as server mode with specified ip address
cmd = ""
if ip:
cmd += f" -r{ip}"
else:
cmd += " -r"
process = self.run_async(cmd, sudo=True, shell=True, force_run=True)
process = self.run_async(
cmd, sudo=True, shell=True, force_run=True, no_debug_log=no_debug_log
)
if not process.is_running():
raise LisaException("lagscope server failed to start")
if not self.node.tools[Lsof].is_port_opened_per_process_name(self.command):
Expand All @@ -164,6 +166,7 @@ def run_as_client_async(
count_of_histogram_intervals: int = 30,
dump_csv: bool = True,
daemon: bool = False,
no_debug_log: bool = False,
) -> Process:
# -s: run as a sender
# -i: test interval
Expand Down Expand Up @@ -197,7 +200,7 @@ def run_as_client_async(
cmd += " -P "
if dump_csv:
cmd += f" -RLatency-{get_datetime_path()}.csv "
process = self.node.execute_async(cmd, shell=True)
process = self.node.execute_async(cmd, shell=True, no_debug_log=no_debug_log)
return process

def run_as_client(
Expand All @@ -213,6 +216,7 @@ def run_as_client(
count_of_histogram_intervals: int = 30,
dump_csv: bool = True,
daemon: bool = False,
no_debug_log: bool = False,
) -> ExecutableResult:
process = self.run_as_client_async(
server_ip,
Expand All @@ -226,6 +230,7 @@ def run_as_client(
count_of_histogram_intervals,
dump_csv,
daemon,
no_debug_log,
)

result = process.wait_result()
Expand Down Expand Up @@ -532,7 +537,7 @@ def restore_busy_poll(self) -> None:
# This is not supported on FreeBSD.
return

def run_as_server_async(self, ip: str = "") -> Process:
def run_as_server_async(self, ip: str = "", no_debug_log: bool = False) -> Process:
return self.node.tools[Sockperf].start_server_async("tcp")
Comment thread
vyadavmsft marked this conversation as resolved.

def run_as_client_async(
Expand All @@ -548,6 +553,7 @@ def run_as_client_async(
count_of_histogram_intervals: int = 30,
dump_csv: bool = True,
daemon: bool = False,
no_debug_log: bool = False,
) -> Process:
return self.node.tools[Sockperf].run_client_async("tcp", server_ip)

Expand All @@ -564,6 +570,7 @@ def run_as_client(
count_of_histogram_intervals: int = 30,
dump_csv: bool = True,
daemon: bool = False,
no_debug_log: bool = False,
) -> ExecutableResult:
process = self.run_as_client_async(
server_ip,
Expand All @@ -577,6 +584,7 @@ def run_as_client(
count_of_histogram_intervals,
dump_csv,
daemon,
no_debug_log,
)
result = process.wait_result()
return result
Expand Down
12 changes: 12 additions & 0 deletions lisa/tools/ntttcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def run_as_server_async(
dev_differentiator: str = "Hypervisor callback interrupts",
run_as_daemon: bool = False,
udp_mode: bool = False,
no_debug_log: bool = False,
) -> Process:
cmd = ""
if server_ip:
Expand All @@ -236,6 +237,7 @@ def run_as_server_async(
f"ulimit -n 204800 && {self.pre_command}{self.command} {cmd}",
shell=True,
sudo=True,
no_debug_log=no_debug_log,
)
# NTTTCP for Linux 1.4.0
# ---------------------------------------------------------
Expand All @@ -258,6 +260,7 @@ def run_as_server(
dev_differentiator: str = "Hypervisor callback interrupts",
run_as_daemon: bool = False,
udp_mode: bool = False,
no_debug_log: bool = False,
) -> ExecutableResult:
# -rserver_ip: run as a receiver with specified server ip address
# -P: Number of ports listening on receiver side [default: 16] [max: 512]
Expand Down Expand Up @@ -286,6 +289,7 @@ def run_as_server(
dev_differentiator,
run_as_daemon,
udp_mode,
no_debug_log,
)

return self.wait_server_result(process)
Expand All @@ -309,6 +313,7 @@ def run_as_client_async(
dev_differentiator: str = "Hypervisor callback interrupts",
run_as_daemon: bool = False,
udp_mode: bool = False,
no_debug_log: bool = False,
) -> Process:
cmd = (
f" -s{server_ip} -P {ports_count} -n {threads_count} -t {run_time_seconds} "
Expand All @@ -325,6 +330,7 @@ def run_as_client_async(
f"ulimit -n 204800 && {self.pre_command}{self.command} {cmd}",
shell=True,
sudo=True,
no_debug_log=no_debug_log,
)
return process

Expand All @@ -342,6 +348,7 @@ def run_as_client(
run_as_daemon: bool = False,
udp_mode: bool = False,
tolerance_seconds: int = 60,
no_debug_log: bool = False,
) -> ExecutableResult:
# -sserver_ip: run as a sender with server ip address
# -P: Number of ports listening on receiver side [default: 16] [max: 512]
Expand Down Expand Up @@ -373,6 +380,7 @@ def run_as_client(
dev_differentiator,
run_as_daemon,
udp_mode,
no_debug_log,
)
return process.wait_result(
expected_exit_code=0,
Expand Down Expand Up @@ -868,6 +876,7 @@ def run_as_server_async(
dev_differentiator: str = "Hypervisor callback interrupts",
run_as_daemon: bool = False,
udp_mode: bool = False,
no_debug_log: bool = False,
) -> Process:
assert server_ip, "server ip is required for ntttcp server"
self._log.debug(
Expand All @@ -889,6 +898,7 @@ def run_as_server_async(
f"ulimit -n 204800 && {self.pre_command}{self.command} {cmd}",
shell=True,
sudo=True,
no_debug_log=no_debug_log,
)
time.sleep(5)

Expand All @@ -908,6 +918,7 @@ def run_as_client(
run_as_daemon: bool = False,
udp_mode: bool = False,
tolerance_seconds: int = 60,
no_debug_log: bool = False,
) -> ExecutableResult:
self._log.debug(
"Paramers nic_name, cool_down_time_seconds, warm_up_time_seconds, "
Expand All @@ -928,6 +939,7 @@ def run_as_client(
expected_exit_code=0,
expected_exit_code_failure_message=f"fail to run {self.command} {cmd}",
timeout=run_time_seconds + tolerance_seconds,
no_debug_log=no_debug_log,
)
Comment thread
vyadavmsft marked this conversation as resolved.
return result

Expand Down
Loading