[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v1 1/4] qemu-log: Allow checking of the current
From: |
Peter Crosthwaite |
Subject: |
[Qemu-devel] [RFC PATCH v1 1/4] qemu-log: Allow checking of the current mask |
Date: |
Sun, 3 Mar 2013 16:13:01 +1000 |
Useful for heavy users of qemu_log_mask that want to avoid executing expensive
logic that sets up a qemu_log_mask when that mask is disabled. E.G.
if (qemu_log_get_mask() && LOG_GUEST_ERROR) {
/* do my expensive logging data query */
}
qemu_log_mask(LOG_GUEST_ERROR, ...)
Signed-off-by: Peter Crosthwaite <address@hidden>
---
include/qemu/log.h | 2 ++
qemu-log.c | 5 +++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/include/qemu/log.h b/include/qemu/log.h
index 6b0db02..68188f0 100644
--- a/include/qemu/log.h
+++ b/include/qemu/log.h
@@ -154,6 +154,8 @@ static inline void qemu_set_log(int log_flags)
#endif
}
+int qemu_get_log_flags(void);
+
void qemu_set_log_filename(const char *filename);
int qemu_str_to_log_mask(const char *str);
diff --git a/qemu-log.c b/qemu-log.c
index 797f2af..2ffee1d 100644
--- a/qemu-log.c
+++ b/qemu-log.c
@@ -82,6 +82,11 @@ void do_qemu_set_log(int log_flags, bool use_own_buffers)
}
}
+int qemu_get_log_flags(void)
+{
+ return qemu_loglevel;
+}
+
void qemu_set_log_filename(const char *filename)
{
g_free(logfilename);
--
1.7.0.4
- [Qemu-devel] [RFC PATCH v1 0/4] Data Driven device registers & Zynq DEVCFG, Peter Crosthwaite, 2013/03/03
- [Qemu-devel] [RFC PATCH v1 1/4] qemu-log: Allow checking of the current mask,
Peter Crosthwaite <=
- [Qemu-devel] [RFC PATCH v1 2/4] bitops: Add UInt32StateInfo and helper functions, Peter Crosthwaite, 2013/03/03
- Re: [Qemu-devel] [RFC PATCH v1 2/4] bitops: Add UInt32StateInfo and helper functions, Blue Swirl, 2013/03/03
- Re: [Qemu-devel] [RFC PATCH v1 2/4] bitops: Add UInt32StateInfo and helper functions, Michael S. Tsirkin, 2013/03/04
- Re: [Qemu-devel] [RFC PATCH v1 2/4] bitops: Add UInt32StateInfo and helper functions, Blue Swirl, 2013/03/04
- Re: [Qemu-devel] [RFC PATCH v1 2/4] bitops: Add UInt32StateInfo and helper functions, Michael S. Tsirkin, 2013/03/05
- Re: [Qemu-devel] [RFC PATCH v1 2/4] bitops: Add UInt32StateInfo and helper functions, Gerd Hoffmann, 2013/03/05