Imported Upstream version 16.07-rc1
[deb_dpdk.git] / debian / patches / ubuntu-backport-42-increase-default-logging-level.patch
1 Index: dpdk/config/common_base
2 ===================================================================
3 --- dpdk.orig/config/common_base
4 +++ dpdk/config/common_base
5 @@ -88,7 +88,7 @@ CONFIG_RTE_MAX_NUMA_NODES=8
6  CONFIG_RTE_MAX_MEMSEG=256
7  CONFIG_RTE_MAX_MEMZONE=2560
8  CONFIG_RTE_MAX_TAILQ=32
9 -CONFIG_RTE_LOG_LEVEL=8
10 +CONFIG_RTE_LOG_LEVEL=RTE_LOG_INFO
11  CONFIG_RTE_LOG_HISTORY=256
12  CONFIG_RTE_LIBEAL_USE_HPET=n
13  CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n
14 Index: dpdk/doc/guides/faq/faq.rst
15 ===================================================================
16 --- dpdk.orig/doc/guides/faq/faq.rst
17 +++ dpdk/doc/guides/faq/faq.rst
18 @@ -88,9 +88,7 @@ the wrong socket, the application simply
19  On application startup, there is a lot of EAL information printed. Is there any way to reduce this?
20  ---------------------------------------------------------------------------------------------------
21  
22 -Yes, each EAL has a configuration file that is located in the /config directory. Within each configuration file, you will find CONFIG_RTE_LOG_LEVEL=8.
23 -You can change this to a lower value, such as 6 to reduce this printout of debug information. The following is a list of LOG levels that can be found in the rte_log.h file.
24 -You must remove, then rebuild, the EAL directory for the change to become effective as the configuration file creates the rte_config.h file in the EAL directory.
25 +Yes, the option ``--log-level=`` accepts one of these numbers:
26  
27  .. code-block:: c
28  
29 @@ -103,6 +101,9 @@ You must remove, then rebuild, the EAL d
30      #define RTE_LOG_INFO 7U     /* Informational. */
31      #define RTE_LOG_DEBUG 8U    /* Debug-level messages. */
32  
33 +It is also possible to change the maximum (and default level) at compile time
34 +with ``CONFIG_RTE_LOG_LEVEL``.
35 +
36  
37  How can I tune my network application to achieve lower latency?
38  ---------------------------------------------------------------
39 Index: dpdk/lib/librte_eal/common/eal_common_log.c
40 ===================================================================
41 --- dpdk.orig/lib/librte_eal/common/eal_common_log.c
42 +++ dpdk/lib/librte_eal/common/eal_common_log.c
43 @@ -195,5 +195,10 @@ rte_eal_common_log_init(FILE *default_lo
44  {
45         default_log_stream = default_log;
46         rte_openlog_stream(default_log);
47 +
48 +#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
49 +       RTE_LOG(NOTICE, EAL, "Debug logs available - lower performance\n");
50 +#endif
51 +
52         return 0;
53  }
54 Index: dpdk/lib/librte_eal/common/eal_common_options.c
55 ===================================================================
56 --- dpdk.orig/lib/librte_eal/common/eal_common_options.c
57 +++ dpdk/lib/librte_eal/common/eal_common_options.c
58 @@ -141,7 +141,11 @@ eal_reset_internal_config(struct interna
59  
60         internal_cfg->syslog_facility = LOG_DAEMON;
61         /* default value from build option */
62 +#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
63 +       internal_cfg->log_level = RTE_LOG_INFO;
64 +#else
65         internal_cfg->log_level = RTE_LOG_LEVEL;
66 +#endif
67  
68         internal_cfg->xen_dom0_support = 0;
69  
70 Index: dpdk/scripts/test-build.sh
71 ===================================================================
72 --- dpdk.orig/scripts/test-build.sh
73 +++ dpdk/scripts/test-build.sh
74 @@ -138,6 +138,7 @@ config () # <directory> <target> <option
75                 ! echo $3 | grep -q '+shared' || \
76                 sed -ri         's,(SHARED_LIB=)n,\1y,' $1/.config
77                 ! echo $3 | grep -q '+debug' || ( \
78 +               sed -ri     's,(RTE_LOG_LEVEL=).*,\1RTE_LOG_DEBUG,' $1/.config
79                 sed -ri           's,(_DEBUG.*=)n,\1y,' $1/.config
80                 sed -ri            's,(_STAT.*=)n,\1y,' $1/.config
81                 sed -ri 's,(TEST_PMD_RECORD_.*=)n,\1y,' $1/.config )