log: deprecate history dump
The log history uses rte_mempool. In order to remove the mempool dependency in EAL (and improve the build), this feature is deprecated. The ABI is kept but the behaviour is now voided because it seems this function was not used. The history can be read from syslog. Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: David Marchand <david.marchand@6wind.com>
This commit is contained in:
parent
bf5a46fa59
commit
a3f34a98b7
@ -7268,8 +7268,6 @@ static void cmd_dump_parsed(void *parsed_result,
|
|||||||
rte_dump_physmem_layout(stdout);
|
rte_dump_physmem_layout(stdout);
|
||||||
else if (!strcmp(res->dump, "dump_memzone"))
|
else if (!strcmp(res->dump, "dump_memzone"))
|
||||||
rte_memzone_dump(stdout);
|
rte_memzone_dump(stdout);
|
||||||
else if (!strcmp(res->dump, "dump_log_history"))
|
|
||||||
rte_log_dump_history(stdout);
|
|
||||||
else if (!strcmp(res->dump, "dump_struct_sizes"))
|
else if (!strcmp(res->dump, "dump_struct_sizes"))
|
||||||
dump_struct_sizes();
|
dump_struct_sizes();
|
||||||
else if (!strcmp(res->dump, "dump_ring"))
|
else if (!strcmp(res->dump, "dump_ring"))
|
||||||
@ -7284,7 +7282,6 @@ cmdline_parse_token_string_t cmd_dump_dump =
|
|||||||
TOKEN_STRING_INITIALIZER(struct cmd_dump_result, dump,
|
TOKEN_STRING_INITIALIZER(struct cmd_dump_result, dump,
|
||||||
"dump_physmem#"
|
"dump_physmem#"
|
||||||
"dump_memzone#"
|
"dump_memzone#"
|
||||||
"dump_log_history#"
|
|
||||||
"dump_struct_sizes#"
|
"dump_struct_sizes#"
|
||||||
"dump_ring#"
|
"dump_ring#"
|
||||||
"dump_mempool#"
|
"dump_mempool#"
|
||||||
|
@ -93,12 +93,6 @@ def per_sockets(num):
|
|||||||
"Func" : default_autotest,
|
"Func" : default_autotest,
|
||||||
"Report" : None,
|
"Report" : None,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"Name" : "Dump log history",
|
|
||||||
"Command" : "dump_log_history",
|
|
||||||
"Func" : dump_autotest,
|
|
||||||
"Report" : None,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"Name" : "Dump rings",
|
"Name" : "Dump rings",
|
||||||
"Command" : "dump_ring",
|
"Command" : "dump_ring",
|
||||||
|
@ -144,16 +144,11 @@ def logs_autotest(child, test_name):
|
|||||||
i = 0
|
i = 0
|
||||||
child.sendline(test_name)
|
child.sendline(test_name)
|
||||||
|
|
||||||
# logs sequence is printed twice because of history dump
|
|
||||||
log_list = [
|
log_list = [
|
||||||
"TESTAPP1: error message",
|
"TESTAPP1: error message",
|
||||||
"TESTAPP1: critical message",
|
"TESTAPP1: critical message",
|
||||||
"TESTAPP2: critical message",
|
"TESTAPP2: critical message",
|
||||||
"TESTAPP1: error message",
|
"TESTAPP1: error message",
|
||||||
"TESTAPP1: error message",
|
|
||||||
"TESTAPP1: critical message",
|
|
||||||
"TESTAPP2: critical message",
|
|
||||||
"TESTAPP1: error message",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
for log_msg in log_list:
|
for log_msg in log_list:
|
||||||
|
@ -150,8 +150,6 @@ static void cmd_dump_parsed(void *parsed_result,
|
|||||||
rte_dump_physmem_layout(stdout);
|
rte_dump_physmem_layout(stdout);
|
||||||
else if (!strcmp(res->dump, "dump_memzone"))
|
else if (!strcmp(res->dump, "dump_memzone"))
|
||||||
rte_memzone_dump(stdout);
|
rte_memzone_dump(stdout);
|
||||||
else if (!strcmp(res->dump, "dump_log_history"))
|
|
||||||
rte_log_dump_history(stdout);
|
|
||||||
else if (!strcmp(res->dump, "dump_struct_sizes"))
|
else if (!strcmp(res->dump, "dump_struct_sizes"))
|
||||||
dump_struct_sizes();
|
dump_struct_sizes();
|
||||||
else if (!strcmp(res->dump, "dump_ring"))
|
else if (!strcmp(res->dump, "dump_ring"))
|
||||||
@ -164,7 +162,7 @@ static void cmd_dump_parsed(void *parsed_result,
|
|||||||
|
|
||||||
cmdline_parse_token_string_t cmd_dump_dump =
|
cmdline_parse_token_string_t cmd_dump_dump =
|
||||||
TOKEN_STRING_INITIALIZER(struct cmd_dump_result, dump,
|
TOKEN_STRING_INITIALIZER(struct cmd_dump_result, dump,
|
||||||
"dump_physmem#dump_memzone#dump_log_history#"
|
"dump_physmem#dump_memzone#"
|
||||||
"dump_struct_sizes#dump_ring#dump_mempool#"
|
"dump_struct_sizes#dump_ring#dump_mempool#"
|
||||||
"dump_devargs");
|
"dump_devargs");
|
||||||
|
|
||||||
|
@ -83,9 +83,6 @@ test_logs(void)
|
|||||||
RTE_LOG(ERR, TESTAPP1, "error message\n");
|
RTE_LOG(ERR, TESTAPP1, "error message\n");
|
||||||
RTE_LOG(ERR, TESTAPP2, "error message (not displayed)\n");
|
RTE_LOG(ERR, TESTAPP2, "error message (not displayed)\n");
|
||||||
|
|
||||||
/* print again the previous logs */
|
|
||||||
rte_log_dump_history(stdout);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,9 +38,7 @@ In the DPDK, it is identified by name and uses a ring to store free objects.
|
|||||||
It provides some other optional services such as a per-core object cache and
|
It provides some other optional services such as a per-core object cache and
|
||||||
an alignment helper to ensure that objects are padded to spread them equally on all DRAM or DDR3 channels.
|
an alignment helper to ensure that objects are padded to spread them equally on all DRAM or DDR3 channels.
|
||||||
|
|
||||||
This library is used by the
|
This library is used by the :ref:`Mbuf Library <Mbuf_Library>`.
|
||||||
:ref:`Mbuf Library <Mbuf_Library>` and the
|
|
||||||
:ref:`Environment Abstraction Layer <Environment_Abstraction_Layer>` (for logging history).
|
|
||||||
|
|
||||||
Cookies
|
Cookies
|
||||||
-------
|
-------
|
||||||
|
@ -8,6 +8,9 @@ API and ABI deprecation notices are to be posted here.
|
|||||||
Deprecation Notices
|
Deprecation Notices
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
* The log history is deprecated.
|
||||||
|
It is voided in 16.07 and will be removed in release 16.11.
|
||||||
|
|
||||||
* The ethdev hotplug API is going to be moved to EAL with a notification
|
* The ethdev hotplug API is going to be moved to EAL with a notification
|
||||||
mechanism added to crypto and ethdev libraries so that hotplug is now
|
mechanism added to crypto and ethdev libraries so that hotplug is now
|
||||||
available to both of them. This API will be stripped of the device arguments
|
available to both of them. This API will be stripped of the device arguments
|
||||||
|
@ -41,7 +41,6 @@ CFLAGS += -I$(SRCDIR)/include
|
|||||||
CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common
|
CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common
|
||||||
CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
|
CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
|
||||||
CFLAGS += -I$(RTE_SDK)/lib/librte_ring
|
CFLAGS += -I$(RTE_SDK)/lib/librte_ring
|
||||||
CFLAGS += -I$(RTE_SDK)/lib/librte_mempool
|
|
||||||
CFLAGS += $(WERROR_FLAGS) -O3
|
CFLAGS += $(WERROR_FLAGS) -O3
|
||||||
|
|
||||||
LDLIBS += -lexecinfo
|
LDLIBS += -lexecinfo
|
||||||
|
@ -77,9 +77,6 @@ void __rte_panic(const char *funcname, const char *format, ...)
|
|||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
/* disable history */
|
|
||||||
rte_log_set_history(0);
|
|
||||||
|
|
||||||
rte_log(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, "PANIC in %s():\n", funcname);
|
rte_log(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, "PANIC in %s():\n", funcname);
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
rte_vlog(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, format, ap);
|
rte_vlog(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, format, ap);
|
||||||
@ -98,9 +95,6 @@ rte_exit(int exit_code, const char *format, ...)
|
|||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
/* disable history */
|
|
||||||
rte_log_set_history(0);
|
|
||||||
|
|
||||||
if (exit_code != 0)
|
if (exit_code != 0)
|
||||||
RTE_LOG(CRIT, EAL, "Error - exiting with code: %d\n"
|
RTE_LOG(CRIT, EAL, "Error - exiting with code: %d\n"
|
||||||
" Cause: ", exit_code);
|
" Cause: ", exit_code);
|
||||||
|
@ -31,54 +31,16 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <inttypes.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/queue.h>
|
|
||||||
|
|
||||||
#include <rte_log.h>
|
#include <rte_log.h>
|
||||||
#include <rte_memory.h>
|
|
||||||
#include <rte_memzone.h>
|
|
||||||
#include <rte_launch.h>
|
|
||||||
#include <rte_common.h>
|
|
||||||
#include <rte_cycles.h>
|
|
||||||
#include <rte_eal.h>
|
|
||||||
#include <rte_per_lcore.h>
|
#include <rte_per_lcore.h>
|
||||||
#include <rte_lcore.h>
|
|
||||||
#include <rte_atomic.h>
|
|
||||||
#include <rte_debug.h>
|
|
||||||
#include <rte_spinlock.h>
|
|
||||||
#include <rte_branch_prediction.h>
|
|
||||||
#include <rte_ring.h>
|
|
||||||
#include <rte_mempool.h>
|
|
||||||
|
|
||||||
#include "eal_private.h"
|
#include "eal_private.h"
|
||||||
|
|
||||||
#define LOG_ELT_SIZE 2048
|
|
||||||
|
|
||||||
#define LOG_HISTORY_MP_NAME "log_history"
|
|
||||||
|
|
||||||
STAILQ_HEAD(log_history_list, log_history);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The structure of a message log in the log history.
|
|
||||||
*/
|
|
||||||
struct log_history {
|
|
||||||
STAILQ_ENTRY(log_history) next;
|
|
||||||
unsigned size;
|
|
||||||
char buf[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct rte_mempool *log_history_mp = NULL;
|
|
||||||
static unsigned log_history_size = 0;
|
|
||||||
static struct log_history_list log_history;
|
|
||||||
|
|
||||||
/* global log structure */
|
/* global log structure */
|
||||||
struct rte_logs rte_logs = {
|
struct rte_logs rte_logs = {
|
||||||
.type = ~0,
|
.type = ~0,
|
||||||
@ -86,10 +48,7 @@ struct rte_logs rte_logs = {
|
|||||||
.file = NULL,
|
.file = NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
static rte_spinlock_t log_dump_lock = RTE_SPINLOCK_INITIALIZER;
|
|
||||||
static rte_spinlock_t log_list_lock = RTE_SPINLOCK_INITIALIZER;
|
|
||||||
static FILE *default_log_stream;
|
static FILE *default_log_stream;
|
||||||
static int history_enabled = 1;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This global structure stores some informations about the message
|
* This global structure stores some informations about the message
|
||||||
@ -106,59 +65,16 @@ static RTE_DEFINE_PER_LCORE(struct log_cur_msg, log_cur_msg);
|
|||||||
/* default logs */
|
/* default logs */
|
||||||
|
|
||||||
int
|
int
|
||||||
rte_log_add_in_history(const char *buf, size_t size)
|
rte_log_add_in_history(const char *buf __rte_unused, size_t size __rte_unused)
|
||||||
{
|
{
|
||||||
struct log_history *hist_buf = NULL;
|
|
||||||
static const unsigned hist_buf_size = LOG_ELT_SIZE - sizeof(*hist_buf);
|
|
||||||
void *obj;
|
|
||||||
|
|
||||||
if (history_enabled == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
rte_spinlock_lock(&log_list_lock);
|
|
||||||
|
|
||||||
/* get a buffer for adding in history */
|
|
||||||
if (log_history_size > RTE_LOG_HISTORY) {
|
|
||||||
hist_buf = STAILQ_FIRST(&log_history);
|
|
||||||
if (hist_buf) {
|
|
||||||
STAILQ_REMOVE_HEAD(&log_history, next);
|
|
||||||
log_history_size--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (rte_mempool_mc_get(log_history_mp, &obj) < 0)
|
|
||||||
obj = NULL;
|
|
||||||
hist_buf = obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* no buffer */
|
|
||||||
if (hist_buf == NULL) {
|
|
||||||
rte_spinlock_unlock(&log_list_lock);
|
|
||||||
return -ENOBUFS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* not enough room for msg, buffer go back in mempool */
|
|
||||||
if (size >= hist_buf_size) {
|
|
||||||
rte_mempool_mp_put(log_history_mp, hist_buf);
|
|
||||||
rte_spinlock_unlock(&log_list_lock);
|
|
||||||
return -ENOBUFS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* add in history */
|
|
||||||
memcpy(hist_buf->buf, buf, size);
|
|
||||||
hist_buf->buf[size] = hist_buf->buf[hist_buf_size-1] = '\0';
|
|
||||||
hist_buf->size = size;
|
|
||||||
STAILQ_INSERT_TAIL(&log_history, hist_buf, next);
|
|
||||||
log_history_size++;
|
|
||||||
rte_spinlock_unlock(&log_list_lock);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rte_log_set_history(int enable)
|
rte_log_set_history(int enable)
|
||||||
{
|
{
|
||||||
history_enabled = enable;
|
if (enable)
|
||||||
|
RTE_LOG(WARNING, EAL, "The log history is deprecated.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Change the stream that will be used by logging system */
|
/* Change the stream that will be used by logging system */
|
||||||
@ -217,44 +133,8 @@ int rte_log_cur_msg_logtype(void)
|
|||||||
|
|
||||||
/* Dump log history to file */
|
/* Dump log history to file */
|
||||||
void
|
void
|
||||||
rte_log_dump_history(FILE *out)
|
rte_log_dump_history(FILE *out __rte_unused)
|
||||||
{
|
{
|
||||||
struct log_history_list tmp_log_history;
|
|
||||||
struct log_history *hist_buf;
|
|
||||||
unsigned i;
|
|
||||||
|
|
||||||
/* only one dump at a time */
|
|
||||||
rte_spinlock_lock(&log_dump_lock);
|
|
||||||
|
|
||||||
/* save list, and re-init to allow logging during dump */
|
|
||||||
rte_spinlock_lock(&log_list_lock);
|
|
||||||
tmp_log_history = log_history;
|
|
||||||
STAILQ_INIT(&log_history);
|
|
||||||
log_history_size = 0;
|
|
||||||
rte_spinlock_unlock(&log_list_lock);
|
|
||||||
|
|
||||||
for (i=0; i<RTE_LOG_HISTORY; i++) {
|
|
||||||
|
|
||||||
/* remove one message from history list */
|
|
||||||
hist_buf = STAILQ_FIRST(&tmp_log_history);
|
|
||||||
|
|
||||||
if (hist_buf == NULL)
|
|
||||||
break;
|
|
||||||
|
|
||||||
STAILQ_REMOVE_HEAD(&tmp_log_history, next);
|
|
||||||
|
|
||||||
/* write on stdout */
|
|
||||||
if (fwrite(hist_buf->buf, hist_buf->size, 1, out) == 0) {
|
|
||||||
rte_mempool_mp_put(log_history_mp, hist_buf);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* put back message structure in pool */
|
|
||||||
rte_mempool_mp_put(log_history_mp, hist_buf);
|
|
||||||
}
|
|
||||||
fflush(out);
|
|
||||||
|
|
||||||
rte_spinlock_unlock(&log_dump_lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -297,29 +177,11 @@ rte_log(uint32_t level, uint32_t logtype, const char *format, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* called by environment-specific log init function to initialize log
|
* called by environment-specific log init function
|
||||||
* history
|
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
rte_eal_common_log_init(FILE *default_log)
|
rte_eal_common_log_init(FILE *default_log)
|
||||||
{
|
{
|
||||||
STAILQ_INIT(&log_history);
|
|
||||||
|
|
||||||
/* reserve RTE_LOG_HISTORY*2 elements, so we can dump and
|
|
||||||
* keep logging during this time */
|
|
||||||
log_history_mp = rte_mempool_create(LOG_HISTORY_MP_NAME, RTE_LOG_HISTORY*2,
|
|
||||||
LOG_ELT_SIZE, 0, 0,
|
|
||||||
NULL, NULL,
|
|
||||||
NULL, NULL,
|
|
||||||
SOCKET_ID_ANY, MEMPOOL_F_NO_PHYS_CONTIG);
|
|
||||||
|
|
||||||
if ((log_history_mp == NULL) &&
|
|
||||||
((log_history_mp = rte_mempool_lookup(LOG_HISTORY_MP_NAME)) == NULL)){
|
|
||||||
RTE_LOG(ERR, EAL, "%s(): cannot create log_history mempool\n",
|
|
||||||
__func__);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
default_log_stream = default_log;
|
default_log_stream = default_log;
|
||||||
rte_openlog_stream(default_log);
|
rte_openlog_stream(default_log);
|
||||||
|
|
||||||
|
@ -49,9 +49,6 @@ int rte_eal_memzone_init(void);
|
|||||||
/**
|
/**
|
||||||
* Common log initialization function (private to eal).
|
* Common log initialization function (private to eal).
|
||||||
*
|
*
|
||||||
* Called by environment-specific log initialization function to initialize
|
|
||||||
* log history.
|
|
||||||
*
|
|
||||||
* @param default_log
|
* @param default_log
|
||||||
* The default log stream to be used.
|
* The default log stream to be used.
|
||||||
* @return
|
* @return
|
||||||
|
@ -42,6 +42,8 @@
|
|||||||
* This file provides a log API to RTE applications.
|
* This file provides a log API to RTE applications.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "rte_common.h" /* for __rte_deprecated macro */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@ -179,22 +181,27 @@ int rte_log_cur_msg_loglevel(void);
|
|||||||
int rte_log_cur_msg_logtype(void);
|
int rte_log_cur_msg_logtype(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @deprecated
|
||||||
* Enable or disable the history (enabled by default)
|
* Enable or disable the history (enabled by default)
|
||||||
*
|
*
|
||||||
* @param enable
|
* @param enable
|
||||||
* true to enable, or 0 to disable history.
|
* true to enable, or 0 to disable history.
|
||||||
*/
|
*/
|
||||||
|
__rte_deprecated
|
||||||
void rte_log_set_history(int enable);
|
void rte_log_set_history(int enable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @deprecated
|
||||||
* Dump the log history to a file
|
* Dump the log history to a file
|
||||||
*
|
*
|
||||||
* @param f
|
* @param f
|
||||||
* A pointer to a file for output
|
* A pointer to a file for output
|
||||||
*/
|
*/
|
||||||
|
__rte_deprecated
|
||||||
void rte_log_dump_history(FILE *f);
|
void rte_log_dump_history(FILE *f);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @deprecated
|
||||||
* Add a log message to the history.
|
* Add a log message to the history.
|
||||||
*
|
*
|
||||||
* This function can be called from a user-defined log stream. It adds
|
* This function can be called from a user-defined log stream. It adds
|
||||||
@ -209,6 +216,7 @@ void rte_log_dump_history(FILE *f);
|
|||||||
* - 0: Success.
|
* - 0: Success.
|
||||||
* - (-ENOBUFS) if there is no room to store the message.
|
* - (-ENOBUFS) if there is no room to store the message.
|
||||||
*/
|
*/
|
||||||
|
__rte_deprecated
|
||||||
int rte_log_add_in_history(const char *buf, size_t size);
|
int rte_log_add_in_history(const char *buf, size_t size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -77,9 +77,6 @@ void __rte_panic(const char *funcname, const char *format, ...)
|
|||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
/* disable history */
|
|
||||||
rte_log_set_history(0);
|
|
||||||
|
|
||||||
rte_log(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, "PANIC in %s():\n", funcname);
|
rte_log(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, "PANIC in %s():\n", funcname);
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
rte_vlog(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, format, ap);
|
rte_vlog(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, format, ap);
|
||||||
@ -98,9 +95,6 @@ rte_exit(int exit_code, const char *format, ...)
|
|||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
/* disable history */
|
|
||||||
rte_log_set_history(0);
|
|
||||||
|
|
||||||
if (exit_code != 0)
|
if (exit_code != 0)
|
||||||
RTE_LOG(CRIT, EAL, "Error - exiting with code: %d\n"
|
RTE_LOG(CRIT, EAL, "Error - exiting with code: %d\n"
|
||||||
" Cause: ", exit_code);
|
" Cause: ", exit_code);
|
||||||
|
@ -50,8 +50,7 @@
|
|||||||
#include "eal_private.h"
|
#include "eal_private.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* default log function, used once mempool (hence log history) is
|
* default log function
|
||||||
* available
|
|
||||||
*/
|
*/
|
||||||
static ssize_t
|
static ssize_t
|
||||||
console_log_write(__attribute__((unused)) void *c, const char *buf, size_t size)
|
console_log_write(__attribute__((unused)) void *c, const char *buf, size_t size)
|
||||||
@ -60,9 +59,6 @@ console_log_write(__attribute__((unused)) void *c, const char *buf, size_t size)
|
|||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
uint32_t loglevel;
|
uint32_t loglevel;
|
||||||
|
|
||||||
/* add this log in history */
|
|
||||||
rte_log_add_in_history(buf, size);
|
|
||||||
|
|
||||||
/* write on stdout */
|
/* write on stdout */
|
||||||
ret = fwrite(buf, 1, size, stdout);
|
ret = fwrite(buf, 1, size, stdout);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
@ -110,8 +106,7 @@ rte_eal_log_init(const char *id, int facility)
|
|||||||
/* early logs */
|
/* early logs */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* early log function, used during boot when mempool (hence log
|
* early log function, used before rte_eal_log_init
|
||||||
* history) is not available
|
|
||||||
*/
|
*/
|
||||||
static ssize_t
|
static ssize_t
|
||||||
early_log_write(__attribute__((unused)) void *c, const char *buf, size_t size)
|
early_log_write(__attribute__((unused)) void *c, const char *buf, size_t size)
|
||||||
|
@ -1003,7 +1003,6 @@ void rte_mempool_check_cookies(const struct rte_mempool *mp,
|
|||||||
|
|
||||||
if (free == 0) {
|
if (free == 0) {
|
||||||
if (cookie != RTE_MEMPOOL_HEADER_COOKIE1) {
|
if (cookie != RTE_MEMPOOL_HEADER_COOKIE1) {
|
||||||
rte_log_set_history(0);
|
|
||||||
RTE_LOG(CRIT, MEMPOOL,
|
RTE_LOG(CRIT, MEMPOOL,
|
||||||
"obj=%p, mempool=%p, cookie=%" PRIx64 "\n",
|
"obj=%p, mempool=%p, cookie=%" PRIx64 "\n",
|
||||||
obj, (const void *) mp, cookie);
|
obj, (const void *) mp, cookie);
|
||||||
@ -1012,7 +1011,6 @@ void rte_mempool_check_cookies(const struct rte_mempool *mp,
|
|||||||
hdr->cookie = RTE_MEMPOOL_HEADER_COOKIE2;
|
hdr->cookie = RTE_MEMPOOL_HEADER_COOKIE2;
|
||||||
} else if (free == 1) {
|
} else if (free == 1) {
|
||||||
if (cookie != RTE_MEMPOOL_HEADER_COOKIE2) {
|
if (cookie != RTE_MEMPOOL_HEADER_COOKIE2) {
|
||||||
rte_log_set_history(0);
|
|
||||||
RTE_LOG(CRIT, MEMPOOL,
|
RTE_LOG(CRIT, MEMPOOL,
|
||||||
"obj=%p, mempool=%p, cookie=%" PRIx64 "\n",
|
"obj=%p, mempool=%p, cookie=%" PRIx64 "\n",
|
||||||
obj, (const void *) mp, cookie);
|
obj, (const void *) mp, cookie);
|
||||||
@ -1022,7 +1020,6 @@ void rte_mempool_check_cookies(const struct rte_mempool *mp,
|
|||||||
} else if (free == 2) {
|
} else if (free == 2) {
|
||||||
if (cookie != RTE_MEMPOOL_HEADER_COOKIE1 &&
|
if (cookie != RTE_MEMPOOL_HEADER_COOKIE1 &&
|
||||||
cookie != RTE_MEMPOOL_HEADER_COOKIE2) {
|
cookie != RTE_MEMPOOL_HEADER_COOKIE2) {
|
||||||
rte_log_set_history(0);
|
|
||||||
RTE_LOG(CRIT, MEMPOOL,
|
RTE_LOG(CRIT, MEMPOOL,
|
||||||
"obj=%p, mempool=%p, cookie=%" PRIx64 "\n",
|
"obj=%p, mempool=%p, cookie=%" PRIx64 "\n",
|
||||||
obj, (const void *) mp, cookie);
|
obj, (const void *) mp, cookie);
|
||||||
@ -1032,7 +1029,6 @@ void rte_mempool_check_cookies(const struct rte_mempool *mp,
|
|||||||
tlr = __mempool_get_trailer(obj);
|
tlr = __mempool_get_trailer(obj);
|
||||||
cookie = tlr->cookie;
|
cookie = tlr->cookie;
|
||||||
if (cookie != RTE_MEMPOOL_TRAILER_COOKIE) {
|
if (cookie != RTE_MEMPOOL_TRAILER_COOKIE) {
|
||||||
rte_log_set_history(0);
|
|
||||||
RTE_LOG(CRIT, MEMPOOL,
|
RTE_LOG(CRIT, MEMPOOL,
|
||||||
"obj=%p, mempool=%p, cookie=%" PRIx64 "\n",
|
"obj=%p, mempool=%p, cookie=%" PRIx64 "\n",
|
||||||
obj, (const void *) mp, cookie);
|
obj, (const void *) mp, cookie);
|
||||||
|
Loading…
Reference in New Issue
Block a user