RFC adding another debug log statement

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Holger Hans Peter Freyther holger at freyther.de
Wed Jan 1 18:36:14 UTC 2014


On Tue, Dec 31, 2013 at 03:57:40AM +0100, noselasd at fiane.dyndns.org wrote:

> see attached patch for an example
> (it may now truncate the hex dumps at a byte boundary vs at a nibble
> when using snprintf if the hex exceeds sizeof(hexd_buff) though)

nice speed-up in deed. I will add a regression for the new truncation.
We seldomly (read never) deal with messages of 4k.

The below code goes from:
real	0m3.233s
user	0m3.212s
sys	0m0.000s


to:
real	0m0.085s
user	0m0.084s
sys	0m0.000s


#include <stdio.h>
#include <stdlib.h>

#include <osmocom/core/utils.h>

int main(int argc, char **argv)
{
	static const int lengths[] = { 23, 1000, 52 };
	char buf[4096];
	int i;

	for (i = 0; i < 30000; ++i) {
		char *res = osmo_hexdump(buf, lengths[i & 3]);
	}
}






More information about the OpenBSC mailing list