diff mbox

[04/23] mlx5: Add cmake options to replace --with-mlx5_debug/mw_debug

Message ID 1474495729-17604-5-git-send-email-jgunthorpe@obsidianresearch.com (mailing list archive)
State Accepted
Headers show

Commit Message

Jason Gunthorpe Sept. 21, 2016, 10:08 p.m. UTC
Simply enable -D flags when building.

Use as:
  $ cmake -DMLX5_DEBUG=TRUE -DMLX5_MW_DEBUG=TRUE

Reported-by: Yishai Hadas <yishaih@dev.mellanox.co.il>
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 libmlx5/src/CMakeLists.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Yishai Hadas Sept. 22, 2016, 3:27 p.m. UTC | #1
On 9/22/2016 1:08 AM, Jason Gunthorpe wrote:
> Simply enable -D flags when building.
>
> Use as:
>   $ cmake -DMLX5_DEBUG=TRUE -DMLX5_MW_DEBUG=TRUE

The patch works fine for those symbols, thanks.

Need to consider whether there are other symbols in the original 
repositories that require similar patch. (e.g. valgrind, resolve-neigh, 
etc.)

> Reported-by: Yishai Hadas <yishaih@dev.mellanox.co.il>
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> ---
>  libmlx5/src/CMakeLists.txt | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/libmlx5/src/CMakeLists.txt b/libmlx5/src/CMakeLists.txt
> index a34a8063eeb2..44df83b47d96 100644
> --- a/libmlx5/src/CMakeLists.txt
> +++ b/libmlx5/src/CMakeLists.txt
> @@ -1,3 +1,15 @@
> +set(MLX5_DEBUG "FALSE" CACHE BOOL
> +  "Enable expensive runtime logging options for the mlx5 verbs provider")
> +if (MLX5_DEBUG)
> +  add_definitions("-DMLX5_DEBUG")
> +endif()
> +
> +set(MLX5_MW_DEBUG "FALSE" CACHE BOOL
> +  "Enable extra validation of memory windows for the mlx5 verbs provider")
> +if (MLX5_MW_DEBUG)
> +  add_definitions("-DMW_DEBUG")
> +endif()
> +
>  rdma_provider(mlx5
>    buf.c
>    cq.c
>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe Sept. 22, 2016, 3:29 p.m. UTC | #2
> Need to consider whether there are other symbols in the original
> repositories that require similar patch. (e.g. valgrind, resolve-neigh,
> etc.)

Those two are taken care of already.

However, I'm of the opinion we should drop !resolve-neigh and nl1 as a
compile time option.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/libmlx5/src/CMakeLists.txt b/libmlx5/src/CMakeLists.txt
index a34a8063eeb2..44df83b47d96 100644
--- a/libmlx5/src/CMakeLists.txt
+++ b/libmlx5/src/CMakeLists.txt
@@ -1,3 +1,15 @@ 
+set(MLX5_DEBUG "FALSE" CACHE BOOL
+  "Enable expensive runtime logging options for the mlx5 verbs provider")
+if (MLX5_DEBUG)
+  add_definitions("-DMLX5_DEBUG")
+endif()
+
+set(MLX5_MW_DEBUG "FALSE" CACHE BOOL
+  "Enable extra validation of memory windows for the mlx5 verbs provider")
+if (MLX5_MW_DEBUG)
+  add_definitions("-DMW_DEBUG")
+endif()
+
 rdma_provider(mlx5
   buf.c
   cq.c