projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
init: add global 'warned' state
[fio.git]
/
debug.h
diff --git
a/debug.h
b/debug.h
index e3aa3f183875ba37a67d80542d7afd110325f6ea..68a5adca268e6b331433ffa58183c44b3b45ed67 100644
(file)
--- a/
debug.h
+++ b/
debug.h
@@
-2,6
+2,7
@@
#define FIO_DEBUG_H
#include <assert.h>
#define FIO_DEBUG_H
#include <assert.h>
+#include "lib/types.h"
#include "log.h"
enum {
#include "log.h"
enum {
@@
-26,7
+27,17
@@
enum {
FD_DEBUG_MAX,
};
FD_DEBUG_MAX,
};
-extern unsigned int fio_debug_jobno, *fio_debug_jobp;
+extern unsigned int fio_debug_jobno, *fio_debug_jobp, *fio_warned;
+
+static inline bool fio_did_warn(unsigned int mask)
+{
+ if (!(*fio_warned & mask)) {
+ *fio_warned |= mask;
+ return true;
+ }
+
+ return false;
+}
#ifdef FIO_INC_DEBUG
struct debug_level {
#ifdef FIO_INC_DEBUG
struct debug_level {