summaryrefslogtreecommitdiffstats
path: root/bfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'bfs.h')
-rw-r--r--bfs.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/bfs.h b/bfs.h
index 1ebbf0d..fc2bcc8 100644
--- a/bfs.h
+++ b/bfs.h
@@ -54,11 +54,13 @@ typedef bool eval_fn(const struct expr *expr, struct eval_state *state);
*/
enum debug_flags {
/** Print optimization details. */
- DEBUG_OPT = 1 << 0,
+ DEBUG_OPT = 1 << 0,
+ /** Print rate information. */
+ DEBUG_RATES = 1 << 1,
/** Trace all stat() calls. */
- DEBUG_STAT = 1 << 1,
+ DEBUG_STAT = 1 << 2,
/** Print the parse tree. */
- DEBUG_TREE = 1 << 2,
+ DEBUG_TREE = 1 << 3,
};
/**
@@ -173,6 +175,13 @@ struct expr {
/** Whether this expression has no side effects. */
bool pure;
+ /** Number of times this predicate was executed. */
+ size_t evaluations;
+ /** Number of times this predicate succeeded. */
+ size_t successes;
+ /** Total time spent running this predicate. */
+ struct timespec elapsed;
+
/** The number of command line arguments for this expression. */
size_t argc;
/** The command line arguments comprising this expression. */
@@ -215,6 +224,11 @@ struct expr {
struct cmdline *parse_cmdline(int argc, char *argv[]);
/**
+ * Dump the parsed command line.
+ */
+void dump_cmdline(const struct cmdline *cmdline, bool verbose);
+
+/**
* Evaluate the command line.
*/
int eval_cmdline(const struct cmdline *cmdline);