Skip to content

Commit 3adeeb3

Browse files
committed
chore: null-terminate perf commands
1 parent 8c9fd4a commit 3adeeb3

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/run/runner/wall_time/perf/fifo.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,28 +96,28 @@ impl PerfFifo {
9696
}
9797

9898
pub async fn start_events(&mut self) -> anyhow::Result<()> {
99-
self.ctl_fifo.write_all(b"enable\n").await?;
99+
self.ctl_fifo.write_all(b"enable\n\0").await?;
100100
self.wait_for_ack().await;
101101

102102
Ok(())
103103
}
104104

105105
pub async fn stop_events(&mut self) -> anyhow::Result<()> {
106-
self.ctl_fifo.write_all(b"disable\n").await?;
106+
self.ctl_fifo.write_all(b"disable\n\0").await?;
107107
self.wait_for_ack().await;
108108

109109
Ok(())
110110
}
111111

112112
pub async fn ping(&mut self) -> anyhow::Result<()> {
113-
self.ctl_fifo.write_all(b"ping\n").await?;
113+
self.ctl_fifo.write_all(b"ping\n\0").await?;
114114
self.wait_for_ack().await;
115115

116116
Ok(())
117117
}
118118

119119
async fn wait_for_ack(&mut self) {
120-
const ACK: &[u8] = b"ack\n\x00";
120+
const ACK: &[u8] = b"ack\n\0";
121121

122122
loop {
123123
let mut buf: [u8; ACK.len()] = [0; ACK.len()];

src/run/runner/wall_time/perf/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl PerfRunner {
193193
let mut integration = None;
194194

195195
loop {
196-
let perf_ping = tokio::time::timeout(Duration::from_secs(1), perf_fifo.ping()).await;
196+
let perf_ping = tokio::time::timeout(Duration::from_secs(15), perf_fifo.ping()).await;
197197
if let Ok(Err(_)) | Err(_) = perf_ping {
198198
error!("Perf timeout");
199199
break;

0 commit comments

Comments
 (0)