Commit 3d35fa11 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'linux_kselftest-fixes-6.19-rc4' of...

Merge tag 'linux_kselftest-fixes-6.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest fixes from Shuah Khan:

 - Fix for build failures in tests that use an empty FIXTURE() seen in
   Android's build environment, which uses -D_FORTIFY_SOURCE=3, a build
   failure occurs in tests that use an empty FIXTURE()

 - Fix func_traceonoff_triggers.tc sometimes failures on Kunpeng-920
   board resulting from including transient trace file name in checksum
   compare

 - Fix to remove available_events requirement from toplevel-enable for
   instance as it isn't a valid requirement for this test

* tag 'linux_kselftest-fixes-6.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  kselftest/harness: Use helper to avoid zero-size memset warning
  selftests/ftrace: Test toplevel-enable for instance
  selftests/ftrace: traceonoff_triggers: strip off names
parents bea82c80 19b8a76c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: event tracing - enable/disable with top level files
# requires: available_events set_event events/enable
# requires: set_event events/enable
# flags: instance

do_reset() {
    echo > set_event
+3 −2
Original line number Diff line number Diff line
@@ -90,9 +90,10 @@ if [ $on != "0" ]; then
    fail "Tracing is not off"
fi

csum1=`md5sum trace`
# Cannot rely on names being around as they are only cached, strip them
csum1=`cat trace | sed -e 's/^ *[^ ]*\(-[0-9][0-9]*\)/\1/' | md5sum`
sleep $SLEEP_TIME
csum2=`md5sum trace`
csum2=`cat trace | sed -e 's/^ *[^ ]*\(-[0-9][0-9]*\)/\1/' | md5sum`

if [ "$csum1" != "$csum2" ]; then
    fail "Tracing file is still changing"
+7 −1
Original line number Diff line number Diff line
@@ -70,6 +70,12 @@

#include "kselftest.h"

static inline void __kselftest_memset_safe(void *s, int c, size_t n)
{
	if (n > 0)
		memset(s, c, n);
}

#define TEST_TIMEOUT_DEFAULT 30

/* Utilities exposed to the test definitions */
@@ -416,7 +422,7 @@
				self = mmap(NULL, sizeof(*self), PROT_READ | PROT_WRITE, \
					MAP_SHARED | MAP_ANONYMOUS, -1, 0); \
			} else { \
				memset(&self_private, 0, sizeof(self_private)); \
				__kselftest_memset_safe(&self_private, 0, sizeof(self_private)); \
				self = &self_private; \
			} \
		} \