[dpdk-dev] [PATCH 2/6] rte_log.h: add detailed log levels RTE_LOG{FINE, FINER, FINEST}
Matthew Hall
mhall at mhcomputing.net
Fri Nov 13 20:14:33 CET 2015
On Fri, Nov 13, 2015 at 11:48:41AM +0000, Ananyev, Konstantin wrote:
> Actually another question: are existing 8 levels not enough?
> Konstantin
Depends who you ask. I was modeling it based upon the following:
https://docs.oracle.com/javase/7/docs/api/java/util/logging/Level.html
The reason I added a previously-merged patch for a new function
rte_get_log_level() and all these extra levels is that it allows me to do
crazy stuff like this:
if (rte_get_log_level() >= RTE_LOG_FINEST) {
rte_hexdump(stderr, "header_bytes", packet->header.bytes, packet->header.header_size);
}
It is extremely valuable to have levels which go below INFO, so you can make
detailed trace code compiled directly into your app. Which can be readily
enabled or disabled by setting the log_level. WAY easier to debug the early
green-field code in your app when it crashes somehow.
Obviously the first thing you guys will say is... "BUT THAT RUNS WAY TOO
SLOW!!!!!" and you might be right if you are processing 100 gbits/sec. But I
am using DPDK for security not for SDN switching or core routing. And my patch
will not introduce any performance change for the guys doing the other stuff
either.
So if this patch is not accepted in some form, I'd be stuck with my DPDK fork
just for this feature, and the pre-existing patches I sent to Bruce & Co.
regarding rte_lpm and rte_lpm6 expansion and so on.
Matthew.
More information about the dev
mailing list