Hi,
Here is a series for adding "requires:" list for simplifying and
unifying requirement checks for each test case.
This series also includes the description line fix and
unresolved -> unsupported change ([1/7] and [2/7]).
Currently, we have many similar requirement checker to find
unconfigured or unsupported (in older kernels) feature in
each test case. I think it is a good time to unify those similar
checks.
As same as "description:" or "flags:" line, this series introduces
new "requires:" line, and convert current checking code intor the
"requires:" line.
This requires line gives some good effects, not only simplyfies
the code, but also unifies the reason message, and because it checks
the requirements before running the testc ase, it skips unneeded
ftrace initialization.
The requires line supports following checks
- tracefs interface check: Check whether the given file or directory
in the tracefs. (No suffix) [3/7],[4/7],[5/7]
- available tracer check: Check whether the given tracer is available
(":tracer" suffix) [6/7]
- README feature check: Check whether the given string is in the
README (":README" suffix) [7/7]
Note that since the requires line returns UNSUPPORTED error,
the requirements must be one of ftrace feature, but not the
user-space environmental requirement. If there is some issue
in user-space (e.g. lack of the command, modules, etc) it must
report UNRESOLVED error.
Since this series depends on following 2 commits,
commit 619ee76f5c9f ("selftests/ftrace: Return unsupported if no
error_log file") on Shuah's Kselftest tree
commit bea24f766efc ("selftests/ftrace: Distinguish between hist
and synthetic event checks") on Steven's Tracing tree
This can be applied on the tree which merged both of them.
Also, you can get the series from the following.
git://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git ftracetest-requires-v1
Thank you,
---
Masami Hiramatsu (7):
selftests/ftrace: Allow ":" in description
selftests/ftrace: Return unsupported for the unconfigured features
selftests/ftrace: Add "requires:" list support
selftests/ftrace: Convert required interface checks into requires list
selftests/ftrace: Convert check_filter_file() with requires list
selftests/ftrace: Support ":tracer" suffix for requires
selftests/ftrace: Support ":README" suffix for requires
tools/testing/selftests/ftrace/ftracetest | 11 ++++++-
.../selftests/ftrace/test.d/00basic/snapshot.tc | 3 +-
.../selftests/ftrace/test.d/00basic/trace_pipe.tc | 3 +-
.../ftrace/test.d/direct/kprobe-direct.tc | 6 +---
.../ftrace/test.d/dynevent/add_remove_kprobe.tc | 6 +---
.../ftrace/test.d/dynevent/add_remove_synth.tc | 5 +--
.../ftrace/test.d/dynevent/clear_select_events.tc | 11 +------
.../ftrace/test.d/dynevent/generic_clear_event.tc | 8 +----
.../selftests/ftrace/test.d/event/event-enable.tc | 6 +---
.../selftests/ftrace/test.d/event/event-no-pid.tc | 11 +------
.../selftests/ftrace/test.d/event/event-pid.tc | 11 +------
.../ftrace/test.d/event/subsystem-enable.tc | 6 +---
.../ftrace/test.d/event/toplevel-enable.tc | 6 +---
.../ftrace/test.d/ftrace/fgraph-filter-stack.tc | 14 +--------
.../ftrace/test.d/ftrace/fgraph-filter.tc | 8 +----
.../ftrace/test.d/ftrace/func-filter-glob.tc | 8 +----
.../test.d/ftrace/func-filter-notrace-pid.tc | 13 +-------
.../ftrace/test.d/ftrace/func-filter-pid.tc | 13 +-------
.../ftrace/test.d/ftrace/func-filter-stacktrace.tc | 3 +-
.../selftests/ftrace/test.d/ftrace/func_cpumask.tc | 6 +---
.../ftrace/test.d/ftrace/func_event_triggers.tc | 7 ++---
.../ftrace/test.d/ftrace/func_mod_trace.tc | 3 +-
.../ftrace/test.d/ftrace/func_profile_stat.tc | 3 +-
.../ftrace/test.d/ftrace/func_profiler.tc | 12 +-------
.../ftrace/test.d/ftrace/func_set_ftrace_file.tc | 6 ++--
.../ftrace/test.d/ftrace/func_stack_tracer.tc | 8 +----
.../test.d/ftrace/func_traceonoff_triggers.tc | 6 ++--
.../ftrace/test.d/ftrace/tracing-error-log.tc | 12 ++------
tools/testing/selftests/ftrace/test.d/functions | 28 ++++++++++++++----
.../ftrace/test.d/instances/instance-event.tc | 6 +---
.../selftests/ftrace/test.d/instances/instance.tc | 6 +---
.../ftrace/test.d/kprobe/add_and_remove.tc | 3 +-
.../selftests/ftrace/test.d/kprobe/busy_check.tc | 3 +-
.../selftests/ftrace/test.d/kprobe/kprobe_args.tc | 3 +-
.../ftrace/test.d/kprobe/kprobe_args_comm.tc | 3 +-
.../ftrace/test.d/kprobe/kprobe_args_string.tc | 3 +-
.../ftrace/test.d/kprobe/kprobe_args_symbol.tc | 3 +-
.../ftrace/test.d/kprobe/kprobe_args_syntax.tc | 5 +--
.../ftrace/test.d/kprobe/kprobe_args_type.tc | 5 +--
.../ftrace/test.d/kprobe/kprobe_args_user.tc | 5 +--
.../ftrace/test.d/kprobe/kprobe_eventname.tc | 3 +-
.../ftrace/test.d/kprobe/kprobe_ftrace.tc | 6 +---
.../ftrace/test.d/kprobe/kprobe_module.tc | 3 +-
.../ftrace/test.d/kprobe/kprobe_multiprobe.tc | 5 +--
.../ftrace/test.d/kprobe/kprobe_syntax_errors.tc | 5 +--
.../ftrace/test.d/kprobe/kretprobe_args.tc | 3 +-
.../ftrace/test.d/kprobe/kretprobe_maxactive.tc | 4 +--
.../ftrace/test.d/kprobe/multiple_kprobes.tc | 3 +-
.../selftests/ftrace/test.d/kprobe/probepoint.tc | 3 +-
.../selftests/ftrace/test.d/kprobe/profile.tc | 3 +-
.../ftrace/test.d/kprobe/uprobe_syntax_errors.tc | 5 +--
.../ftrace/test.d/preemptirq/irqsoff_tracer.tc | 4 +--
tools/testing/selftests/ftrace/test.d/template | 4 +++
.../selftests/ftrace/test.d/tracer/wakeup.tc | 6 +---
.../selftests/ftrace/test.d/tracer/wakeup_rt.tc | 6 +---
.../inter-event/trigger-action-hist-xfail.tc | 13 +-------
.../inter-event/trigger-field-variable-support.tc | 16 +---------
.../trigger-inter-event-combined-hist.tc | 16 +---------
.../inter-event/trigger-multi-actions-accept.tc | 16 +---------
.../inter-event/trigger-onchange-action-hist.tc | 8 +----
.../inter-event/trigger-onmatch-action-hist.tc | 16 +---------
.../trigger-onmatch-onmax-action-hist.tc | 16 +---------
.../inter-event/trigger-onmax-action-hist.tc | 16 +---------
.../inter-event/trigger-snapshot-action-hist.tc | 20 +------------
.../trigger-synthetic-event-createremove.tc | 11 +------
.../inter-event/trigger-synthetic-event-syntax.tc | 11 +------
.../inter-event/trigger-trace-action-hist.tc | 18 +-----------
.../ftrace/test.d/trigger/trigger-eventonoff.tc | 11 +------
.../ftrace/test.d/trigger/trigger-filter.tc | 11 +------
.../ftrace/test.d/trigger/trigger-hist-mod.tc | 16 +---------
.../test.d/trigger/trigger-hist-syntax-errors.tc | 18 +-----------
.../ftrace/test.d/trigger/trigger-hist.tc | 16 +---------
.../ftrace/test.d/trigger/trigger-multihist.tc | 16 +---------
.../ftrace/test.d/trigger/trigger-snapshot.tc | 16 +---------
.../ftrace/test.d/trigger/trigger-stacktrace.tc | 11 +------
.../test.d/trigger/trigger-trace-marker-hist.tc | 21 +-------------
.../trigger/trigger-trace-marker-snapshot.tc | 21 +-------------
.../trigger-trace-marker-synthetic-kernel.tc | 31 +-------------------
.../trigger/trigger-trace-marker-synthetic.tc | 26 +----------------
.../ftrace/test.d/trigger/trigger-traceonoff.tc | 11 +------
80 files changed, 120 insertions(+), 633 deletions(-)
--
Masami Hiramatsu (Linaro) <mhiramat(a)kernel.org>
As seccomp_benchmark tries to calibrate how many samples will take more
than 5 seconds to execute, it may end up picking up a number of samples
that take 10 (but up to 12) seconds. As the calibration will take double
that time, it takes around 20 seconds. Then, it executes the whole thing
again, and then once more, with some added overhead. So, the thing might
take more than 40 seconds, which is too close to the 45s timeout.
That is very dependent on the system where it's executed, so may not be
observed always, but it has been observed on x86 VMs. Using a 90s timeout
seems safe enough.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo(a)canonical.com>
---
tools/testing/selftests/seccomp/settings | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/seccomp/settings b/tools/testing/selftests/seccomp/settings
index d61f00d8cad3..ba4d85f74cd6 100644
--- a/tools/testing/selftests/seccomp/settings
+++ b/tools/testing/selftests/seccomp/settings
@@ -1 +1 @@
-90
+timeout=90
--
2.25.1
From: John Stultz <john.stultz(a)linaro.org>
[ Upstream commit 4bb9d46d47b105a774f9dca642f5271375bca4b2 ]
When I added the expected error testing, I forgot I need to set
the return to zero when we successfully see an error.
Without this change we only end up testing a single heap
before the test quits.
Cc: Shuah Khan <shuah(a)kernel.org>
Cc: Sumit Semwal <sumit.semwal(a)linaro.org>
Cc: Benjamin Gaignard <benjamin.gaignard(a)linaro.org>
Cc: Brian Starkey <brian.starkey(a)arm.com>
Cc: Laura Abbott <labbott(a)redhat.com>
Cc: "Andrew F. Davis" <afd(a)ti.com>
Cc: linux-kselftest(a)vger.kernel.org
Signed-off-by: John Stultz <john.stultz(a)linaro.org>
Signed-off-by: Shuah Khan <skhan(a)linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
---
tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c b/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
index cd5e1f602ac9..909da9cdda97 100644
--- a/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
+++ b/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
@@ -351,6 +351,7 @@ static int test_alloc_errors(char *heap_name)
}
printf("Expected error checking passed\n");
+ ret = 0;
out:
if (dmabuf_fd >= 0)
close(dmabuf_fd);
--
2.25.1
As seccomp_benchmark tries to calibrate how many samples will take more
than 5 seconds to execute, it may end up picking up a number of samples
that take 10 (but up to 12) seconds. As the calibration will take double
that time, it takes around 20 seconds. Then, it executes the whole thing
again, and then once more, with some added overhead. So, the thing might
take more than 40 seconds, which is too close to the 45s timeout.
That is very dependent on the system where it's executed, so may not be
observed always, but it has been observed on x86 VMs. Using a 90s timeout
seems safe enough.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo(a)canonical.com>
---
tools/testing/selftests/seccomp/settings | 1 +
1 file changed, 1 insertion(+)
create mode 100644 tools/testing/selftests/seccomp/settings
diff --git a/tools/testing/selftests/seccomp/settings b/tools/testing/selftests/seccomp/settings
new file mode 100644
index 000000000000..ba4d85f74cd6
--- /dev/null
+++ b/tools/testing/selftests/seccomp/settings
@@ -0,0 +1 @@
+timeout=90
--
2.25.1
hmm_range_fault() returns an array of page frame numbers and flags for
how the pages are mapped in the requested process' page tables. The PFN
can be used to get the struct page with hmm_pfn_to_page() and the page size
order can be determined with compound_order(page) but if the page is larger
than order 0 (PAGE_SIZE), there is no indication that the page is mapped
using a larger page size. To be fully general, hmm_range_fault() would need
to return the mapping size to handle cases like a 1GB compound page being
mapped with 2MB PMD entries. However, the most common case is the mapping
size the same as the underlying compound page size.
This series adds a new output flag to indicate this so that callers know it
is safe to use a large device page table mapping if one is available.
Nouveau and the HMM tests are updated to use the new flag.
Note that this series depends on a patch queued in Ben Skeggs' nouveau
tree ("nouveau/hmm: map pages after migration") and the patches queued
in Jason's HMM tree.
There is also a patch outstanding ("nouveau/hmm: fix nouveau_dmem_chunk
allocations") that is independent of the above and could be applied
before or after.
Ralph Campbell (6):
nouveau/hmm: map pages after migration
nouveau: make nvkm_vmm_ctor() and nvkm_mmu_ptp_get() static
nouveau/hmm: fault one page at a time
mm/hmm: add output flag for compound page mapping
nouveau/hmm: support mapping large sysmem pages
hmm: add tests for HMM_PFN_COMPOUND flag
drivers/gpu/drm/nouveau/nouveau_dmem.c | 46 ++-
drivers/gpu/drm/nouveau/nouveau_dmem.h | 2 +
drivers/gpu/drm/nouveau/nouveau_svm.c | 288 +++++++++---------
drivers/gpu/drm/nouveau/nouveau_svm.h | 5 +
.../gpu/drm/nouveau/nvkm/subdev/mmu/base.c | 6 +-
.../gpu/drm/nouveau/nvkm/subdev/mmu/priv.h | 2 +
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c | 12 +-
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h | 3 -
.../drm/nouveau/nvkm/subdev/mmu/vmmgp100.c | 29 +-
include/linux/hmm.h | 4 +-
lib/test_hmm.c | 2 +
lib/test_hmm_uapi.h | 2 +
mm/hmm.c | 10 +-
tools/testing/selftests/vm/hmm-tests.c | 76 +++++
14 files changed, 311 insertions(+), 176 deletions(-)
--
2.20.1
To make KUnit easier to use, and to avoid overwriting object and
.config files, the default KUnit build directory is set to .kunit
Fixed up minor merge conflicts - Shuah Khan <skhan(a)linuxfoundation.org>
Fixed this identation error exchanging spaces for tabs between lines
248 and 252:
tools/testing/kunit/kunit.py run --defconfig
File "tools/testing/kunit/kunit.py", line 254
if not linux:
^
TabError: inconsistent use of tabs and spaces in indentation
Signed-off-by: Vitor Massaru Iha <vitor(a)massaru.org>
Reviewed-by: Brendan Higgins <brendanhiggins(a)google.com>
Signed-off-by: Shuah Khan <skhan(a)linuxfoundation.org>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=205221
---
version after merge on kunit brach:
v1:
* fix identation (tabs instead of spaces)
v2:
* fix v1 changelog description: fix identation
(spaces instead of tabs, lines 248-252);
* add python error message on commit message;
* fix Link tag on commit message.
---
tools/testing/kunit/kunit.py | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py
index b01838b6f5f9..b3490271a103 100755
--- a/tools/testing/kunit/kunit.py
+++ b/tools/testing/kunit/kunit.py
@@ -169,7 +169,7 @@ def add_common_opts(parser):
parser.add_argument('--build_dir',
help='As in the make command, it specifies the build '
'directory.',
- type=str, default='', metavar='build_dir')
+ type=str, default='.kunit', metavar='build_dir')
parser.add_argument('--make_options',
help='X=Y make option, can be repeated.',
action='append')
@@ -245,12 +245,11 @@ def main(argv, linux=None):
cli_args = parser.parse_args(argv)
if cli_args.subcommand == 'run':
- if cli_args.build_dir:
- if not os.path.exists(cli_args.build_dir):
- os.mkdir(cli_args.build_dir)
- kunit_kernel.kunitconfig_path = os.path.join(
- cli_args.build_dir,
- kunit_kernel.kunitconfig_path)
+ if not os.path.exists(cli_args.build_dir):
+ os.mkdir(cli_args.build_dir)
+ kunit_kernel.kunitconfig_path = os.path.join(
+ cli_args.build_dir,
+ kunit_kernel.kunitconfig_path)
if not linux:
linux = kunit_kernel.LinuxSourceTree()
--
2.26.2
Hi, Alexei!
>>>>> On Wed, 27 May 2020 09:48:04 -0700, Alexei Starovoitov wrote:
> On Wed, May 27, 2020 at 12:19 AM Yauheni Kaliuta
> <yauheni.kaliuta(a)redhat.com> wrote:
>>
>> Hi, Alexei!
>>
>> >>>>> On Tue, 26 May 2020 22:37:39 -0700, Alexei Starovoitov wrote:
>>
>> > On Tue, May 26, 2020 at 10:31 PM Yauheni Kaliuta
>> > <yauheni.kaliuta(a)redhat.com> wrote:
>> >>
>> >> Hi, Andrii!
>> >>
>> >> >>>>> On Tue, 26 May 2020 17:19:18 -0700, Andrii Nakryiko wrote:
>> >>
>> >> > On Fri, May 22, 2020 at 1:19 AM Yauheni Kaliuta
>> >> > <yauheni.kaliuta(a)redhat.com> wrote:
>> >> >>
>> >> >> There is difference in depoying static and generated extra resource
>> >> >> files between in/out of tree build and flavors:
>> >> >>
>> >> >> - in case of unflavored out-of-tree build static files are not
>> >> >> available and must be copied as well as both static and generated
>> >> >> files for flavored build.
>> >> >>
>> >> >> So split the rules and variables. The name TRUNNER_EXTRA_GEN_FILES
>> >> >> is chosen in analogy to TEST_GEN_* variants.
>> >> >>
>> >>
>> >> > Can we keep them together but be smarter about what needs to
>> >> > be copied based on source/target directories? I would really
>> >> > like to not blow up all these rules.
>> >>
>> >> I can try, ok, I just find it a bit more clear. But it's good to
>> >> get some input from kselftest about OOT build in general.
>>
>> > I see no value in 'make install' of selftests/bpf
>> > and since it's broken just remove that makefile target.
>>
>> Some CI systems perform testing next stage after building were
>> build tree is not available anymore. So it's in use at the
>> moment.
> such CI systems can do 'cp -r' then
It's a discussion for linux-kselftest@ (added).
At the moment `make install` is generic kselftest functionality
and since bpf is part of that infra it looks a bit strange to
break it intentionally.
--
WBR,
Yauheni Kaliuta