Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-993

A somewhat different approach to --enable-verbose: inline __wt_verbose()

    • Type: Icon: Task Task
    • Resolution: Done
    • WT2.2
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      @agorrod: Alex, I noticed we quite a few WT_UNUSED statements (and lint reports even more than gcc does, it complains when variables are written but never subsequently read).

      Here's a slightly different approach for your consideration: I inlined the __wt_verbose call (inlined so the flag test wouldn't require a function call), and then all of the WT_UNUSED magic can go in one place, neither gcc or lint complain if you call a function and that function doesn't use the variables you pass it.

      This also makes the verbose calls look like normal calls so we don't need the {{WT_VERBOSE_

      {ERR,RET,TRET}}} macros, we can fall back to the usual {{WT_{ERR,RET,TRET}

      }} calls.

      This is a bigger change, but I think it's actually a simpler change and we'll avoid having to mark random variables as WT_UNUSED in the future.

      One downside to this approach is we're inlining:

      va_start(ap, fmt);
      ret = __wt_eventv(session, 1, 0, NULL, 0, fmt, ap);
      va_end(ap);
      

      in every function that calls __wt_verbose.

            Assignee:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Reporter:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: