From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id ACBB2A00C5; Thu, 30 Apr 2020 01:28:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F310F1D964; Thu, 30 Apr 2020 01:28:02 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 38B311D925 for ; Thu, 30 Apr 2020 01:28:00 +0200 (CEST) IronPort-SDR: oPZLk+7JHsLqOPpN4HQUn9/UhsG72sa27Dnp6RocESas+KveMjFrLwgBi07VZUr0jiurE67orj LDRnIsxgDMwg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 16:27:58 -0700 IronPort-SDR: JrgJBID+HP+PYm5mq10BsIWVl0ayr3PZnPQLoZh0yzTAAk3m3vg6gIR63tuddB7/lhg6eqlOO2 W7cKHoRqB3QA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,333,1583222400"; d="scan'208";a="459366476" Received: from win-dpdk-pallavi.jf.intel.com (HELO localhost.localdomain) ([10.166.188.75]) by fmsmga005.fm.intel.com with ESMTP; 29 Apr 2020 16:27:58 -0700 From: Pallavi Kadam To: dev@dpdk.org, thomas@monjalon.net Cc: ranjit.menon@intel.com, Harini.Ramakrishnan@microsoft.com, Narcisa.Vasile@microsoft.com, dmitry.kozliuk@gmail.com, tbashar@mellanox.com, pallavi.kadam@intel.com Date: Wed, 29 Apr 2020 16:24:26 -0700 Message-Id: <20200429232427.7112-2-pallavi.kadam@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 In-Reply-To: <20200429232427.7112-1-pallavi.kadam@intel.com> References: <20200429232427.7112-1-pallavi.kadam@intel.com> Subject: [dpdk-dev] [PATCH 1/2] eal: initialize eal logging on Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add logging function on Windows to send log output to the console. Signed-off-by: Pallavi Kadam Reviewed-by: Ranjit Menon Reviewed-by: Tasnim Bashar Tested-by: Dmitry Kozlyuk --- lib/librte_eal/windows/eal.c | 3 +++ lib/librte_eal/windows/eal_log.c | 16 ++++++++++++++++ lib/librte_eal/windows/meson.build | 1 + 3 files changed, 20 insertions(+) create mode 100644 lib/librte_eal/windows/eal_log.c diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c index 2cf7a04ef..123afed8d 100644 --- a/lib/librte_eal/windows/eal.c +++ b/lib/librte_eal/windows/eal.c @@ -227,6 +227,9 @@ rte_eal_init(int argc, char **argv) { int i, fctret; + /* initialize all logs */ + rte_eal_log_init(NULL, 0); + eal_log_level_parse(argc, argv); /* create a map of all processors in the system */ diff --git a/lib/librte_eal/windows/eal_log.c b/lib/librte_eal/windows/eal_log.c new file mode 100644 index 000000000..875981f13 --- /dev/null +++ b/lib/librte_eal/windows/eal_log.c @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2017-2018 Intel Corporation + */ + +#include "eal_private.h" + +/* set the log to default function, called during eal init process. */ +int +rte_eal_log_init(__rte_unused const char *id, __rte_unused int facility) +{ + rte_openlog_stream(stderr); + + eal_log_set_default(stderr); + + return 0; +} diff --git a/lib/librte_eal/windows/meson.build b/lib/librte_eal/windows/meson.build index 09dd4ab2f..e5d1d8336 100644 --- a/lib/librte_eal/windows/meson.build +++ b/lib/librte_eal/windows/meson.build @@ -7,6 +7,7 @@ sources += files( 'eal.c', 'eal_debug.c', 'eal_lcore.c', + 'eal_log.c', 'eal_thread.c', 'getopt.c', ) -- 2.18.0.windows.1