From 0b5538c300a56c3cfb33022840fe0b4968147e7a Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Sat, 26 Feb 2011 18:38:39 +0000 Subject: simpletrace: Thread-safe tracing Trace events outside the global mutex cannot be used with the simple trace backend since it is not thread-safe. There is no check to prevent them being enabled so people sometimes learn this the hard way. This patch restructures the simple trace backend with a ring buffer suitable for multiple concurrent writers. A writeout thread empties the trace buffer when threshold fill levels are reached. Should the writeout thread be unable to keep up with trace generation, records will simply be dropped. Each time events are dropped a special record is written to the trace file indicating how many events were dropped. The event ID is 0xfffffffffffffffe and its signature is dropped(uint32_t count). Signed-off-by: Stefan Hajnoczi --- docs/tracing.txt | 5 ----- 1 file changed, 5 deletions(-) (limited to 'docs') diff --git a/docs/tracing.txt b/docs/tracing.txt index a6cc56fd33..f15069c96b 100644 --- a/docs/tracing.txt +++ b/docs/tracing.txt @@ -141,11 +141,6 @@ source tree. It may not be as powerful as platform-specific or third-party trace backends but it is portable. This is the recommended trace backend unless you have specific needs for more advanced backends. -Warning: the "simple" backend is not thread-safe so only enable trace events -that are executed while the global mutex is held. Much of QEMU meets this -requirement but some utility functions like qemu_malloc() or thread-related -code cannot be safely traced using the "simple" backend. - ==== Monitor commands ==== * info trace -- cgit v1.2.3