[v3] eal: disable tracing on Windows

Message ID 20200426164153.2512126-1-dmitry.kozliuk@gmail.com (mailing list archive)
State Accepted, archived
Headers
Series [v3] eal: disable tracing on Windows |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance fail Performance Testing issues
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Dmitry Kozlyuk April 26, 2020, 4:41 p.m. UTC
  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(+)
  

Comments

Jerin Jacob April 26, 2020, 5:46 p.m. UTC | #1
On Sun, Apr 26, 2020 at 10:12 PM Dmitry Kozlyuk
<dmitry.kozliuk@gmail.com> wrote:
>
> 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>

Acked-by: Jerin Jacob <jerinj@marvell.com>


> ---
>  lib/librte_eal/common/eal_common_options.c | 6 ++++++
>  lib/librte_eal/common/eal_common_thread.c  | 5 +++++
>  2 files changed, 11 insertions(+)
>
  
Thomas Monjalon April 26, 2020, 6:10 p.m. UTC | #2
26/04/2020 19:46, Jerin Jacob:
> On Sun, Apr 26, 2020 at 10:12 PM Dmitry Kozlyuk
> <dmitry.kozliuk@gmail.com> wrote:
> >
> > 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>
> 
> Acked-by: Jerin Jacob <jerinj@marvell.com>

Applied, thanks
  

Patch

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);
 }