Skip to content

Commit 9e8fe8d

Browse files
committed
fto-orchestration yaf.py add YafZC capability
1 parent 427e14b commit 9e8fe8d

File tree

4 files changed

+309
-32
lines changed

4 files changed

+309
-32
lines changed

tools/ft-analyzer/ftanalyzer/counter/counter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def get_std_deviation(self) -> np.float64:
7272
Returns:
7373
np.float64: the standard deviation
7474
"""
75-
return math.sqrt(self.get_variance())
75+
return math.sqrt(max(self.get_variance(), 0))
7676

7777
def get_cvar(self) -> np.float64:
7878
"""Returns the co-variance of the observed variable

tools/ft-orchestration/src/probe/nprobe.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,20 +201,18 @@ def _switch_to_zc(self, interface_name: str):
201201
return
202202

203203
driver = driver.split(" ")[1].strip()
204-
if driver.endswith("_zc"):
205-
driver = driver[:-3]
204+
if not driver.endswith("_zc"):
206205
Tool(
207206
f"pf_ringcfg --configure-driver {driver}",
208207
executor=self._executor,
209208
sudo=self._sudo,
210209
).run()
211210
time.sleep(5)
212211
Tool(
213-
f"pf_ringcfg --configure-driver {driver} --rss-queues {self._settings.rss_queues}",
212+
f"ethtool --set-channels {interface_name} combined {self._settings.rss_queues}",
214213
executor=self._executor,
215214
sudo=self._sudo,
216215
).run()
217-
time.sleep(5)
218216

219217
def _switch_back_zc(self, interface_name: str):
220218
driver, _ = Tool(

tools/ft-orchestration/src/probe/pidstat.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ def __init__(self, executor: Executor, watch_cmd: str, sudo: bool = False):
5353

5454
pidstat_args = "-rushHvt"
5555

56+
self._process = None
57+
5658
self._cmd = f"""
5759
pidstat {pidstat_args} -C {watch_cmd} | sed -E -e 's/^# //g' -e 's/[ ]+/;/g' -e 's/%/percent_/g' | tail -n2 > {self._outfile}
5860
sleep 1
@@ -88,6 +90,8 @@ def start(self):
8890
raise Exception("pidstat startup error")
8991

9092
def stop(self):
93+
if self._process is None:
94+
return
9195
try:
9296
self._process.stop()
9397
except ExecutableProcessError:

0 commit comments

Comments
 (0)