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 DBB59A0352; Wed, 6 May 2020 03:34:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7DBEA1D669; Wed, 6 May 2020 03:34:40 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 833211D629 for ; Wed, 6 May 2020 03:34:37 +0200 (CEST) IronPort-SDR: 6egdXxsMx42eC3K0A6zhNsNMem14fHBGpfwaGwS7wU1EgDsMHlZVr6OQjXSiUOVrnyEXP5XWDr pyx4/yjxF4ow== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2020 18:34:35 -0700 IronPort-SDR: wnstoUq9UjRCCSwJKYr0VQv/Fvk+qjYybosnPVuy+WvldUPtJ4nCu2ydxah62ITTlwkw7jfbIP rZyvswV1KTnQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,357,1583222400"; d="scan'208";a="369640664" Received: from win-dpdk-pallavi.jf.intel.com (HELO localhost.localdomain) ([10.166.188.75]) by fmsmga001.fm.intel.com with ESMTP; 05 May 2020 18:34:35 -0700 From: Pallavi Kadam To: dev@dpdk.org, thomas@monjalon.net Cc: ranjit.menon@intel.com, dmitry.kozliuk@gmail.com, Narcisa.Vasile@microsoft.com, tbashar@mellanox.com, Harini.Ramakrishnan@microsoft.com, pallavi.kadam@intel.com Date: Tue, 5 May 2020 18:30:32 -0700 Message-Id: <20200506013032.7668-3-pallavi.kadam@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 In-Reply-To: <20200506013032.7668-1-pallavi.kadam@intel.com> References: <20200429232427.7112-1-pallavi.kadam@intel.com> <20200506013032.7668-1-pallavi.kadam@intel.com> Subject: [dpdk-dev] [PATCH v2 2/2] eal: add log support 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" Initialize logging 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 8829407c4..adfc8b9b7 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', 'fnmatch.c', 'getopt.c', -- 2.18.0.windows.1