diff --git a/docs/tracing.txt b/docs/tracing.txt
index ec44552..abbae6b 100644
--- a/docs/tracing.txt
+++ b/docs/tracing.txt
@@ -116,6 +116,17 @@ unless you have specific needs for more advanced backends.
 * trace-event NAME on|off
   Enable/disable a given trace event.
 
+==== Enabling/disabling trace events programmatically ====
+
+The change_trace_event_state() function can be used to enable or disable trace
+events at runtime inside QEMU:
+
+    #include "trace.h"
+    
+    change_trace_event_state("virtio_irq", true); /* enable */
+    [...]
+    change_trace_event_state("virtio_irq", false); /* disable */
+
 ==== Analyzing trace files ====
 
 The "simple" backend produces binary trace files that can be formatted with the
