Skip to content

Commit 7665854

Browse files
lukasstraub2jasowang
authored andcommitted
net/colo-compare.c: Only hexdump packets if tracing is enabled
Else the log will be flooded if there is a lot of network traffic. Signed-off-by: Lukas Straub <[email protected]> Reviewed-by: Zhang Chen <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Tested-by: Philippe Mathieu-Daudé <[email protected]> Signed-off-by: Zhang Chen <[email protected]> Signed-off-by: Jason Wang <[email protected]>
1 parent 9c55fe9 commit 7665854

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

net/colo-compare.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,12 @@ static void colo_compare_tcp(CompareState *s, Connection *conn)
483483
g_queue_push_head(&conn->primary_list, ppkt);
484484
g_queue_push_head(&conn->secondary_list, spkt);
485485

486-
qemu_hexdump((char *)ppkt->data, stderr,
487-
"colo-compare ppkt", ppkt->size);
488-
qemu_hexdump((char *)spkt->data, stderr,
489-
"colo-compare spkt", spkt->size);
486+
if (trace_event_get_state_backends(TRACE_COLO_COMPARE_MISCOMPARE)) {
487+
qemu_hexdump((char *)ppkt->data, stderr,
488+
"colo-compare ppkt", ppkt->size);
489+
qemu_hexdump((char *)spkt->data, stderr,
490+
"colo-compare spkt", spkt->size);
491+
}
490492

491493
colo_compare_inconsistency_notify(s);
492494
}

0 commit comments

Comments
 (0)