diff --git a/.cirrus.yml b/.cirrus.yml index baf459de71..8df130b66e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -61,7 +61,7 @@ debian_default_toolchain_task: build_script: - make -j2 -sk tests_script: - - make -j2 -sk check + - VALGRIND_OPTS="--errors-for-leak-kinds=definite" make -j2 -sk check || cat ./test-suite.log || false - /checks/check-built-plugins.sh ### @@ -92,7 +92,7 @@ redhat_default_toolchain_task: build_script: - make -j2 -sk tests_script: - - make -j2 -sk check + - VALGRIND_OPTS="--errors-for-leak-kinds=definite" make -j2 -sk check || cat ./test-suite.log || false - /checks/check-built-plugins.sh @@ -124,7 +124,7 @@ non_standard_toolchains_task: build_script: - make -j2 -sk tests_script: - - make -j2 -sk check + - VALGRIND_OPTS="--errors-for-leak-kinds=definite" make -j2 -sk check || cat ./test-suite.log || false # build against libstatgrab, should always pass - env: @@ -189,7 +189,7 @@ non_standard_toolchains_task: build_script: - make -j2 -sk tests_script: - - make -j2 -sk check + - VALGRIND_OPTS="--errors-for-leak-kinds=definite" make -j2 -sk check || cat ./test-suite.log || false ### # Build using a range of compilers, available in debian/unstable. NB: might @@ -221,4 +221,4 @@ bleeding_edge_compilers_task: build_script: - make -j2 -sk tests_script: - - make -j2 -sk check + - VALGRIND_OPTS="--errors-for-leak-kinds=definite" make -j2 -sk check || cat ./test-suite.log || false diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f544465e2a..b40db39e3f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,8 +26,10 @@ jobs: - buster_amd64 - stretch_amd64 - stretch_i386 - - trusty_amd64 + # Ubuntu - xenial_amd64 + - bionic_amd64 + - focal_amd64 # RedHat family - el8_x86_64 - el7_x86_64 @@ -35,8 +37,10 @@ jobs: - fedora28_x86_64 config_flags: [''] env: - MAKEFLAGS: "-j 2" + MAKEFLAGS: "-j2 -sk" CONFIGURE_FLAGS: ${{ matrix.config_flags }} + # this env var picked up by valgrind during make check phase + VALGRIND_OPTS: "--errors-for-leak-kinds=definite" steps: - uses: actions/checkout@v2 - run: type pkg-config @@ -44,21 +48,18 @@ jobs: - name: Generate configure script run: ./build.sh - - name: configure + - name: Run configure script run: ./configure $CONFIGURE_FLAGS - - name: Make - run: make - - name: make check - continue-on-error: true - run: make check - - name: install bzip2 - continue-on-error: true + - name: Build collectd + run: make $MAKEFLAGS + - name: Run make check + run: make $MAKEFLAGS check + - name: Dump test logs run: | - yum install -y bzip2 || apt install -y bzip2 - - name: make - continue-on-error: true + cat ./test-suite.log || true + - name: Run make distcheck run: | - make distcheck DISTCHECK_CONFIGURE_FLAGS="--disable-dependency-tracking --enable-debug" + make $MAKEFLAG distcheck DISTCHECK_CONFIGURE_FLAGS="--disable-dependency-tracking --enable-debug" experimental: runs-on: ubuntu-20.04 @@ -80,10 +81,11 @@ jobs: cppflags: "-fPIE -Wno-deprecated-declarations" config_flags: "--disable-dpdkstat --disable-dpdkevents --disable-virt --disable-xmms" env: - MAKEFLAGS: "-j 2" + MAKEFLAGS: "-j2 -sk" CFLAGS: ${{ matrix.cflags }} CPPFLAGS: ${{ matrix.cppflags }} CONFIGURE_FLAGS: ${{ matrix.config_flags }} + VALGRIND_OPTS: "--errors-for-leak-kinds=definite" steps: - uses: actions/checkout@v2 - run: type pkg-config @@ -91,20 +93,18 @@ jobs: - name: Generate configure script run: ./build.sh - - name: configure + - name: Run configure script run: ./configure $CONFIGURE_FLAGS - - name: Make - run: make - - name: make check + - name: Build collectd + run: make $MAKEFLAGS + - name: Run make check # Make check is failing on a few newer distros, temporarily mark it as optional until that is resolved continue-on-error: true - run: make check - - name: install bzip2 - continue-on-error: true + run: make $MAKEFLAGS check + - name: Dump test logs run: | - yum install -y bzip2 || apt install -y bzip2 - - name: make distcheck - continue-on-error: true + cat ./test-suite.log || true + - name: Run make distcheck run: | - make distcheck DISTCHECK_CONFIGURE_FLAGS="--disable-dependency-tracking --enable-debug" + make $MAKEFLAGS distcheck DISTCHECK_CONFIGURE_FLAGS="--disable-dependency-tracking --enable-debug" diff --git a/src/memory.c b/src/memory.c index 1adbdf80c2..4f544f0aa3 100644 --- a/src/memory.c +++ b/src/memory.c @@ -281,13 +281,16 @@ static int memory_read_internal(value_list_t *vl) { * vm.stats.vm.v_active_count: 55239 * vm.stats.vm.v_inactive_count: 113730 * vm.stats.vm.v_cache_count: 10809 + * vm.stats.vm.v_user_wire_count: 0 + * vm.stats.vm.v_laundry_count: 40394 */ - const char *sysctl_keys[8] = { - "vm.stats.vm.v_page_size", "vm.stats.vm.v_page_count", - "vm.stats.vm.v_free_count", "vm.stats.vm.v_wire_count", - "vm.stats.vm.v_active_count", "vm.stats.vm.v_inactive_count", - "vm.stats.vm.v_cache_count", NULL}; - double sysctl_vals[8]; + const char *sysctl_keys[10] = { + "vm.stats.vm.v_page_size", "vm.stats.vm.v_page_count", + "vm.stats.vm.v_free_count", "vm.stats.vm.v_wire_count", + "vm.stats.vm.v_active_count", "vm.stats.vm.v_inactive_count", + "vm.stats.vm.v_cache_count", "vm.stats.vm.v_user_wire_count", + "vm.stats.vm.v_laundry_count", NULL}; + double sysctl_vals[10]; for (int i = 0; sysctl_keys[i] != NULL; i++) { int value; @@ -310,7 +313,8 @@ static int memory_read_internal(value_list_t *vl) { MEMORY_SUBMIT("free", (gauge_t)sysctl_vals[2], "wired", (gauge_t)sysctl_vals[3], "active", (gauge_t)sysctl_vals[4], "inactive", (gauge_t)sysctl_vals[5], "cache", - (gauge_t)sysctl_vals[6]); + (gauge_t)sysctl_vals[6], "user_wire", (gauge_t)sysctl_vals[7], + "laundry", (gauge_t)sysctl_vals[8]); #endif /* HAVE_SYSCTL && KERNEL_NETBSD */ /* #endif HAVE_SYSCTLBYNAME */