* [PATCH V2] tools/perf/tests/base_probe: Fix check for the count of existing probes in test_adding_kernel
@ 2025-01-10 9:43 Athira Rajeev
2025-01-13 10:21 ` Veronika Molnarova
0 siblings, 1 reply; 4+ messages in thread
From: Athira Rajeev @ 2025-01-10 9:43 UTC (permalink / raw)
To: acme, jolsa, adrian.hunter, irogers, namhyung, vmolnaro, mpetlan
Cc: linux-perf-users, linuxppc-dev, maddy, atrajeev, kjain, disgoel,
hbathini
perftool-testsuite_probe fails in test_adding_kernel as below:
Regexp not found: "probe:inode_permission_11"
-- [ FAIL ] -- perf_probe :: test_adding_kernel :: force-adding probes ::
second probe adding (with force) (output regexp parsing)
event syntax error: 'probe:inode_permission_11'
\___ unknown tracepoint
Error: File /sys/kernel/tracing//events/probe/inode_permission_11
not found.
Hint: Perhaps this kernel misses some CONFIG_ setting to
enable this feature?.
The test does the following:
1) Adds a probe point first using :
$CMD_PERF probe --add $TEST_PROBE
2) Then tries to add same probe again without —force
and expects it to fail. Next tries to add same probe again
with —force. In this case, perf probe succeeds and adds
the probe with a suffix number. Example:
./perf probe --add inode_permission
Added new event:
probe:inode_permission (on inode_permission)
./perf probe --add inode_permission --force
Added new event:
probe:inode_permission_1 (on inode_permission)
./perf probe --add inode_permission --force
Added new event:
probe:inode_permission_2 (on inode_permission)
Each time, suffix is added to existing probe name.
To get the suffix number, test cases uses :
NO_OF_PROBES=`$CMD_PERF probe -l | wc -l`
This will work if there is no other probe existing
in the system. If there are any other probes other than
kernel probes or inode_permission, ( example: any probe),
"perf probe -l" will include count for other probes too.
Example, in the system where this failed, already some
probes were default added. So count became 10
./perf probe -l | wc -l
10
So to be specific for "inode_permission", restrict the
probe count check to that probe point alone using :
NO_OF_PROBES=`$CMD_PERF probe -l $TEST_PROBE| wc -l`
Similarly while removing the probe using "probe --del *",
( removing all probes ), check uses:
../common/check_all_lines_matched.pl "Removed event: probe:$TEST_PROBE"
But if there are other probes in the system, the log will
contain reference to other existing probe too. Hence change
usage of check_all_lines_matched.pl to check_all_patterns_found.pl
This will make sure expecting string comes in the result
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
---
Changelog:
v1 -> v2:
No code changes. After being reviewed by Michael Petlan, since
initial patch was posted in 2024-10-14, rebased on top of latest
perf-tools-next
tools/perf/tests/shell/base_probe/test_adding_kernel.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/tests/shell/base_probe/test_adding_kernel.sh b/tools/perf/tests/shell/base_probe/test_adding_kernel.sh
index d541ffd44a93..f8b5f096d0d7 100755
--- a/tools/perf/tests/shell/base_probe/test_adding_kernel.sh
+++ b/tools/perf/tests/shell/base_probe/test_adding_kernel.sh
@@ -169,7 +169,7 @@ print_results $PERF_EXIT_CODE $CHECK_EXIT_CODE "force-adding probes :: second pr
(( TEST_RESULT += $? ))
# adding existing probe with '--force' should pass
-NO_OF_PROBES=`$CMD_PERF probe -l | wc -l`
+NO_OF_PROBES=`$CMD_PERF probe -l $TEST_PROBE| wc -l`
$CMD_PERF probe --force --add $TEST_PROBE 2> $LOGS_DIR/adding_kernel_forceadd_03.err
PERF_EXIT_CODE=$?
@@ -205,7 +205,7 @@ print_results $PERF_EXIT_CODE $CHECK_EXIT_CODE "using doubled probe"
$CMD_PERF probe --del \* 2> $LOGS_DIR/adding_kernel_removing_wildcard.err
PERF_EXIT_CODE=$?
-../common/check_all_lines_matched.pl "Removed event: probe:$TEST_PROBE" "Removed event: probe:${TEST_PROBE}_1" < $LOGS_DIR/adding_kernel_removing_wildcard.err
+../common/check_all_patterns_found.pl "Removed event: probe:$TEST_PROBE" "Removed event: probe:${TEST_PROBE}_1" < $LOGS_DIR/adding_kernel_removing_wildcard.err
CHECK_EXIT_CODE=$?
print_results $PERF_EXIT_CODE $CHECK_EXIT_CODE "removing multiple probes"
--
2.43.5
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH V2] tools/perf/tests/base_probe: Fix check for the count of existing probes in test_adding_kernel
2025-01-10 9:43 [PATCH V2] tools/perf/tests/base_probe: Fix check for the count of existing probes in test_adding_kernel Athira Rajeev
@ 2025-01-13 10:21 ` Veronika Molnarova
2025-01-13 15:06 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 4+ messages in thread
From: Veronika Molnarova @ 2025-01-13 10:21 UTC (permalink / raw)
To: Athira Rajeev, acme, jolsa, adrian.hunter, irogers, namhyung,
mpetlan
Cc: linux-perf-users, linuxppc-dev, maddy, kjain, disgoel, hbathini
On 1/10/25 10:43, Athira Rajeev wrote:
> perftool-testsuite_probe fails in test_adding_kernel as below:
> Regexp not found: "probe:inode_permission_11"
> -- [ FAIL ] -- perf_probe :: test_adding_kernel :: force-adding probes ::
> second probe adding (with force) (output regexp parsing)
> event syntax error: 'probe:inode_permission_11'
> \___ unknown tracepoint
>
> Error: File /sys/kernel/tracing//events/probe/inode_permission_11
> not found.
> Hint: Perhaps this kernel misses some CONFIG_ setting to
> enable this feature?.
>
> The test does the following:
> 1) Adds a probe point first using :
> $CMD_PERF probe --add $TEST_PROBE
> 2) Then tries to add same probe again without —force
> and expects it to fail. Next tries to add same probe again
> with —force. In this case, perf probe succeeds and adds
> the probe with a suffix number. Example:
>
> ./perf probe --add inode_permission
> Added new event:
> probe:inode_permission (on inode_permission)
>
> ./perf probe --add inode_permission --force
> Added new event:
> probe:inode_permission_1 (on inode_permission)
>
> ./perf probe --add inode_permission --force
> Added new event:
> probe:inode_permission_2 (on inode_permission)
>
> Each time, suffix is added to existing probe name.
> To get the suffix number, test cases uses :
> NO_OF_PROBES=`$CMD_PERF probe -l | wc -l`
>
> This will work if there is no other probe existing
> in the system. If there are any other probes other than
> kernel probes or inode_permission, ( example: any probe),
> "perf probe -l" will include count for other probes too.
>
> Example, in the system where this failed, already some
> probes were default added. So count became 10
> ./perf probe -l | wc -l
> 10
>
> So to be specific for "inode_permission", restrict the
> probe count check to that probe point alone using :
> NO_OF_PROBES=`$CMD_PERF probe -l $TEST_PROBE| wc -l`
>
> Similarly while removing the probe using "probe --del *",
> ( removing all probes ), check uses:
>
> ../common/check_all_lines_matched.pl "Removed event: probe:$TEST_PROBE"
>
> But if there are other probes in the system, the log will
> contain reference to other existing probe too. Hence change
> usage of check_all_lines_matched.pl to check_all_patterns_found.pl
> This will make sure expecting string comes in the result
>
> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Acked-by: Veronika Molnarova <vmolnaro@redhat.com>
Thanks,
Veronika
> ---
> Changelog:
> v1 -> v2:
> No code changes. After being reviewed by Michael Petlan, since
> initial patch was posted in 2024-10-14, rebased on top of latest
> perf-tools-next
>
> tools/perf/tests/shell/base_probe/test_adding_kernel.sh | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/tests/shell/base_probe/test_adding_kernel.sh b/tools/perf/tests/shell/base_probe/test_adding_kernel.sh
> index d541ffd44a93..f8b5f096d0d7 100755
> --- a/tools/perf/tests/shell/base_probe/test_adding_kernel.sh
> +++ b/tools/perf/tests/shell/base_probe/test_adding_kernel.sh
> @@ -169,7 +169,7 @@ print_results $PERF_EXIT_CODE $CHECK_EXIT_CODE "force-adding probes :: second pr
> (( TEST_RESULT += $? ))
>
> # adding existing probe with '--force' should pass
> -NO_OF_PROBES=`$CMD_PERF probe -l | wc -l`
> +NO_OF_PROBES=`$CMD_PERF probe -l $TEST_PROBE| wc -l`
> $CMD_PERF probe --force --add $TEST_PROBE 2> $LOGS_DIR/adding_kernel_forceadd_03.err
> PERF_EXIT_CODE=$?
>
> @@ -205,7 +205,7 @@ print_results $PERF_EXIT_CODE $CHECK_EXIT_CODE "using doubled probe"
> $CMD_PERF probe --del \* 2> $LOGS_DIR/adding_kernel_removing_wildcard.err
> PERF_EXIT_CODE=$?
>
> -../common/check_all_lines_matched.pl "Removed event: probe:$TEST_PROBE" "Removed event: probe:${TEST_PROBE}_1" < $LOGS_DIR/adding_kernel_removing_wildcard.err
> +../common/check_all_patterns_found.pl "Removed event: probe:$TEST_PROBE" "Removed event: probe:${TEST_PROBE}_1" < $LOGS_DIR/adding_kernel_removing_wildcard.err
> CHECK_EXIT_CODE=$?
>
> print_results $PERF_EXIT_CODE $CHECK_EXIT_CODE "removing multiple probes"
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH V2] tools/perf/tests/base_probe: Fix check for the count of existing probes in test_adding_kernel
2025-01-13 10:21 ` Veronika Molnarova
@ 2025-01-13 15:06 ` Arnaldo Carvalho de Melo
2025-01-14 7:54 ` Athira Rajeev
0 siblings, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2025-01-13 15:06 UTC (permalink / raw)
To: Veronika Molnarova
Cc: Athira Rajeev, jolsa, adrian.hunter, irogers, namhyung, mpetlan,
linux-perf-users, linuxppc-dev, maddy, kjain, disgoel, hbathini
On Mon, Jan 13, 2025 at 11:21:24AM +0100, Veronika Molnarova wrote:
> On 1/10/25 10:43, Athira Rajeev wrote:
> > But if there are other probes in the system, the log will
> > contain reference to other existing probe too. Hence change
> > usage of check_all_lines_matched.pl to check_all_patterns_found.pl
> > This will make sure expecting string comes in the result
> >
> > Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
>
> Acked-by: Veronika Molnarova <vmolnaro@redhat.com>
Thanks, applied to perf-tools-next,
- Arnaldo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH V2] tools/perf/tests/base_probe: Fix check for the count of existing probes in test_adding_kernel
2025-01-13 15:06 ` Arnaldo Carvalho de Melo
@ 2025-01-14 7:54 ` Athira Rajeev
0 siblings, 0 replies; 4+ messages in thread
From: Athira Rajeev @ 2025-01-14 7:54 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Veronika Molnarova
Cc: jolsa, adrian.hunter, irogers, namhyung, mpetlan,
linux-perf-users, linuxppc-dev, maddy, kjain, disgoel, hbathini
> On 13 Jan 2025, at 8:36 PM, Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
> On Mon, Jan 13, 2025 at 11:21:24AM +0100, Veronika Molnarova wrote:
>> On 1/10/25 10:43, Athira Rajeev wrote:
>>> But if there are other probes in the system, the log will
>>> contain reference to other existing probe too. Hence change
>>> usage of check_all_lines_matched.pl to check_all_patterns_found.pl
>>> This will make sure expecting string comes in the result
>>>
>>> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
>>
>> Acked-by: Veronika Molnarova <vmolnaro@redhat.com>
>
> Thanks, applied to perf-tools-next,
>
> - Arnaldo
Thanks Veronika for the ack and thanks Arnaldo for pulling in the patch
Thanks
Athira
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-01-14 7:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-10 9:43 [PATCH V2] tools/perf/tests/base_probe: Fix check for the count of existing probes in test_adding_kernel Athira Rajeev
2025-01-13 10:21 ` Veronika Molnarova
2025-01-13 15:06 ` Arnaldo Carvalho de Melo
2025-01-14 7:54 ` Athira Rajeev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).