[Openswan dev] [PATCH] remove satot calls when debug disabled
D. Hugh Redelmeier
hugh at mimosa.com
Fri Feb 17 18:14:24 CET 2006
| From: David McCullough <davidm at snapgear.com>
| Here's a sample patch for some feedback. Basically, there are a lot of
| satot calls that get invoked even when debug is off. This has a
| significant impact on VPN thoughput.
That is bad and should be fixed.
| If people feel the approach and reasoning is sound I'll produce a full patch
| for all the satot calls that need it. This is a cleaned up version of
| what is already in the OCF patches.
In my opinion, your fix is not the most clear. In some ways it is the
minimal perturbation of the source, which is good if the patch were
not to be adopted by the mainstream code.
In Pluto there was a macro in which to wrap up debug-conditional
code. Code like these calls to satot would be moved within the
same conditional as the print.
Here's a random example from a 4 year old copy:
idtoa(&peer, buf, sizeof(buf));
DBG_log("Peer's ID is %s: '%s'",
Why do I think that this kind of approach is better?
(1) the logic becomes more manifest
(2) the object code isn't bloated with redundant tests
(3) the source code does not have redundant tests
(if redundant tests get out of sync, problems ensue)
More information about the Dev