All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] selftests: ftrace: Fix multiple-kprobe testcase
@ 2017-11-27  9:53 ` mhiramat
  0 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2017-11-27  9:53 UTC (permalink / raw)
  To: linux-kselftest, shuah, Steven Rostedt
  Cc: mhiramat, linux-kernel, Alex Shi, Russell King - ARM Linux,
	Jon Medhurst, linux-arm-kernel

Hi,

These patches are fixing a bug and improve testcase to
ensure adding 256 kprobe events for test.

The 1st patch is clearly a bug, so it should be fixed
in stable kernel too.

Thank you,

---

Masami Hiramatsu (2):
      [BUGFIX] selftest: ftrace: Fix to pick text symbols for kprobes
      selftest: ftrace: Fix to add 256 kprobe events correctly


 .../ftrace/test.d/kprobe/multiple_kprobes.tc       |   21 +++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Linux-kselftest-mirror] [PATCH 0/2] selftests: ftrace: Fix multiple-kprobe testcase
@ 2017-11-27  9:53 ` mhiramat
  0 siblings, 0 replies; 12+ messages in thread
From: mhiramat @ 2017-11-27  9:53 UTC (permalink / raw)


Hi,

These patches are fixing a bug and improve testcase to
ensure adding 256 kprobe events for test.

The 1st patch is clearly a bug, so it should be fixed
in stable kernel too.

Thank you,

---

Masami Hiramatsu (2):
      [BUGFIX] selftest: ftrace: Fix to pick text symbols for kprobes
      selftest: ftrace: Fix to add 256 kprobe events correctly


 .../ftrace/test.d/kprobe/multiple_kprobes.tc       |   21 +++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

--
Masami Hiramatsu (Linaro) <mhiramat at kernel.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Linux-kselftest-mirror] [PATCH 0/2] selftests: ftrace: Fix multiple-kprobe testcase
@ 2017-11-27  9:53 ` mhiramat
  0 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2017-11-27  9:53 UTC (permalink / raw)


Hi,

These patches are fixing a bug and improve testcase to
ensure adding 256 kprobe events for test.

The 1st patch is clearly a bug, so it should be fixed
in stable kernel too.

Thank you,

---

Masami Hiramatsu (2):
      [BUGFIX] selftest: ftrace: Fix to pick text symbols for kprobes
      selftest: ftrace: Fix to add 256 kprobe events correctly


 .../ftrace/test.d/kprobe/multiple_kprobes.tc       |   21 +++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

--
Masami Hiramatsu (Linaro) <mhiramat at kernel.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 0/2] selftests: ftrace: Fix multiple-kprobe testcase
@ 2017-11-27  9:53 ` mhiramat
  0 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2017-11-27  9:53 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

These patches are fixing a bug and improve testcase to
ensure adding 256 kprobe events for test.

The 1st patch is clearly a bug, so it should be fixed
in stable kernel too.

Thank you,

---

Masami Hiramatsu (2):
      [BUGFIX] selftest: ftrace: Fix to pick text symbols for kprobes
      selftest: ftrace: Fix to add 256 kprobe events correctly


 .../ftrace/test.d/kprobe/multiple_kprobes.tc       |   21 +++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/2] [BUGFIX] selftest: ftrace: Fix to pick text symbols for kprobes
  2017-11-27  9:53 ` mhiramat
  (?)
  (?)
@ 2017-11-27  9:53   ` mhiramat
  -1 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2017-11-27  9:53 UTC (permalink / raw)
  To: linux-kselftest, shuah, Steven Rostedt
  Cc: mhiramat, linux-kernel, Alex Shi, Russell King - ARM Linux,
	Jon Medhurst, linux-arm-kernel

Fix to pick text symbols for multiple kprobe testcase.
kallsyms shows text symbols with " t " or " T " but
current testcase picks all symbols including "t",
so it picks data symbols if it includes 't' (e.g. "str").

This fixes it to find symbol lines with " t " or " T "
(including spaces).

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Reported-by: Russell King <linux@armlinux.org.uk>
---
 .../ftrace/test.d/kprobe/multiple_kprobes.tc       |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
index bb16cf91f1b5..e297bd7a2e79 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
@@ -12,8 +12,8 @@ case `uname -m` in
   *) OFFS=0;;
 esac
 
-echo "Setup up to 256 kprobes"
-grep t /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \
+echo "Setup up kprobes on first 256 text symbols"
+grep -i " t " /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \
 head -n 256 | while read i; do echo p ${i}+${OFFS} ; done > kprobe_events ||:
 
 echo 1 > events/kprobes/enable

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Linux-kselftest-mirror] [PATCH 1/2] [BUGFIX] selftest: ftrace: Fix to pick text symbols for kprobes
@ 2017-11-27  9:53   ` mhiramat
  0 siblings, 0 replies; 12+ messages in thread
From: mhiramat @ 2017-11-27  9:53 UTC (permalink / raw)


Fix to pick text symbols for multiple kprobe testcase.
kallsyms shows text symbols with " t " or " T " but
current testcase picks all symbols including "t",
so it picks data symbols if it includes 't' (e.g. "str").

This fixes it to find symbol lines with " t " or " T "
(including spaces).

Signed-off-by: Masami Hiramatsu <mhiramat at kernel.org>
Reported-by: Russell King <linux at armlinux.org.uk>
---
 .../ftrace/test.d/kprobe/multiple_kprobes.tc       |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
index bb16cf91f1b5..e297bd7a2e79 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
@@ -12,8 +12,8 @@ case `uname -m` in
   *) OFFS=0;;
 esac
 
-echo "Setup up to 256 kprobes"
-grep t /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \
+echo "Setup up kprobes on first 256 text symbols"
+grep -i " t " /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \
 head -n 256 | while read i; do echo p ${i}+${OFFS} ; done > kprobe_events ||:
 
 echo 1 > events/kprobes/enable

--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Linux-kselftest-mirror] [PATCH 1/2] [BUGFIX] selftest: ftrace: Fix to pick text symbols for kprobes
@ 2017-11-27  9:53   ` mhiramat
  0 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2017-11-27  9:53 UTC (permalink / raw)


Fix to pick text symbols for multiple kprobe testcase.
kallsyms shows text symbols with " t " or " T " but
current testcase picks all symbols including "t",
so it picks data symbols if it includes 't' (e.g. "str").

This fixes it to find symbol lines with " t " or " T "
(including spaces).

Signed-off-by: Masami Hiramatsu <mhiramat at kernel.org>
Reported-by: Russell King <linux at armlinux.org.uk>
---
 .../ftrace/test.d/kprobe/multiple_kprobes.tc       |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
index bb16cf91f1b5..e297bd7a2e79 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
@@ -12,8 +12,8 @@ case `uname -m` in
   *) OFFS=0;;
 esac
 
-echo "Setup up to 256 kprobes"
-grep t /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \
+echo "Setup up kprobes on first 256 text symbols"
+grep -i " t " /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \
 head -n 256 | while read i; do echo p ${i}+${OFFS} ; done > kprobe_events ||:
 
 echo 1 > events/kprobes/enable

--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 1/2] [BUGFIX] selftest: ftrace: Fix to pick text symbols for kprobes
@ 2017-11-27  9:53   ` mhiramat
  0 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2017-11-27  9:53 UTC (permalink / raw)
  To: linux-arm-kernel

Fix to pick text symbols for multiple kprobe testcase.
kallsyms shows text symbols with " t " or " T " but
current testcase picks all symbols including "t",
so it picks data symbols if it includes 't' (e.g. "str").

This fixes it to find symbol lines with " t " or " T "
(including spaces).

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Reported-by: Russell King <linux@armlinux.org.uk>
---
 .../ftrace/test.d/kprobe/multiple_kprobes.tc       |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
index bb16cf91f1b5..e297bd7a2e79 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
@@ -12,8 +12,8 @@ case `uname -m` in
   *) OFFS=0;;
 esac
 
-echo "Setup up to 256 kprobes"
-grep t /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \
+echo "Setup up kprobes on first 256 text symbols"
+grep -i " t " /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \
 head -n 256 | while read i; do echo p ${i}+${OFFS} ; done > kprobe_events ||:
 
 echo 1 > events/kprobes/enable

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/2] selftest: ftrace: Fix to add 256 kprobe events correctly
  2017-11-27  9:53 ` mhiramat
  (?)
  (?)
@ 2017-11-27  9:54   ` mhiramat
  -1 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2017-11-27  9:54 UTC (permalink / raw)
  To: linux-kselftest, shuah, Steven Rostedt
  Cc: mhiramat, linux-kernel, Alex Shi, Russell King - ARM Linux,
	Jon Medhurst, linux-arm-kernel

Current multiple-kprobe testcase only tries to add
kprobe events on first 256 text symbols. However
kprobes fails to probe on some text symbols (like
blacklisted symbols). Thus in the worst case,
the test can not add any kprobe events.

To avoid that, continue to try adding kprobe events
until 256 events. Also it confirms the number of
registered kprobe events.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 .../ftrace/test.d/kprobe/multiple_kprobes.tc       |   19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
index e297bd7a2e79..ce361b9d62cf 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
@@ -12,9 +12,24 @@ case `uname -m` in
   *) OFFS=0;;
 esac
 
-echo "Setup up kprobes on first 256 text symbols"
+if [ -d events/kprobes ]; then
+  echo 0 > events/kprobes/enable
+  echo > kprobe_events
+fi
+
+N=0
+echo "Setup up kprobes on first available 256 text symbols"
 grep -i " t " /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \
-head -n 256 | while read i; do echo p ${i}+${OFFS} ; done > kprobe_events ||:
+while read i; do
+  echo p ${i}+${OFFS} >> kprobe_events && N=$((N+1)) ||:
+  test $N -eq 256 && break
+done
+
+L=`wc -l kprobe_events`
+if [ $L -ne $N ]; then
+  echo "The number of kprobes events ($L) is not $N"
+  exit_fail
+fi
 
 echo 1 > events/kprobes/enable
 echo 0 > events/kprobes/enable

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Linux-kselftest-mirror] [PATCH 2/2] selftest: ftrace: Fix to add 256 kprobe events correctly
@ 2017-11-27  9:54   ` mhiramat
  0 siblings, 0 replies; 12+ messages in thread
From: mhiramat @ 2017-11-27  9:54 UTC (permalink / raw)


Current multiple-kprobe testcase only tries to add
kprobe events on first 256 text symbols. However
kprobes fails to probe on some text symbols (like
blacklisted symbols). Thus in the worst case,
the test can not add any kprobe events.

To avoid that, continue to try adding kprobe events
until 256 events. Also it confirms the number of
registered kprobe events.

Signed-off-by: Masami Hiramatsu <mhiramat at kernel.org>
---
 .../ftrace/test.d/kprobe/multiple_kprobes.tc       |   19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
index e297bd7a2e79..ce361b9d62cf 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
@@ -12,9 +12,24 @@ case `uname -m` in
   *) OFFS=0;;
 esac
 
-echo "Setup up kprobes on first 256 text symbols"
+if [ -d events/kprobes ]; then
+  echo 0 > events/kprobes/enable
+  echo > kprobe_events
+fi
+
+N=0
+echo "Setup up kprobes on first available 256 text symbols"
 grep -i " t " /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \
-head -n 256 | while read i; do echo p ${i}+${OFFS} ; done > kprobe_events ||:
+while read i; do
+  echo p ${i}+${OFFS} >> kprobe_events && N=$((N+1)) ||:
+  test $N -eq 256 && break
+done
+
+L=`wc -l kprobe_events`
+if [ $L -ne $N ]; then
+  echo "The number of kprobes events ($L) is not $N"
+  exit_fail
+fi
 
 echo 1 > events/kprobes/enable
 echo 0 > events/kprobes/enable

--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Linux-kselftest-mirror] [PATCH 2/2] selftest: ftrace: Fix to add 256 kprobe events correctly
@ 2017-11-27  9:54   ` mhiramat
  0 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2017-11-27  9:54 UTC (permalink / raw)


Current multiple-kprobe testcase only tries to add
kprobe events on first 256 text symbols. However
kprobes fails to probe on some text symbols (like
blacklisted symbols). Thus in the worst case,
the test can not add any kprobe events.

To avoid that, continue to try adding kprobe events
until 256 events. Also it confirms the number of
registered kprobe events.

Signed-off-by: Masami Hiramatsu <mhiramat at kernel.org>
---
 .../ftrace/test.d/kprobe/multiple_kprobes.tc       |   19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
index e297bd7a2e79..ce361b9d62cf 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
@@ -12,9 +12,24 @@ case `uname -m` in
   *) OFFS=0;;
 esac
 
-echo "Setup up kprobes on first 256 text symbols"
+if [ -d events/kprobes ]; then
+  echo 0 > events/kprobes/enable
+  echo > kprobe_events
+fi
+
+N=0
+echo "Setup up kprobes on first available 256 text symbols"
 grep -i " t " /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \
-head -n 256 | while read i; do echo p ${i}+${OFFS} ; done > kprobe_events ||:
+while read i; do
+  echo p ${i}+${OFFS} >> kprobe_events && N=$((N+1)) ||:
+  test $N -eq 256 && break
+done
+
+L=`wc -l kprobe_events`
+if [ $L -ne $N ]; then
+  echo "The number of kprobes events ($L) is not $N"
+  exit_fail
+fi
 
 echo 1 > events/kprobes/enable
 echo 0 > events/kprobes/enable

--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/2] selftest: ftrace: Fix to add 256 kprobe events correctly
@ 2017-11-27  9:54   ` mhiramat
  0 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2017-11-27  9:54 UTC (permalink / raw)
  To: linux-arm-kernel

Current multiple-kprobe testcase only tries to add
kprobe events on first 256 text symbols. However
kprobes fails to probe on some text symbols (like
blacklisted symbols). Thus in the worst case,
the test can not add any kprobe events.

To avoid that, continue to try adding kprobe events
until 256 events. Also it confirms the number of
registered kprobe events.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 .../ftrace/test.d/kprobe/multiple_kprobes.tc       |   19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
index e297bd7a2e79..ce361b9d62cf 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
@@ -12,9 +12,24 @@ case `uname -m` in
   *) OFFS=0;;
 esac
 
-echo "Setup up kprobes on first 256 text symbols"
+if [ -d events/kprobes ]; then
+  echo 0 > events/kprobes/enable
+  echo > kprobe_events
+fi
+
+N=0
+echo "Setup up kprobes on first available 256 text symbols"
 grep -i " t " /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \
-head -n 256 | while read i; do echo p ${i}+${OFFS} ; done > kprobe_events ||:
+while read i; do
+  echo p ${i}+${OFFS} >> kprobe_events && N=$((N+1)) ||:
+  test $N -eq 256 && break
+done
+
+L=`wc -l kprobe_events`
+if [ $L -ne $N ]; then
+  echo "The number of kprobes events ($L) is not $N"
+  exit_fail
+fi
 
 echo 1 > events/kprobes/enable
 echo 0 > events/kprobes/enable

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-11-27  9:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27  9:53 [PATCH 0/2] selftests: ftrace: Fix multiple-kprobe testcase Masami Hiramatsu
2017-11-27  9:53 ` Masami Hiramatsu
2017-11-27  9:53 ` [Linux-kselftest-mirror] " Masami Hiramatsu
2017-11-27  9:53 ` mhiramat
2017-11-27  9:53 ` [PATCH 1/2] [BUGFIX] selftest: ftrace: Fix to pick text symbols for kprobes Masami Hiramatsu
2017-11-27  9:53   ` Masami Hiramatsu
2017-11-27  9:53   ` [Linux-kselftest-mirror] " Masami Hiramatsu
2017-11-27  9:53   ` mhiramat
2017-11-27  9:54 ` [PATCH 2/2] selftest: ftrace: Fix to add 256 kprobe events correctly Masami Hiramatsu
2017-11-27  9:54   ` Masami Hiramatsu
2017-11-27  9:54   ` [Linux-kselftest-mirror] " Masami Hiramatsu
2017-11-27  9:54   ` mhiramat

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.