[dpdk-dev] [PATCH v4] log: respect rte_openlog_stream calls before rte_eal_init

Thomas Monjalon thomas.monjalon at 6wind.com
Thu Oct 13 22:03:39 CEST 2016


2016-10-12 12:38, John Ousterhout:
> Before this patch, application-specific loggers could not be
> installed before rte_eal_init completed (the initialization process
> called rte_openlog_stream, overwriting any previously installed
> logger). This made it impossible for an application to capture the
> initial log messages generated during rte_eal_init. This patch changes
> initialization so that information from a previous call to
> rte_openlog_stream is not lost. Specifically:
> * The default log stream is now maintained separately from an
>   application-specific log stream installed with rte_openlog_stream.
> * rte_eal_common_log_init has been renamed to eal_log_set_default,
>   since this is all it does. It no longer invokes rte_openlog_stream; it
>   just updates the default stream. Also, this method now returns void,
>   rather than int, since there are no errors.
> 
> This patch also removes the "early log" mechanism and cleans up the
> log initialization mechanism:
> * The default log stream defaults to stderr on all platforms if
>   eal_log_set_default hasn't been invoked (Linux used to use stdout
>   during the first part of initialization).
> * Removed rte_eal_log_early_init; all of the desired functionality can
>   be achieved by calling eal_log_set_default.
> * Removed lib/librte_eal/bsdapp/eal/eal_log.c: it contained only one
>   function, rte_eal_log_init, which is not needed or invoked for BSD.
> * Removed declaration for eal_default_log_stream in rte_log.h (it's now
>   private to eal_common_log.c).
> * Moved call to rte_eal_log_init earlier in rte_eal_init for Linux, so
>   that it starts using the preferrred log ASAP.
> 
> Signed-off-by: John Ousterhout <ouster at cs.stanford.edu>

Applied, thanks



More information about the dev mailing list