[Swan-dev] [Swan-commit] Changes to ref refs/heads/master

Andrew Cagney andrew.cagney at gmail.com
Wed Aug 1 20:59:34 UTC 2018


On Mon, 9 Jul 2018 at 11:50, Antony Antony <antony at phenome.org> wrote:
>
> On Mon, Jul 09, 2018 at 09:45:47AM -0400, Andrew Cagney wrote:
> > Just pass in a stack allocated lswlog
>
> Andrew, do you mean like the usage in ikev2_spdb_struct.c ?
>
> LSWBUF(remote_print_buf) {
>                 int matching_local_propnum = ikev2_process_proposals(...
>                                              remote_print_buf);
>         and BIG chunk of code inside the macro.
> }

The "BIG chunk of code" isn't inside the macro.  Its a block that
binds itself to the inner most for-loop.  That's critical. It avoids
problems inherent constructs like:
  FOO(X) { X }
and:
  FOO(p)  if (p)
most of the nesting comes from what is probably unnecessary optimization.

> I like the direction of starter_errors_t instead of macro LSWBUF
> And fewer logging function is probably a better approach.
>
> Hugh, how about time jumps? if confread wait on things like dns. When it dump the log what will be timestap of lines?

/me mumbles something about getting rid of that

> LSWBUF seems to have smarts for to handle time. Then time will not be montonus in the log. Time prefix becomes a bit tricky to handle with a buffer per transaction.

What smarts?  Each record is timestamped as it is written.  Other than
for threads, things won't be re-ordered.


More information about the Swan-dev mailing list