THanks for the follow-up Ihar.
Acked-by: Mark Michelson <mmich...@redhat.com>
That marks the entire series as acked.
On 11/28/23 12:43, Ihar Hrachyshka wrote:
The daemon will now log to scapy.log file.
Log messages include stats on request processing time as well as any
errors that may happen during processing.
If you'd like to see even more logs (e.g. for debugging purposes), just
pass --verbose to scapy-server.
Signed-off-by: Ihar Hrachyshka <ihrac...@redhat.com>
---
tests/ovn-macros.at | 5 ++++-
tests/scapy-server.py | 16 ++++++++++++++--
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/tests/ovn-macros.at b/tests/ovn-macros.at
index 0b15bcc80..21c314c7c 100644
--- a/tests/ovn-macros.at
+++ b/tests/ovn-macros.at
@@ -882,7 +882,10 @@ fmt_pkt() {
start_scapy_server() {
pidfile=$ovs_base/scapy.pid
ctlfile=$ovs_base/scapy.ctl
- "$top_srcdir"/tests/scapy-server.py --pidfile=$pidfile --unixctl=$ctlfile
--detach
+ logfile=$ovs_base/scapy.log
+
+ "$top_srcdir"/tests/scapy-server.py \
+ --pidfile=$pidfile --unixctl=$ctlfile --log-file=$logfile --detach
on_exit "test -e \"$pidfile\" && ovs-appctl -t $ctlfile exit"
}
diff --git a/tests/scapy-server.py b/tests/scapy-server.py
index a7255c84d..1cc616f70 100755
--- a/tests/scapy-server.py
+++ b/tests/scapy-server.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
import argparse
+import time
import ovs.daemon
import ovs.unixctl
@@ -23,15 +24,24 @@ def exit(conn, argv, aux):
def process(data):
+ start_time = time.perf_counter()
+ vlog.info(f"received payload request: {data}")
try:
data = data.replace('\n', '')
return binascii.hexlify(raw(eval(data))).decode()
- except Exception:
+ except Exception as e:
+ vlog.exception(f"failed to process payload request: {e}")
return ""
+ finally:
+ total_time = (time.perf_counter() - start_time) * 1000
+ vlog.info(f"took {total_time:.2f}ms to process payload request")
def payload(conn, argv, aux):
- conn.reply(process(argv[0]))
+ try:
+ conn.reply(process(argv[0]))
+ except Exception as e:
+ vlog.exception(f"failed to reply to payload request: {e}")
def main():
@@ -55,6 +65,8 @@ def main():
ovs.unixctl.command_register("payload", "", 1, 1, payload, None)
ovs.daemon.daemonize_complete()
+ vlog.info("scapy server ready")
+
poller = ovs.poller.Poller()
while not exiting:
server.run()
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev