From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v4] log: respect rte_openlog_stream calls before rte_eal_init Date: Thu, 13 Oct 2016 22:03:39 +0200 Message-ID: <6204069.cm9KbzbHpo@xps13> References: <20160928204244.8288-1-ouster@cs.stanford.edu> <20161012193832.5016-1-ouster@cs.stanford.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: John Ousterhout Return-path: Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) by dpdk.org (Postfix) with ESMTP id B6B052BA6 for ; Thu, 13 Oct 2016 22:03:44 +0200 (CEST) Received: by mail-lf0-f45.google.com with SMTP id b81so150571167lfe.1 for ; Thu, 13 Oct 2016 13:03:44 -0700 (PDT) In-Reply-To: <20161012193832.5016-1-ouster@cs.stanford.edu> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Applied, thanks