perf test perftool_testsuite: Return correct value for skippingIn 'perf test', a return value 2 represents that the test case wasskipped. Fix this value for perftool_testsuite test cases todiffer
perf test perftool_testsuite: Return correct value for skippingIn 'perf test', a return value 2 represents that the test case wasskipped. Fix this value for perftool_testsuite test cases todifferentiate between skip and pass values.Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>Cc: Ian Rogers <irogers@google.com>Cc: Namhyung Kim <namhyung@kernel.org>Link: https://lore.kernel.org/r/20250113182605.130719-3-vmolnaro@redhat.comSigned-off-by: Michael Petlan <mpetlan@redhat.com>Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
show more ...
perf test perftool_testsuite: Add missing descriptionProperly name the test cases of perftool_testsuite instead of thelicense being taken as the name for 'perf test'.Signed-off-by: Veronika Moln
perf test perftool_testsuite: Add missing descriptionProperly name the test cases of perftool_testsuite instead of thelicense being taken as the name for 'perf test'.Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>Cc: Ian Rogers <irogers@google.com>Cc: Namhyung Kim <namhyung@kernel.org>Link: https://lore.kernel.org/r/20250113182605.130719-2-vmolnaro@redhat.comSigned-off-by: Michael Petlan <mpetlan@redhat.com>Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
perf tests base_probe: Fix check for the count of existing probes in test_adding_kernelperftool-testsuite_probe fails in test_adding_kernel as below: Regexp not found: "probe:inode_permission_11"
perf tests base_probe: Fix check for the count of existing probes in test_adding_kernelperftool-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_PROBE2) 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. Ifthere are any other probes other than kernel probes or inode_permission,( example: any probe), "perf probe -l" will include count for otherprobes too.Example, in the system where this failed, already some probes weredefault added. So count became 10 ./perf probe -l | wc -l 10So to be specific for "inode_permission", restrict the probe count checkto 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 allprobes), 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 containreference to other existing probe too. Hence change usage ofcheck_all_lines_matched.pl to check_all_patterns_found.pl This will makesure expecting string comes in the resultSigned-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>Acked-by: Veronika Molnarova <vmolnaro@redhat.com>Cc: Adrian Hunter <adrian.hunter@intel.com>Cc: Disha Goel <disgoel@linux.vnet.ibm.com>Cc: Hari Bathini <hbathini@linux.ibm.com>Cc: Ian Rogers <irogers@google.com>Cc: Jiri Olsa <jolsa@kernel.org>Cc: Kajol Jain <kjain@linux.ibm.com>Cc: Madhavan Srinivasan <maddy@linux.ibm.com>Cc: Michael Petlan <mpetlan@redhat.com>Cc: Namhyung Kim <namhyung@kernel.org>Link: https://lore.kernel.org/r/20250110094324.94604-1-atrajeev@linux.vnet.ibm.comSigned-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
perf tools tests shell base_probe: Enhance print_overall_results to print summary informationCurrently print_overall_results prints the number of fails in thesummary, example from base_probe tests
perf tools tests shell base_probe: Enhance print_overall_results to print summary informationCurrently print_overall_results prints the number of fails in thesummary, example from base_probe tests in testsuite_probe: ## [ FAIL ] ## perf_probe :: test_invalid_options SUMMARY :: 11 failures foundtest_invalid_options contains multiple tests and out of that 11 failed.Sometimes it could happen that it is due to missing dependency in thebuild or environment dependency.Example, perf probe -L requires DWARF enabled. otherwiseit fails as below: ./perf probe -L Error: switch `L' is not available because NO_DWARF=1"-L" is tested as one of the option in: for opt in '-a' '-d' '-L' '-V'; do <<perf probe test>> print_results $PERF_EXIT_CODE $CHECK_EXIT_CODE "missing argument for $opt"Here -a and -d doesn't require DWARF. Similarly there are few othertests requiring DWARF.To hint the user that missing DWARF could be one issue, updateprint_overall_results to print a comment string along with summaryhinting the possible cause. Update test_invalid_options.sh andtest_line_semantics.sh to pass the info about DWARF requirement sincethese tests failed when perf is built without DWARF.Use the check for presence of DWARF with "perf check feature" and appendthe hint message based on the result.With the change: ## [ FAIL ] ## perf_probe :: test_invalid_options SUMMARY :: 11 failures found :: Some of the tests need DWARF to runReviewed-by: Kajol Jain <kjain@linux.ibm.com>Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>Cc: Adrian Hunter <adrian.hunter@intel.com>Cc: Disha Goel <disgoel@linux.vnet.ibm.com>Cc: Ian Rogers <irogers@google.com>Cc: Jiri Olsa <jolsa@kernel.org>Cc: Madhavan Srinivasan <maddy@linux.ibm.com>Cc: Michael Petlan <mpetlan@redhat.com>Cc: Namhyung Kim <namhyung@kernel.org>Cc: Veronika Molnarova <vmolnaro@redhat.com>Cc: linuxppc-dev@lists.ozlabs.orgLink: https://lore.kernel.org/r/20241206135254.35727-1-atrajeev@linux.vnet.ibm.com[ Minor edits changing "dwarf" to "DWARF" as its an acronym ]Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
perf test: Handle perftool-testsuite_probe failure due to broken DWARFTest case test_adding_blacklisted ends in failure if the blacklistedprobe is of an assembler function with no DWARF available.
perf test: Handle perftool-testsuite_probe failure due to broken DWARFTest case test_adding_blacklisted ends in failure if the blacklistedprobe is of an assembler function with no DWARF available. At the sametime, probing the blacklisted function with ASM DWARF doesn't test theblacklist itself as the failure is a result of the broken DWARF.When the broken DWARF output is encountered, check if the probedfunction was compiled by the assembler. If so, the broken DWARF messageis expected and does not report a perf issue, else report a failure. Ifthe ASM DWARF affected the probe, try the next probe on the blacklist.If the first 5 probes are defective due to broken DWARF, skip the testcase.Fixes: def5480d63c1e847 ("perf testsuite probe: Add test for blacklisted kprobes handling")Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>Cc: Adrian Hunter <adrian.hunter@intel.com>Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>Cc: Ian Rogers <irogers@google.com>Cc: Ingo Molnar <mingo@redhat.com>Cc: Jiri Olsa <jolsa@kernel.org>Cc: Kan Liang <kan.liang@linux.intel.com>Cc: Mark Rutland <mark.rutland@arm.com>Cc: Michael Petlan <mpetlan@redhat.com>Cc: Namhyung Kim <namhyung@kernel.org>Cc: Peter Zijlstra <peterz@infradead.org>Cc: Veronika Molnarova <vmolnaro@redhat.com>Link: https://lore.kernel.org/r/20241017161555.236769-1-vmolnaro@redhat.comSigned-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
perf testsuite probe: Add test for line semanticsThe perf-probe command uses a specific semantics to describe probes.Test some patterns that are known to be both valid and invalid ifthey are hand
perf testsuite probe: Add test for line semanticsThe perf-probe command uses a specific semantics to describe probes.Test some patterns that are known to be both valid and invalid ifthey are handled appropriately.This test is run as a part of perftool-testsuite_probe test case.Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>Cc: Ian Rogers <irogers@google.com>Cc: Masami Hiramatsu <mhiramat@kernel.org>Cc: Namhyung Kim <namhyung@kernel.org>Link: https://lore.kernel.org/r/20240702110849.31904-9-vmolnaro@redhat.comSigned-off-by: Michael Petlan <mpetlan@redhat.com>Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
perf testsuite probe: Add test for invalid optionsTest if various incompatible options are correctly handled-rejected.It is run as a part of perftool-testsuite_probe test case.Signed-off-by: Ver
perf testsuite probe: Add test for invalid optionsTest if various incompatible options are correctly handled-rejected.It is run as a part of perftool-testsuite_probe test case.Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>Cc: Ian Rogers <irogers@google.com>Cc: Masami Hiramatsu <mhiramat@kernel.org>Cc: Namhyung Kim <namhyung@kernel.org>Link: https://lore.kernel.org/r/20240702110849.31904-8-vmolnaro@redhat.comSigned-off-by: Michael Petlan <mpetlan@redhat.com>Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
perf testsuite probe: Add test for basic perf-probe optionsTest basic behavior of perf-probe subcommand. It is run as a part ofperftool-testsuite_probe test case.Signed-off-by: Veronika Molnarov
perf testsuite probe: Add test for basic perf-probe optionsTest basic behavior of perf-probe subcommand. It is run as a part ofperftool-testsuite_probe test case.Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>Cc: Ian Rogers <irogers@google.com>Cc: Masami Hiramatsu <mhiramat@kernel.org>Cc: Namhyung Kim <namhyung@kernel.org>Link: https://lore.kernel.org/r/20240702110849.31904-7-vmolnaro@redhat.comSigned-off-by: Michael Petlan <mpetlan@redhat.com>Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
perf testsuite probe: Add test for blacklisted kprobes handlingTest perf probe interface. Blacklisted functions should be rejectedwhen there is an attempt to set a kprobe to them.Signed-off-by:
perf testsuite probe: Add test for blacklisted kprobes handlingTest perf probe interface. Blacklisted functions should be rejectedwhen there is an attempt to set a kprobe to them.Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>Cc: Ian Rogers <irogers@google.com>Cc: Masami Hiramatsu <mhiramat@kernel.org>Cc: Namhyung Kim <namhyung@kernel.org>Link: https://lore.kernel.org/r/20240702110849.31904-6-vmolnaro@redhat.comSigned-off-by: Michael Petlan <mpetlan@redhat.com>Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
perf testsuite: Merge settings files for shell testsMerge perf testsuite setting files into common settings to reduceduplicates and prevent errors.Signed-off-by: Michael Petlan <mpetlan@redhat.c
perf testsuite: Merge settings files for shell testsMerge perf testsuite setting files into common settings to reduceduplicates and prevent errors.Signed-off-by: Michael Petlan <mpetlan@redhat.com>Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>Cc: Ian Rogers <irogers@google.com>Cc: Masami Hiramatsu <mhiramat@kernel.org>Cc: Namhyung Kim <namhyung@kernel.org>Link: https://lore.kernel.org/r/20240702110849.31904-4-vmolnaro@redhat.comSigned-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf: Handle perftool-testsuite_probe testcases fail when kernel debuginfo is not presentRunning "perftool-testsuite_probe" fails as below: ./perf test -v "perftool-testsuite_probe" 83: pe
tools/perf: Handle perftool-testsuite_probe testcases fail when kernel debuginfo is not presentRunning "perftool-testsuite_probe" fails as below: ./perf test -v "perftool-testsuite_probe" 83: perftool-testsuite_probe : FAILEDThere are three fails:1. Regexp not found: "\s*probe:inode_permission(?:_\d+)?\s+\(on inode_permission(?:[:\+][0-9A-Fa-f]+)?@.+\)" -- [ FAIL ] -- perf_probe :: test_adding_kernel :: listing added probe :: perf probe -l (output regexp parsing)2. Regexp not found: "probe:vfs_mknod" Regexp not found: "probe:vfs_create" Regexp not found: "probe:vfs_rmdir" Regexp not found: "probe:vfs_link" Regexp not found: "probe:vfs_write" -- [ FAIL ] -- perf_probe :: test_adding_kernel :: wildcard adding support (command exitcode + output regexp parsing)3. Regexp not found: "Failed to find" Regexp not found: "somenonexistingrandomstuffwhichisalsoprettylongorevenlongertoexceed64" Regexp not found: "in this function|at this address" Line did not match any pattern: "The /boot/vmlinux file has no debug information." Line did not match any pattern: "Rebuild with CONFIG_DEBUG_INFO=y, or install an appropriate debuginfo package."These three tests depends on kernel debug info.1. Fail 1 expects file name along with probe which needs debuginfo2. Fail 2 : perf probe -nf --max-probes=512 -a 'vfs_* $params' Debuginfo-analysis is not supported. Error: Failed to add events.3. Fail 3 : perf probe 'vfs_read somenonexistingrandomstuffwhichisalsoprettylongorevenlongertoexceed64' Debuginfo-analysis is not supported. Error: Failed to add events.There is already helper function skip_if_no_debuginfo inlib/probe_vfs_getname.sh which does perf probe and returns"2" if debug info is not present. Use the skip_if_no_debuginfofunction and skip only the three tests which needs debuginfobased on the result.With the patch: 83: perftool-testsuite_probe: --- start --- test child forked, pid 3927 -- [ PASS ] -- perf_probe :: test_adding_kernel :: adding probe inode_permission :: -- [ PASS ] -- perf_probe :: test_adding_kernel :: adding probe inode_permission :: -a -- [ PASS ] -- perf_probe :: test_adding_kernel :: adding probe inode_permission :: --add -- [ PASS ] -- perf_probe :: test_adding_kernel :: listing added probe :: perf list Regexp not found: "\s*probe:inode_permission(?:_\d+)?\s+\(on inode_permission(?:[:\+][0-9A-Fa-f]+)?@.+\)" -- [ SKIP ] -- perf_probe :: test_adding_kernel :: 2 2 Skipped due to missing debuginfo :: testcase skipped -- [ PASS ] -- perf_probe :: test_adding_kernel :: using added probe -- [ PASS ] -- perf_probe :: test_adding_kernel :: deleting added probe -- [ PASS ] -- perf_probe :: test_adding_kernel :: listing removed probe (should NOT be listed) -- [ PASS ] -- perf_probe :: test_adding_kernel :: dry run :: adding probe -- [ PASS ] -- perf_probe :: test_adding_kernel :: force-adding probes :: first probe adding -- [ PASS ] -- perf_probe :: test_adding_kernel :: force-adding probes :: second probe adding (without force) -- [ PASS ] -- perf_probe :: test_adding_kernel :: force-adding probes :: second probe adding (with force) -- [ PASS ] -- perf_probe :: test_adding_kernel :: using doubled probe -- [ PASS ] -- perf_probe :: test_adding_kernel :: removing multiple probes Regexp not found: "probe:vfs_mknod" Regexp not found: "probe:vfs_create" Regexp not found: "probe:vfs_rmdir" Regexp not found: "probe:vfs_link" Regexp not found: "probe:vfs_write" -- [ SKIP ] -- perf_probe :: test_adding_kernel :: 2 2 Skipped due to missing debuginfo :: testcase skipped Regexp not found: "Failed to find" Regexp not found: "somenonexistingrandomstuffwhichisalsoprettylongorevenlongertoexceed64" Regexp not found: "in this function|at this address" Line did not match any pattern: "The /boot/vmlinux file has no debug information." Line did not match any pattern: "Rebuild with CONFIG_DEBUG_INFO=y, or install an appropriate debuginfo package." -- [ SKIP ] -- perf_probe :: test_adding_kernel :: 2 2 Skipped due to missing debuginfo :: testcase skipped -- [ PASS ] -- perf_probe :: test_adding_kernel :: function with retval :: add -- [ PASS ] -- perf_probe :: test_adding_kernel :: function with retval :: record -- [ PASS ] -- perf_probe :: test_adding_kernel :: function argument probing :: script ## [ PASS ] ## perf_probe :: test_adding_kernel SUMMARY ---- end(0) ---- 83: perftool-testsuite_probe : OkOnly the three specific tests are skipped and remainingran successfully.Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>Reviewed-by: James Clark <james.clark@arm.com>Cc: akanksha@linux.ibm.comCc: kjain@linux.ibm.comCc: maddy@linux.ibm.comCc: disgoel@linux.vnet.ibm.comCc: linuxppc-dev@lists.ozlabs.orgSigned-off-by: Namhyung Kim <namhyung@kernel.org>Link: https://lore.kernel.org/r/20240617122121.7484-1-atrajeev@linux.vnet.ibm.com
perf tests shell kprobes: Add missing description as used by 'perf test' outputBefore: root@x1:~# perf test 76 76: SPDX-License-Identifier: GPL-2.0 : Ok root@
perf tests shell kprobes: Add missing description as used by 'perf test' outputBefore: root@x1:~# perf test 76 76: SPDX-License-Identifier: GPL-2.0 : Ok root@x1:~#After: root@x1:~# perf test 76 76: Add 'perf probe's, list and remove them. : Ok root@x1:~#Reviewed-by: Ian Rogers <irogers@google.com>Cc: Adrian Hunter <adrian.hunter@intel.com>Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>Cc: Jiri Olsa <jolsa@kernel.org>Cc: Kajol Jain <kjain@linux.ibm.com>Cc: Michael Petlan <mpetlan@redhat.com>Cc: Namhyung Kim <namhyung@kernel.org>Cc: Veronika Molnarova <vmolnaro@redhat.com>Link: https://lore.kernel.org/lkml/ZigRDKUGkcDqD-yW@x1Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
perf testsuite: Add test for kprobe handlingTest perf interface to kprobes: listing, adding and removing probes. Itis run as a part of perftool-testsuite_probe test case.Signed-off-by: Veronika
perf testsuite: Add test for kprobe handlingTest perf interface to kprobes: listing, adding and removing probes. Itis run as a part of perftool-testsuite_probe test case.Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>Signed-off-by: Michael Petlan <mpetlan@redhat.com>Cc: kjain@linux.ibm.comCc: atrajeev@linux.vnet.ibm.comSigned-off-by: Namhyung Kim <namhyung@kernel.org>Link: https://lore.kernel.org/r/20240215110231.15385-7-mpetlan@redhat.com