From 9855c4626c67abc24902246ba961e6dd9022dd27 Mon Sep 17 00:00:00 2001 From: "Naveen N. Rao" Date: Wed, 6 Jun 2018 15:01:54 +0530 Subject: [PATCH 1/2] selftests/ftrace: Add ppc support for kprobe args tests Add powerpc support for the recently added kprobe args tests. Signed-off-by: Naveen N. Rao Reviewed-by: Masami Hiramatsu Acked-by: Steven Rostedt (VMware) Signed-off-by: Shuah Khan (Samsung OSG) --- .../selftests/ftrace/test.d/kprobe/kprobe_args_string.tc | 8 ++++++++ .../selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc index 5ba73035e1d9..a0002563e9ee 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc @@ -24,6 +24,14 @@ arm*) ARG2=%r1 OFFS=4 ;; +ppc64*) + ARG2=%r4 + OFFS=8 +;; +ppc*) + ARG2=%r4 + OFFS=4 +;; *) echo "Please implement other architecture here" exit_untested diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc index 231bcd2c4eb5..d026ff4e562f 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc @@ -34,6 +34,13 @@ arm*) GOODREG=%r0 BADREG=%ax ;; +ppc*) + GOODREG=%r3 + BADREG=%msr +;; +*) + echo "Please implement other architecture here" + exit_untested esac test_goodarg() # Good-args From 53c3daf8cfeae4b1289723c7abeb9540c1630cf8 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 7 Jun 2018 11:30:02 +0300 Subject: [PATCH 2/2] kselftest/cgroup: fix a signedness bug "len" needs to be signed for the error handling to work. Signed-off-by: Dan Carpenter Signed-off-by: Shuah Khan (Samsung OSG) --- tools/testing/selftests/cgroup/cgroup_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/cgroup/cgroup_util.c b/tools/testing/selftests/cgroup/cgroup_util.c index b69bdeb4b9fe..1e9e3c470561 100644 --- a/tools/testing/selftests/cgroup/cgroup_util.c +++ b/tools/testing/selftests/cgroup/cgroup_util.c @@ -35,7 +35,7 @@ out: return len; } -static ssize_t write_text(const char *path, char *buf, size_t len) +static ssize_t write_text(const char *path, char *buf, ssize_t len) { int fd; @@ -140,7 +140,7 @@ long cg_read_key_long(const char *cgroup, const char *control, const char *key) int cg_write(const char *cgroup, const char *control, char *buf) { char path[PATH_MAX]; - size_t len = strlen(buf); + ssize_t len = strlen(buf); snprintf(path, sizeof(path), "%s/%s", cgroup, control);