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

2016-10-13 Thread Thomas Monjalon
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

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

2016-10-12 Thread Thomas Monjalon
2016-10-12 12:38, John Ousterhout: > @@ -127,6 +125,19 @@ rte_vlog(uint32_t level, uint32_t logtype, const char > *format, va_list ap) > { > int ret; > FILE *f = rte_logs.file; > + if (f == NULL) { > + f = default_log_stream; > + if (f == NULL) { > +

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

2016-10-12 Thread John Ousterhout
Suppose an application starts up, calls rte_eal_init, then later on invokes code like this: fclose(stderr); stderr = fopen("foo", "w"); This might happen if it is using stderr for its log, but decides to roll the log over to a new file. Now stderr has changed. However, if DPDK made a copy of

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

2016-10-12 Thread 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