[Spice-devel] [PATCH spice-streaming-agent v3 3/4] Always log statistics

Frediano Ziglio fziglio at redhat.com
Wed May 23 09:01:53 UTC 2018


Allow to see frame size even if frame data is disabled.
Useful to compute frame statistics not spending huge amount of space
for frame data.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 src/spice-streaming-agent.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp
index d4c4707..71ee184 100644
--- a/src/spice-streaming-agent.cpp
+++ b/src/spice-streaming-agent.cpp
@@ -387,12 +387,11 @@ do_capture(StreamPort &stream_port, FILE *f_log)
 
                 spice_stream_send_format(stream_port, width, height, codec);
             }
+            STAT_LOG("Frame of %zu bytes:", frame.buffer_size);
             if (f_log) {
                 if (log_binary) {
                     fwrite(frame.buffer, frame.buffer_size, 1, f_log);
                 } else {
-                    fprintf(f_log, "%" PRIu64 ": Frame of %zu bytes:\n",
-                            get_time(), frame.buffer_size);
                     hexdump(frame.buffer, frame.buffer_size, f_log);
                 }
             }
-- 
2.17.0



More information about the Spice-devel mailing list