]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: probe: Add 'PROBE_DEBUG'
authorPeter Krempa <pkrempa@redhat.com>
Thu, 30 Apr 2026 05:39:00 +0000 (07:39 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 19 May 2026 07:42:35 +0000 (09:42 +0200)
The standard 'PROBE' macro uses the 'info' priority for the log entry
corresponding to the probe point. While in some cases it makes sense to
log above debug priority in others it does not. Add the possibility to
pick a lower priority level.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virprobe.h

index 80a5f48ec8b9ee23d840b8833966ff0f46b7d8b9..d23b626d2ff8109ed0ddd595427be44e498abfb2 100644 (file)
                      VIR_ADD_CASTS(__VA_ARGS__)); \
     }
 
+# define PROBE_DEBUG(NAME, FMT, ...) \
+    VIR_DEBUG_INT(&virLogSelf, \
+                  __FILE__, __LINE__, __func__, \
+                  #NAME ": " FMT, __VA_ARGS__); \
+    if (LIBVIRT_ ## NAME ## _ENABLED()) { \
+        PROBE_EXPAND(LIBVIRT_ ## NAME, \
+                     VIR_ADD_CASTS(__VA_ARGS__)); \
+    }
+
 # define PROBE_QUIET(NAME, FMT, ...) \
     if (LIBVIRT_ ## NAME ## _ENABLED()) { \
         PROBE_EXPAND(LIBVIRT_ ## NAME, \
                  __FILE__, __LINE__, __func__, \
                  #NAME ": " FMT, __VA_ARGS__);
 
+# define PROBE_DEBUG(NAME, FMT, ...) \
+    VIR_DEBUG_INT(&virLogSelf, \
+                  __FILE__, __LINE__, __func__, \
+                  #NAME ": " FMT, __VA_ARGS__); \
+
 # define PROBE_QUIET(NAME, FMT, ...)
 #endif