mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:35:20 +00:00
util: probe: Add quiet versions of the "PROBE" macro
PROBE macro adds a logging entry, when used in places seeing a lot of traffic this can cause a significant slowdown. Signed-off-by: Peter Krempa <pkrempa@redhat.com> (cherry picked from commit f06e488d5484031a76e7ed231c8fef8fa1181d2c)
This commit is contained in:
parent
290886b16c
commit
881d4b65d0
@ -90,11 +90,19 @@
|
|||||||
PROBE_EXPAND(LIBVIRT_ ## NAME, \
|
PROBE_EXPAND(LIBVIRT_ ## NAME, \
|
||||||
VIR_ADD_CASTS(__VA_ARGS__)); \
|
VIR_ADD_CASTS(__VA_ARGS__)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# define PROBE_QUIET(NAME, FMT, ...) \
|
||||||
|
if (LIBVIRT_ ## NAME ## _ENABLED()) { \
|
||||||
|
PROBE_EXPAND(LIBVIRT_ ## NAME, \
|
||||||
|
VIR_ADD_CASTS(__VA_ARGS__)); \
|
||||||
|
}
|
||||||
# else
|
# else
|
||||||
# define PROBE(NAME, FMT, ...) \
|
# define PROBE(NAME, FMT, ...) \
|
||||||
VIR_INFO_INT(&virLogSelf, \
|
VIR_INFO_INT(&virLogSelf, \
|
||||||
__FILE__, __LINE__, __func__, \
|
__FILE__, __LINE__, __func__, \
|
||||||
#NAME ": " FMT, __VA_ARGS__);
|
#NAME ": " FMT, __VA_ARGS__);
|
||||||
|
|
||||||
|
# define PROBE_QUIET(NAME, FMT, ...)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif /* __VIR_PROBE_H__ */
|
#endif /* __VIR_PROBE_H__ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user