diff options
author | 2018-04-13 14:37:34 -0500 | |
---|---|---|
committer | 2018-04-13 14:38:35 -0500 | |
commit | 691a2304c8c29a3b7d5977908ef82aaf188f5ba0 (patch) | |
tree | cbb813ee2803e68aebf9e6bb1450bf800ba4a51e | |
parent | 0c053e580e60940a3e36404359accfddde11e2a6 (diff) | |
download | pseudo-691a2304c8c29a3b7d5977908ef82aaf188f5ba0.tar.gz pseudo-691a2304c8c29a3b7d5977908ef82aaf188f5ba0.tar.bz2 pseudo-691a2304c8c29a3b7d5977908ef82aaf188f5ba0.zip |
Less chatty debugging
Stop producing the path mismatch messages for things with multiple
links. We could probably make this smarter, but for now this is
sufficient to reduce the spam.
pseudo_debug(0, ...) now produces a message, as a special case.
Signed-off-by: Seebs <seebs@seebs.net>
-rw-r--r-- | ChangeLog.txt | 8 | ||||
-rw-r--r-- | pseudo.c | 6 | ||||
-rw-r--r-- | pseudo.h | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index dee80f3..6d91bb3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,11 @@ +2018-04-13: + * (seebs) Reduce spamminess of path mismatches. + Don't log path mismatches with multiple links unless you've + requested path+verbose debugging. Also allow pseudo_debug + to take a 0 to indicate "always debug", because we want that + message unconditionally, and I don't want near-identical + calls to diag() and debug(). + 2018-04-02: * (seebs) Change default copyright notice in guts to say "Peter Seebach" rather than "Wind River" as I haven't @@ -706,7 +706,11 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon msg->path); pdb_did_unlink_file(path_by_ino, &by_ino, by_ino.deleting); } else { - pseudo_diag("path mismatch [%d link%s]: ino %llu db '%s' req '%s'.\n", + int flags = 0; + if (msg->nlink > 1) { + flags = PDBGF_FILE | PDBGF_VERBOSE; + } + pseudo_debug(flags, "path mismatch [%d link%s]: ino %llu db '%s' req '%s'.\n", msg->nlink, msg->nlink == 1 ? "" : "s", (unsigned long long) msg_header.ino, @@ -53,7 +53,7 @@ extern void pseudo_evlog_dump(void); if ((x) & PDBGF_VERBOSE) { \ if ((pseudo_util_debug_flags & PDBGF_VERBOSE) && (pseudo_util_debug_flags & ((x) & ~PDBGF_VERBOSE))) { pseudo_diag(__VA_ARGS__); } \ } else { \ - if (pseudo_util_debug_flags & (x)) { pseudo_diag(__VA_ARGS__); } \ + if ((pseudo_util_debug_flags & (x)) || ((x) == 0)) { pseudo_diag(__VA_ARGS__); } \ } \ } while (0) #define pseudo_debug_call(x, fn, ...) do { \ |