fix(hoststack): Apply chrt when starting iperf 63/42963/12
authorVratko Polak <[email protected]>
Mon, 19 May 2025 11:06:39 +0000 (13:06 +0200)
committerVratko Polak <[email protected]>
Mon, 19 May 2025 11:06:39 +0000 (13:06 +0200)
This is needed to restore TCP ldpreload performance.
UDP ldrpeload performance is still not good enough,
to be addressed later.

+ Change strace command to print summary, useful for debugging.

Change-Id: Ic08bcb59e47ef6a2e016ed80a9d02638f390e8db
Signed-off-by: Vratko Polak <[email protected]>
resources/libraries/python/HoststackUtil.py

index 2855938..920e8d6 100644 (file)
@@ -311,11 +311,11 @@ class HoststackUtil:
         args = program["args"]
         program_path = program.get("path", "")
         # NGINX used `worker_cpu_affinity` in configuration file
-        taskset_cmd = (
-            "" if program_name == "nginx" else f"taskset --cpu-list {core_list}"
-        )
+        taskset_cmd = ""
+        if program_name != "nginx":
+            taskset_cmd = f"taskset --cpu-list {core_list} chrt -r 99 "
         cmd = (
-            f"nohup {taskset_cmd} {shell_cmd} '{env_vars} "
+            f"nohup {taskset_cmd}{shell_cmd} '{env_vars} "
             f"{program_path}{program_name} {args} >/tmp/{program_name}_"
             f"stdout.log 2>/tmp/{program_name}_stderr.log &'"
         )
@@ -388,7 +388,7 @@ class HoststackUtil:
         if other_node["type"] != "DUT":
             raise RuntimeError("Other node type is not a DUT!")
 
-        cmd = f"sh -c 'strace -qqe trace=none -p {program_pid}'"
+        cmd = f"sh -c 'strace -c -fp {program_pid}'"
         try:
             exec_cmd(node, cmd, sudo=True)
         except: