From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 089F9A00C5;
	Sun, 26 Apr 2020 18:42:06 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 59D401C031;
	Sun, 26 Apr 2020 18:42:06 +0200 (CEST)
Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com
 [209.85.167.67]) by dpdk.org (Postfix) with ESMTP id 134ED1BF8A
 for <dev@dpdk.org>; Sun, 26 Apr 2020 18:42:05 +0200 (CEST)
Received: by mail-lf1-f67.google.com with SMTP id f8so11776566lfe.12
 for <dev@dpdk.org>; Sun, 26 Apr 2020 09:42:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=TGa1n1xdbeYHX8h7Pd3RWy0vd6DtDUq+OsA00fE0++0=;
 b=W3ZAhWHBx6JnIZjbxMaKzT2r06nwfK5FmH3yc0ykMACVAEGvWlENv2QtjUGqPZCW2G
 9EDEOJHNC2tmfI4yg5gB5VNiLx+ClvuFEiwaRp37HqbFwWegVEOcvg/gacEsCea+AqAd
 WAmUp1EwUsToM3TVJVKXkG5wa/fFDKe7iQ44MUqeUdzo4qF/9omPlk39xwDdkW9q0r5x
 dK5Vyacfk1OWsJcHsPmb0WUdDMaNYtR5EPJGrBDnQimVtmkg0zqQjTgvJMRuv3P4ZNG5
 eM60GErgIGrDaL3lJ3KKmprRD4Ul+cM3KnucXxQWtmyloCYLFUU7z1BEjQ5+hGxA0ebw
 RKAA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=TGa1n1xdbeYHX8h7Pd3RWy0vd6DtDUq+OsA00fE0++0=;
 b=ulSTEfHc4oCs5RKHoY+R5TBy8ykGswXjhegbqy+YJ1epq7TtSGueybBwxDC3kU7k7U
 XL2k5bJK/esYVbbyDkynM5YmtMHntbfFspI3JcIw/5TTXiCZi/SJT1FZ13zo+iW2NqM7
 lXR1P+hMe6lZ4/Ru9ConGNbQ9z3iChWftNlJX/Hb9vbZRPeaf677+tb2OQ+hf9Yn8lsC
 kTdeuU0lWrKusuDO9pxsPyPoqclNNCG5ewpQGS5UqJVjjmsOpiw16e08gTmiMaPcOSzd
 fCP+K2ZV80DvNhD/p3cTJfMsta5ZbUK2+v8euVMsNDqKihuaFi3TJWeXRqPvYedrIC9A
 8q5g==
X-Gm-Message-State: AGi0PuZ2GGzIBIos0RmvlQtEqgmf/+q73O3SXDfIJ/EbqS1G9dV9U877
 wITBpK+OVGJg1du+a21T/NixuiX/VMs=
X-Google-Smtp-Source: APiQypJlERtBB71fNebOb2lwv/C6ByZXfdgRre8z8xVEdxbeVeMFxHYC9QB4ujmed9yxkPyYdp+ZUQ==
X-Received: by 2002:a05:6512:14a:: with SMTP id
 m10mr12696321lfo.152.1587919324126; 
 Sun, 26 Apr 2020 09:42:04 -0700 (PDT)
Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru.
 [37.110.65.23])
 by smtp.googlemail.com with ESMTPSA id 78sm8360337ljf.76.2020.04.26.09.42.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 26 Apr 2020 09:42:03 -0700 (PDT)
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
To: dev@dpdk.org
Cc: Pallavi Kadam <pallavi.kadam@intel.com>,
 Narcisa Ana Maria Vasile <Narcisa.Vasile@microsoft.com>,
 Ranjit Menon <ranjit.menon@intel.com>,
 Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
 Thomas Monjalon <thomas@monjalon.net>,
 Sunil Kumar Kori <skori@marvell.com>,
 David Marchand <david.marchand@redhat.com>,
 Jerin Jacob <jerinj@marvell.com>
Date: Sun, 26 Apr 2020 19:41:52 +0300
Message-Id: <20200426164153.2512126-1-dmitry.kozliuk@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20200426152819.2496610-1-dmitry.kozliuk@gmail.com>
References: <20200426152819.2496610-1-dmitry.kozliuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-dev] [PATCH v3] eal: disable tracing on Windows
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Fix build errors caused by using Unix-specific functions in common code.
Hide and disable command-line options related to tracing on Windows.

Fixes: 3d26a70ae338 ("trace: add trace configuration parameter")
Fixes: 3b155d24bdaf ("trace: hook subsystem to Linux")

Reported-by: Pallavi Kadam <pallavi.kadam@intel.com>
Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
 lib/librte_eal/common/eal_common_options.c | 6 ++++++
 lib/librte_eal/common/eal_common_thread.c  | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index 7e3a7df9c..418731ca4 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -34,7 +34,9 @@
 #include "eal_options.h"
 #include "eal_filesystem.h"
 #include "eal_private.h"
+#ifndef RTE_EXEC_ENV_WINDOWS
 #include "eal_trace.h"
+#endif
 
 #define BITS_PER_HEX 4
 #define LCORE_OPT_LST 1
@@ -1424,6 +1426,7 @@ eal_parse_common_option(int opt, const char *optarg,
 		break;
 	}
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	case OPT_TRACE_NUM: {
 		if (eal_trace_args_save(optarg) < 0) {
 			RTE_LOG(ERR, EAL, "invalid parameters for --"
@@ -1459,6 +1462,7 @@ eal_parse_common_option(int opt, const char *optarg,
 		}
 		break;
 	}
+#endif /* !RTE_EXEC_ENV_WINDOWS */
 
 	case OPT_LCORES_NUM:
 		if (eal_parse_lcores(optarg) < 0) {
@@ -1735,6 +1739,7 @@ eal_common_usage(void)
 	       "  --"OPT_LOG_LEVEL"=<int>   Set global log level\n"
 	       "  --"OPT_LOG_LEVEL"=<type-match>:<int>\n"
 	       "                      Set specific log level\n"
+#ifndef RTE_EXEC_ENV_WINDOWS
 	       "  --"OPT_TRACE"=<regex-match>\n"
 	       "                      Enable trace based on regular expression trace name.\n"
 	       "                      By default, the trace is disabled.\n"
@@ -1758,6 +1763,7 @@ eal_common_usage(void)
 	       "                      reaches its maximum limit.\n"
 	       "                      Default mode is 'overwrite' and parameter\n"
 	       "                      must be specified once only.\n"
+#endif /* !RTE_EXEC_ENV_WINDOWS */
 	       "  -v                  Display version information on startup\n"
 	       "  -h, --help          This help\n"
 	       "  --"OPT_IN_MEMORY"   Operate entirely in memory. This will\n"
diff --git a/lib/librte_eal/common/eal_common_thread.c b/lib/librte_eal/common/eal_common_thread.c
index 20dbcc7a0..f9f588c17 100644
--- a/lib/librte_eal/common/eal_common_thread.c
+++ b/lib/librte_eal/common/eal_common_thread.c
@@ -15,7 +15,9 @@
 #include <rte_lcore.h>
 #include <rte_memory.h>
 #include <rte_log.h>
+#ifndef RTE_EXEC_ENV_WINDOWS
 #include <rte_trace_point.h>
+#endif
 
 #include "eal_internal_cfg.h"
 #include "eal_private.h"
@@ -166,7 +168,10 @@ static void *rte_thread_init(void *arg)
 		pthread_barrier_destroy(&params->configured);
 		free(params);
 	}
+
+#ifndef RTE_EXEC_ENV_WINDOWS
 	__rte_trace_mem_per_thread_alloc();
+#endif
 	return start_routine(routine_arg);
 }
 
-- 
2.25.1