Skip to content

Commit

Permalink
Merge tag 'linux-kselftest-4.19-rc1' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/shuah/linux-kselftest

Pull Kselftest update from Shuah Khan:

 - add cgroup core selftests

 - fix compile warnings in android ion test

 - fix to bugs in exclude and skip paths in vDSO test

 - remove obsolete config options

 - add missing .gitignore file

* tag 'linux-kselftest-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests/ftrace: Fix kprobe string testcase to not probe notrace function
  selftests: mount: remove no longer needed config option
  selftests: cgroup: add gitignore file
  Add cgroup core selftests
  selftests: vDSO - fix to return KSFT_SKIP when test couldn't be run
  selftests: vDSO - fix to exclude x86 test on non-x86 platforms
  selftests/android: initialize heap_type to avoid compiling warning
  • Loading branch information
torvalds committed Aug 21, 2018
2 parents 7140ad3 + 01675e9 commit 6b2edf2
Show file tree
Hide file tree
Showing 9 changed files with 422 additions and 7 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/android/ion/ionapp_export.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ int main(int argc, char *argv[])

heap_size = 0;
flags = 0;
heap_type = ION_HEAP_TYPE_SYSTEM;

while ((opt = getopt(argc, argv, "hi:s:")) != -1) {
switch (opt) {
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/cgroup/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test_memcontrol
2 changes: 2 additions & 0 deletions tools/testing/selftests/cgroup/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ CFLAGS += -Wall
all:

TEST_GEN_PROGS = test_memcontrol
TEST_GEN_PROGS += test_core

include ../lib.mk

$(OUTPUT)/test_memcontrol: cgroup_util.c
$(OUTPUT)/test_core: cgroup_util.c
8 changes: 8 additions & 0 deletions tools/testing/selftests/cgroup/cgroup_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ int cg_destroy(const char *cgroup)
return ret;
}

int cg_enter_current(const char *cgroup)
{
char pidbuf[64];

snprintf(pidbuf, sizeof(pidbuf), "%d", getpid());
return cg_write(cgroup, "cgroup.procs", pidbuf);
}

int cg_run(const char *cgroup,
int (*fn)(const char *cgroup, void *arg),
void *arg)
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/cgroup/cgroup_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ extern int cg_write(const char *cgroup, const char *control, char *buf);
extern int cg_run(const char *cgroup,
int (*fn)(const char *cgroup, void *arg),
void *arg);
extern int cg_enter_current(const char *cgroup);
extern int cg_run_nowait(const char *cgroup,
int (*fn)(const char *cgroup, void *arg),
void *arg);
Expand Down
Loading

0 comments on commit 6b2edf2

Please sign in to comment.