Skip to content

Commit

Permalink
common: valgrind explicitly disabled by default
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
  • Loading branch information
grom72 committed Mar 18, 2024
1 parent d098b5a commit 3fec07f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/Makefile.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2014-2023, Intel Corporation
# Copyright 2014-2024, Intel Corporation
#
# src/Makefile.inc -- common Makefile rules for PMDK
#
Expand Down Expand Up @@ -106,6 +106,9 @@ endif
ifeq ($(VALGRIND),1)
CFLAGS += -DVALGRIND_ENABLED=1
CXXFLAGS += -DVALGRIND_ENABLED=1
else
CFLAGS += -DVALGRIND_ENABLED=0
CXXFLAGS += -DVALGRIND_ENABLED=0
endif

ifeq ($(FAULT_INJECTION),1)
Expand Down
10 changes: 9 additions & 1 deletion src/benchmarks/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2014-2023, Intel Corporation
# Copyright 2014-2024, Intel Corporation

#
# src/benchmarks/Makefile -- build all benchmarks
Expand Down Expand Up @@ -109,6 +109,14 @@ LDFLAGS += $(GCOV_LDFLAGS)
LIBS += $(GCOV_LIBS)
endif

ifeq ($(VALGRIND),1)
CFLAGS += -DVALGRIND_ENABLED=1
CXXFLAGS += -DVALGRIND_ENABLED=1
else
CFLAGS += -DVALGRIND_ENABLED=0
CXXFLAGS += -DVALGRIND_ENABLED=0
endif

ifneq ($(SANITIZE),)
CXXFLAGS += -fsanitize=$(SANITIZE)
LDFLAGS += -fsanitize=$(SANITIZE)
Expand Down
4 changes: 2 additions & 2 deletions src/core/valgrind_internal.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: BSD-3-Clause */
/* Copyright 2015-2023, Intel Corporation */
/* Copyright 2015-2024, Intel Corporation */

/*
* valgrind_internal.h -- internal definitions for valgrind macros
Expand All @@ -10,7 +10,7 @@

#if !defined(__riscv) && !defined(__loongarch64)
#ifndef VALGRIND_ENABLED
#define VALGRIND_ENABLED 0
#error VALGRIND_ENABLED must be explicitly set
#endif
#endif

Expand Down
3 changes: 3 additions & 0 deletions src/test/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,9 @@ endif
ifeq ($(VALGRIND),1)
CFLAGS += -DVALGRIND_ENABLED=1
CXXFLAGS += -DVALGRIND_ENABLED=1
else
CFLAGS += -DVALGRIND_ENABLED=0
CXXFLAGS += -DVALGRIND_ENABLED=0
endif

ifeq ($(FAULT_INJECTION),1)
Expand Down
8 changes: 8 additions & 0 deletions src/test/unittest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ LDFLAGS += $(GCOV_LDFLAGS)
LIBS += $(GCOV_LIBS)
endif

ifeq ($(VALGRIND),1)
CFLAGS += -DVALGRIND_ENABLED=1
CXXFLAGS += -DVALGRIND_ENABLED=1
else
CFLAGS += -DVALGRIND_ENABLED=0
CXXFLAGS += -DVALGRIND_ENABLED=0
endif

CFLAGS += $(EXTRA_CFLAGS)

LIBS += $(LIBUTIL)
Expand Down
5 changes: 4 additions & 1 deletion src/tools/Makefile.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2014-2023, Intel Corporation
# Copyright 2014-2024, Intel Corporation
#
# src/tools/Makefile.inc -- Makefile include for all tools
#
Expand Down Expand Up @@ -67,6 +67,9 @@ endif
ifeq ($(VALGRIND),1)
CFLAGS += -DVALGRIND_ENABLED=1
CXXFLAGS += -DVALGRIND_ENABLED=1
else
CFLAGS += -DVALGRIND_ENABLED=0
CXXFLAGS += -DVALGRIND_ENABLED=0
endif

ifeq ($(FAULT_INJECTION),1)
Expand Down

0 comments on commit 3fec07f

Please sign in to comment.