Mailing List Archive

New verbose logging and -DSMALL
Hi,

could you make it easy to ifdef out the LogVerbose option
and the file/func/line parameters, to build a version for
a RAMDISK setup?

Something like this:

#ifdef SMALL
#define LOGARGS /* nothing */
#define LOGPARAMS /* nothing */
#else
#define LOGARGS file, func, line,
#define LOGPARAMS const char *file, const char *func, int line,
#endif

And then:

void
-sshfatal(const char *file, const char *func, int line, int showfunc,
+sshfatal(LOGPARAMS int showfunc,
LogLevel level, const char *fmt, ...)
{
va_list args;

va_start(args, fmt);
- ssh_log(file, func, line, showfunc, level, fmt, args);
+ ssh_log(LOGARGS showfunc, level, fmt, args);
va_end(args);
cleanup_exit(255);
}

The rest (ifdeffing out LogVerbose and the handling in the
eventual consumers of these parameters) should be obvious.

If there’s interest, I can prototype a patch if necessary?

Thanks,
//mirabilos
--
<cnuke> den AGP stecker anfeilen, damit er in den slot aufm 440BX board passt…
oder netzteile, an die man auch den monitor angeschlossen hat und die dann für
ein elektrisch aufgeladenes gehäuse gesorgt haben […] für lacher gut auf jeder
LAN party ? <nvb> damals, als der pizzateig noch auf dem monior "gegangen" ist
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: New verbose logging and -DSMALL [ In reply to ]
On Fri, 6 Nov 2020, Thorsten Glaser wrote:

> Hi,
>
> could you make it easy to ifdef out the LogVerbose option
> and the file/func/line parameters, to build a version for
> a RAMDISK setup?

so I experimented with this, replacing __func__ and __FILE__ with "" in
log.h and the savings don't seem worth it:

before
-rwxr-xr-x 1 djm wobj 1039752 Nov 13 14:50 ssh/obj/ssh
-rwxr-xr-x 1 djm wobj 1138344 Nov 13 14:50 sshd/obj/sshd
after:
-rwxr-xr-x 1 djm wobj 1031560 Nov 13 14:51 ssh/obj/ssh
-rwxr-xr-x 1 djm wobj 1130360 Nov 13 14:51 sshd/obj/sshd

making debug*() expand to nothing produces arguable benefits too

-rwxr-xr-x 1 djm wobj 968288 Nov 13 14:55 ssh/obj/ssh
-rwxr-xr-x 1 djm wobj 1069600 Nov 13 14:55 sshd/obj/sshd

I don't think it is worth it.

-d
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: New verbose logging and -DSMALL [ In reply to ]
Hi,

> so I experimented with this, replacing __func__ and __FILE__ with "" in
> log.h and the savings don't seem worth it:

my baseline is a bit lower (less algorithms) and could go
down even more…

text data bss dec hex filename
371332 3068 11092 385492 5e1d4 ssh/obj/ssh
415880 3820 12028 431728 69670 sshd/obj/sshd

… but, yes, less than 8 KiB don’t seem all that much.

> making debug*() expand to nothing produces arguable benefits too

True. Plus, the debug messages themselves are valuable.

> I don't think it is worth it.

Agreed. It was worth a try and thank you for looking
into it.

bye,
//mirabilos
--
15:41?<Lo-lan-do:#fusionforge> Somebody write a testsuite for helloworld :-)
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev