From 32ba9f0fb027cc43074e3ea26fcf831adeee8e03 Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Sun, 5 Sep 2021 00:54:31 +0900 Subject: tools/bootconfig: Fix tracing_on option checking in ftrace2bconf.sh Since tracing_on indicates only "1" (default) or "0", ftrace2bconf.sh only need to check the value is "0". Link: https://lkml.kernel.org/r/163077087144.222577.6888011847727968737.stgit@devnote2 Fixes: 55ed4560774d ("tools/bootconfig: Add tracing_on support to helper scripts") Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) --- tools/bootconfig/scripts/ftrace2bconf.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/bootconfig/scripts/ftrace2bconf.sh b/tools/bootconfig/scripts/ftrace2bconf.sh index fbaf07dc91bf..6183b36c6846 100755 --- a/tools/bootconfig/scripts/ftrace2bconf.sh +++ b/tools/bootconfig/scripts/ftrace2bconf.sh @@ -239,8 +239,8 @@ instance_options() { # [instance-name] emit_kv $PREFIX.cpumask = $val fi val=`cat $INSTANCE/tracing_on` - if [ `echo $val | sed -e s/f//g`x != x ]; then - emit_kv $PREFIX.tracing_on = $val + if [ "$val" = "0" ]; then + emit_kv $PREFIX.tracing_on = 0 fi val=`cat $INSTANCE/current_tracer` -- cgit v1.2.3 From 903bd067faa837fddb6e5c8b740c3374dc582f04 Mon Sep 17 00:00:00 2001 From: Julio Faracco Date: Sun, 5 Sep 2021 00:54:38 +0900 Subject: bootconfig: Fix missing return check of xbc_node_compose_key function The function `xbc_show_list should` handle the keys during the composition. Even the errors returned by the compose function. Instead of removing the `ret` variable, it should save the value and show the exact error. This missing variable is causing a compilation issue also. Link: https://lkml.kernel.org/r/163077087861.222577.12884543474750968146.stgit@devnote2 Fixes: e5efaeb8a8f5 ("bootconfig: Support mixing a value and subkeys under a key") Signed-off-by: Julio Faracco Acked-by: Masami Hiramatsu Cc: stable@vger.kernel.org Signed-off-by: Steven Rostedt (VMware) --- tools/bootconfig/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c index f45fa992e01d..fd67496a947f 100644 --- a/tools/bootconfig/main.c +++ b/tools/bootconfig/main.c @@ -111,9 +111,11 @@ static void xbc_show_list(void) char key[XBC_KEYLEN_MAX]; struct xbc_node *leaf; const char *val; + int ret; xbc_for_each_key_value(leaf, val) { - if (xbc_node_compose_key(leaf, key, XBC_KEYLEN_MAX) < 0) { + ret = xbc_node_compose_key(leaf, key, XBC_KEYLEN_MAX); + if (ret < 0) { fprintf(stderr, "Failed to compose key %d\n", ret); break; } -- cgit v1.2.3 From 47914d4e591cbbf7ce5103d86257a5d0d8532110 Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Sun, 5 Sep 2021 00:54:46 +0900 Subject: tools/bootconfig: Show whole test command for each test case Show whole test command instead of only the 3rd argument. This will clear to show what will be actually tested by each test case. Link: https://lkml.kernel.org/r/163077088607.222577.14786016266462495017.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) --- tools/bootconfig/test-bootconfig.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/bootconfig/test-bootconfig.sh b/tools/bootconfig/test-bootconfig.sh index baed891d0ba4..f68e2e9eef8b 100755 --- a/tools/bootconfig/test-bootconfig.sh +++ b/tools/bootconfig/test-bootconfig.sh @@ -26,7 +26,7 @@ trap cleanup EXIT TERM NO=1 xpass() { # pass test command - echo "test case $NO ($3)... " + echo "test case $NO ($*)... " if ! ($@ && echo "\t\t[OK]"); then echo "\t\t[NG]"; NG=$((NG + 1)) fi @@ -34,7 +34,7 @@ xpass() { # pass test command } xfail() { # fail test command - echo "test case $NO ($3)... " + echo "test case $NO ($*)... " if ! (! $@ && echo "\t\t[OK]"); then echo "\t\t[NG]"; NG=$((NG + 1)) fi -- cgit v1.2.3 From 04178ea130a64a50826f17c7cc92774ada7ea9d0 Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (VMware)" Date: Tue, 7 Sep 2021 23:04:29 -0400 Subject: selftests/ftrace: Exclude "(fault)" in testing add/remove eprobe events The original test for adding and removing eprobes used synthetic events and retrieved the filename from the open system call at the end of the system call. This would allow it to always be loaded into the page tables when accessed. Masami suggested that the test was too complex for just testing add and remove, so it was changed to test just adding and removing an event probe on top of the start of the open system call event. Now it is possible that the filename will not be loaded into memory at the time the eprobe is triggered, and will result in "(fault)" being displayed in the event. This causes the test to fail. Account for "(fault)" also being one of the values of the filename field of the event probe. Link: https://lkml.kernel.org/r/20210907230429.5783d519@rorschach.local.home Fixes: 079db70794ec5 ("selftests/ftrace: Add test case to test adding and removing of event probe") Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) --- tools/testing/selftests/ftrace/test.d/dynevent/add_remove_eprobe.tc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_eprobe.tc b/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_eprobe.tc index 25a3da4eaa44..5f5b2ba3e557 100644 --- a/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_eprobe.tc +++ b/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_eprobe.tc @@ -22,7 +22,7 @@ ls echo 0 > events/eprobes/$EPROBE/enable content=`grep '^ *ls-' trace | grep 'file='` -nocontent=`grep '^ *ls-' trace | grep 'file=' | grep -v -e '"/' -e '"."'` || true +nocontent=`grep '^ *ls-' trace | grep 'file=' | grep -v -e '"/' -e '"."' -e '(fault)' ` || true if [ -z "$content" ]; then exit_fail -- cgit v1.2.3