Skip to contentSkip to conversation

don't use printf!

DISCUSSION Stephen Hemminger 1 participant 1 message Mar 9, 2016

lore
Share & tools
lore
#0 lore raw

One thing I noticed while fixing mempool bug, was that there was a printf in the library there. A reminder, code in DPDK library should never call printf directly. printf in a real application is often ratholed off to /dev/null and real output is through API's or syslog.

Offenders now:
rte_mempool
rte_acl
rte_cfgfile

I would fix rte_acl but it would require API breakage. rte_acl_dump should take a FILE *

Some places have printf in debug path, which is less bad, but still limits usage of DEBUG options
rte_sched
rte_timer

There are also several places in the BSD support, but I care less about those.