diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2016-06-27 19:51:19 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2016-06-28 10:14:29 -0400 |
commit | 5a4a805a4d460a6996facc5d1fd06986344c899b (patch) | |
tree | d58feedf49ea751956b9d334cbd3112853eb9c91 /bfs.h | |
parent | 814cccec0dfa7da0646dac0cc39f192d8a574cb8 (diff) | |
download | bfs-5a4a805a4d460a6996facc5d1fd06986344c899b.tar.xz |
Implement -D rates.
Diffstat (limited to 'bfs.h')
-rw-r--r-- | bfs.h | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -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); |