projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
45693e4
)
Reorganize.
author
Ben Pfaff
<blp@cs.stanford.edu>
Thu, 2 Sep 2004 23:53:23 +0000
(23:53 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Thu, 2 Sep 2004 23:53:23 +0000
(23:53 +0000)
src/lib/debug.c
patch
|
blob
|
history
diff --git
a/src/lib/debug.c
b/src/lib/debug.c
index 9fbf20656c66833b2dee6948c5ce167f6cb297aa..534fc02c6d9066438f04e3538bd4a09dd6c3a741 100644
(file)
--- a/
src/lib/debug.c
+++ b/
src/lib/debug.c
@@
-8,6
+8,8
@@
static bool all_enabled;
static const char *enabled_classes[MAX_CLASSES];
static size_t enabled_cnt;
static const char *enabled_classes[MAX_CLASSES];
static size_t enabled_cnt;
+static bool class_is_enabled (const char *class);
+
/* Enables the debug message classes specified in CLASSES. The
string CLASSES is modified by and becomes owned by this
function. */
/* Enables the debug message classes specified in CLASSES. The
string CLASSES is modified by and becomes owned by this
function. */
@@
-26,22
+28,6
@@
debug_enable (char *classes)
}
}
}
}
-/* Checks whether CLASS is enabled. */
-static bool
-class_is_enabled (const char *class)
-{
- size_t i;
-
- if (all_enabled)
- return true;
-
- for (i = 0; i < enabled_cnt; i++)
- if (!strcmp (enabled_classes[i], class))
- return true;
-
- return false;
-}
-
/* Prints a debug message along with the source file name, line
number, and function name of where it was emitted. CLASS is
used to filter out unwanted messages. */
/* Prints a debug message along with the source file name, line
number, and function name of where it was emitted. CLASS is
used to filter out unwanted messages. */
@@
-100,3
+86,20
@@
debug_backtrace (void)
printk (" %p", frame[1]);
printk (".\n");
}
printk (" %p", frame[1]);
printk (".\n");
}
+
\f
+
+/* Returns true if CLASS is enabled, false otherwise. */
+static bool
+class_is_enabled (const char *class)
+{
+ size_t i;
+
+ if (all_enabled)
+ return true;
+
+ for (i = 0; i < enabled_cnt; i++)
+ if (!strcmp (enabled_classes[i], class))
+ return true;
+
+ return false;
+}