Skip to content

Commit

Permalink
common: keep Valgrind enabled 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 20, 2024
1 parent 1b83a18 commit 6bce5db
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pmem_test_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Test prepare
uses: ./.github/actions/pmem_test_prepare
with:
valgrind: ${{ fromJSON(inputs.valgrind) }}
valgrind: ${{ inputs.valgrind }}

- name: Test run
uses: ./.github/actions/pmem_test_run
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/pmem_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
force_enable: '["pmemcheck", "memcheck"]'
valgrind: 1


# Test the default build with force-enabled Valgrind tooling for thread error
# detection.
Thread:
Expand All @@ -38,6 +39,7 @@ jobs:
# 9h = 7h20m (the longest workflow execution time) + ~20% leeway.
timeout_minutes: 540


# Static builds are tested in this limited scope only.
static:
name: Static
Expand Down Expand Up @@ -108,3 +110,12 @@ jobs:
uses: ./.github/actions/pmem_test_run
with:
build: nondebug # only the production build is considered


# Test the default build with the basic test suite.
Basic_w_Valgrind:
uses: ./.github/workflows/pmem_test_matrix.yml
with:
# Exclude all Valgrind tests but keep Valgrind tools built-in.
force_enable: '["none"]'
valgrind: 1
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Mon Dec 4 2023 Oksana Sałyk <oksana.salyk@intel.com>
- Reduces libpmemobj's stack usage below the 11kB threshold.
- Fixing minor Coverity issues
- Add a new toolset for stack usage analysis (https://github.com/pmem/pmdk/tree/master/utils/call_stacks_analysis)


Tue Aug 8 2023 Oksana Sałyk <oksana.salyk@intel.com>

Expand Down
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ Both building and installation scripts are very flexible. To see additional opti
### Memory Management Tools

The PMDK libraries support standard Valgrind DRD, Helgrind and Memcheck, as well as a PM-aware version of [Valgrind](https://github.com/pmem/valgrind).
By default, support for all tools is disabled. If you wish to enable it, supply the compiler with `VALGRIND` flag set to 1:
By default, support for all tools is enabled. If you wish to disable it, supply the compiler with `VALGRIND` flag set to 0:

```sh
make VALGRIND=1
make VALGRIND=0
```

The `SANITIZE` flag allows the libraries to be tested with various
Expand Down
2 changes: 1 addition & 1 deletion src/core/valgrind_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

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

Expand Down
4 changes: 4 additions & 0 deletions src/examples/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ CFLAGS += -fsanitize=$(SANITIZE)
CXXFLAGS += -fsanitize=$(SANITIZE)
LDFLAGS += -fsanitize=$(SANITIZE)
endif
ifeq ($(VALGRIND),0)
CFLAGS += -DVALGRIND_ENABLED=0
CXXFLAGS += -DVALGRIND_ENABLED=0
endif
INCS = -I$(INCDIR) -I. -I$(TOP_SRC)/examples $(OS_INCS)
LIBS += $(OS_LIBS) $(LIBUUID)

Expand Down
1 change: 0 additions & 1 deletion src/test/valgrind_check/valgrind_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* usage: valgrind_check
*
*/

#include "valgrind_internal.h"

#ifndef VALGRIND_ENABLED
Expand Down

0 comments on commit 6bce5db

Please sign in to comment.