* [PATCH V3 00/10] perf tools: Fix test "perf probe of function from different CU"
@ 2024-06-01 12:59 Chaitanya S Prakash
2024-07-10 7:39 ` Chaitanya S Prakash
0 siblings, 1 reply; 6+ messages in thread
From: Chaitanya S Prakash @ 2024-06-01 12:59 UTC (permalink / raw)
To: linux-perf-users
Cc: anshuman.khandual, james.clark, Chaitanya S Prakash,
Josh Poimboeuf, Peter Zijlstra, Suzuki K Poulose, Mike Leach,
John Garry, Will Deacon, Leo Yan, Ingo Molnar,
Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
Chenyuan Mi, Masami Hiramatsu, Ravi Bangoria,
Ahelenia Ziemiańska, Colin Ian King, Changbin Du, Kan Liang,
Athira Rajeev, Tiezhu Yang, Alexey Dobriyan, Georg Müller,
Liam Howlett, bpf, coresight, linux-arm-kernel, linux-kernel
From: Chaitanya S Prakash <chaitanyas.prakash@arm.com>
Perf treated all files beginning with "/tmp/perf-" as a map file despite
them always ending in ".map", this caused the test "perf probe of
function from different CU" to fail when Perf was built with NO_DWARF=1.
As the file was parsed as a map file, the probe...--funcs command output
garbage values instead of listing the functions in the binary. After
fixing the issue an additional check to test the output of the
probe...--funcs command has been added.
Additionally, various functions within the codebase have been refactored
and restructured. The definition of str_has_suffix() has been adopted
from tools/bpf/bpftool/gen.c and added to tools/lib/string.c in an
attempt to make the function more generic. The implementation has been
retained but the return values have been modified to resemble that of
str_has_prefix(), i.e., return strlen(suffix) on success and 0 on
failure. In light of the new addition, "ends_with()", a locally defined
function used for checking if a string had a given suffix has been
deleted and str_has_suffix() has replaced its usage. A call to
strtailcmp() has also been replaced as str_has_suffix() seemed more
suited for that particular use case.
Finally str_has_prefix() is adopted from the kernel and is added to
tools/lib/string.c, following which strstarts() is deleted and its use
has been replaced with str_has_prefix().
This patch series has been tested on 6.10-rc1 mainline kernel, both on
arm64 and x86 platforms.
Changes in V3:
- Patch adding configs required by "perf probe of function from different
CU" was originally part of the series but has been merged in 6.10-rc1.
https://github.com/torvalds/linux/commit/6b718ac6874c2233b8dec369a8a377d6c5b638e6
- Restructure patches according to the maintainer trees.
- Add explanation for why '| grep "foo"' is used.
- Fix build errors for when perf is built with LLVM=1.
Changes in V2:
https://lore.kernel.org/all/20240408062230.1949882-1-ChaitanyaS.Prakash@arm.com/
- Add str_has_suffix() and str_has_prefix() to tools/lib/string.c
- Delete ends_with() and replace its usage with str_has_suffix()
- Replace an instance of strtailcmp() with str_has_suffix()
- Delete strstarts() from tools/include/linux/string.h and replace its
usage with str_has_prefix()
Changes in V1:
https://lore.kernel.org/all/20240220042957.2022391-1-ChaitanyaS.Prakash@arm.com/
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: James Clark <james.clark@arm.com>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Will Deacon <will@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Chenyuan Mi <cymi20@fudan.edu.cn>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Cc: Colin Ian King <colin.i.king@gmail.com>
Cc: Changbin Du <changbin.du@huawei.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Georg Müller <georgmueller@gmx.net>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: bpf@vger.kernel.org
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-perf-users@vger.kernel.org
Chaitanya S Prakash (10):
tools lib: adopt str_has_suffix() from bpftool/gen.c
perf util: Delete ends_with() and replace its use with
str_has_suffix()
perf util: Replace an instance of strtailcmp() by str_has_suffix()
tools lib: Adopt str_has_prefix() from kernel
libsubcmd: Replace strstarts() usage with str_has_prefix()
objtool: Replace strstarts() usage with str_has_prefix()
perf tools: Replace strstarts() usage with str_has_prefix()
tools lib: Remove strstarts() as all its usecases have been replaced
by str_has_prefix()
perf tools: Only treat files as map files when they have the extension
.map
perf test: Check output of the probe ... --funcs command
tools/include/linux/string.h | 12 ++---
tools/lib/string.c | 48 +++++++++++++++++++
tools/lib/subcmd/help.c | 2 +-
tools/lib/subcmd/parse-options.c | 18 +++----
tools/objtool/check.c | 2 +-
tools/perf/arch/arm/util/pmu.c | 4 +-
tools/perf/arch/x86/annotate/instructions.c | 14 +++---
tools/perf/arch/x86/util/env.c | 2 +-
tools/perf/builtin-c2c.c | 4 +-
tools/perf/builtin-config.c | 2 +-
tools/perf/builtin-daemon.c | 2 +-
tools/perf/builtin-ftrace.c | 2 +-
tools/perf/builtin-help.c | 6 +--
tools/perf/builtin-kmem.c | 2 +-
tools/perf/builtin-kvm.c | 14 +++---
tools/perf/builtin-kwork.c | 10 ++--
tools/perf/builtin-lock.c | 6 +--
tools/perf/builtin-mem.c | 4 +-
tools/perf/builtin-sched.c | 6 +--
tools/perf/builtin-script.c | 30 ++++--------
tools/perf/builtin-stat.c | 4 +-
tools/perf/builtin-timechart.c | 2 +-
tools/perf/builtin-trace.c | 6 +--
tools/perf/perf.c | 12 ++---
.../shell/test_uprobe_from_different_cu.sh | 2 +-
tools/perf/tests/symbols.c | 2 +-
tools/perf/ui/browser.c | 2 +-
tools/perf/ui/browsers/scripts.c | 2 +-
tools/perf/ui/stdio/hist.c | 2 +-
tools/perf/util/amd-sample-raw.c | 4 +-
tools/perf/util/annotate.c | 2 +-
tools/perf/util/callchain.c | 2 +-
tools/perf/util/config.c | 12 ++---
tools/perf/util/map.c | 8 ++--
tools/perf/util/pmus.c | 2 +-
tools/perf/util/probe-event.c | 2 +-
tools/perf/util/sample-raw.c | 2 +-
tools/perf/util/symbol-elf.c | 4 +-
tools/perf/util/symbol.c | 3 +-
39 files changed, 148 insertions(+), 117 deletions(-)
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH V3 00/10] perf tools: Fix test "perf probe of function from different CU"
2024-06-01 12:59 [PATCH V3 00/10] perf tools: Fix test "perf probe of function from different CU" Chaitanya S Prakash
@ 2024-07-10 7:39 ` Chaitanya S Prakash
2024-07-12 19:55 ` Namhyung Kim
2024-07-15 9:34 ` James Clark
0 siblings, 2 replies; 6+ messages in thread
From: Chaitanya S Prakash @ 2024-07-10 7:39 UTC (permalink / raw)
To: linux-perf-users, Peter Zijlstra, Arnaldo Carvalho de Melo,
Ingo Molnar
Cc: anshuman.khandual, james.clark, Josh Poimboeuf, Suzuki K Poulose,
Mike Leach, John Garry, Will Deacon, Leo Yan, Namhyung Kim,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Ian Rogers,
Adrian Hunter, Chenyuan Mi, Masami Hiramatsu, Ravi Bangoria,
Ahelenia Ziemiańska, Colin Ian King, Changbin Du, Kan Liang,
Athira Rajeev, Tiezhu Yang, Alexey Dobriyan, Georg Müller,
Liam Howlett, bpf, coresight, linux-arm-kernel, linux-kernel
Gentle ping, are there any updates on the string clean up patch set?
On 6/1/24 18:29, Chaitanya S Prakash wrote:
> From: Chaitanya S Prakash <chaitanyas.prakash@arm.com>
>
> Perf treated all files beginning with "/tmp/perf-" as a map file despite
> them always ending in ".map", this caused the test "perf probe of
> function from different CU" to fail when Perf was built with NO_DWARF=1.
> As the file was parsed as a map file, the probe...--funcs command output
> garbage values instead of listing the functions in the binary. After
> fixing the issue an additional check to test the output of the
> probe...--funcs command has been added.
>
> Additionally, various functions within the codebase have been refactored
> and restructured. The definition of str_has_suffix() has been adopted
> from tools/bpf/bpftool/gen.c and added to tools/lib/string.c in an
> attempt to make the function more generic. The implementation has been
> retained but the return values have been modified to resemble that of
> str_has_prefix(), i.e., return strlen(suffix) on success and 0 on
> failure. In light of the new addition, "ends_with()", a locally defined
> function used for checking if a string had a given suffix has been
> deleted and str_has_suffix() has replaced its usage. A call to
> strtailcmp() has also been replaced as str_has_suffix() seemed more
> suited for that particular use case.
>
> Finally str_has_prefix() is adopted from the kernel and is added to
> tools/lib/string.c, following which strstarts() is deleted and its use
> has been replaced with str_has_prefix().
>
> This patch series has been tested on 6.10-rc1 mainline kernel, both on
> arm64 and x86 platforms.
>
> Changes in V3:
>
> - Patch adding configs required by "perf probe of function from different
> CU" was originally part of the series but has been merged in 6.10-rc1.
> https://github.com/torvalds/linux/commit/6b718ac6874c2233b8dec369a8a377d6c5b638e6
>
> - Restructure patches according to the maintainer trees.
> - Add explanation for why '| grep "foo"' is used.
> - Fix build errors for when perf is built with LLVM=1.
>
> Changes in V2:
> https://lore.kernel.org/all/20240408062230.1949882-1-ChaitanyaS.Prakash@arm.com/
>
> - Add str_has_suffix() and str_has_prefix() to tools/lib/string.c
> - Delete ends_with() and replace its usage with str_has_suffix()
> - Replace an instance of strtailcmp() with str_has_suffix()
> - Delete strstarts() from tools/include/linux/string.h and replace its
> usage with str_has_prefix()
>
> Changes in V1:
> https://lore.kernel.org/all/20240220042957.2022391-1-ChaitanyaS.Prakash@arm.com/
>
> Cc: Josh Poimboeuf <jpoimboe@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
> Cc: Mike Leach <mike.leach@linaro.org>
> Cc: James Clark <james.clark@arm.com>
> Cc: John Garry <john.g.garry@oracle.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Leo Yan <leo.yan@linaro.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Ian Rogers <irogers@google.com>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Chenyuan Mi <cymi20@fudan.edu.cn>
> Cc: Masami Hiramatsu <mhiramat@kernel.org>
> Cc: Ravi Bangoria <ravi.bangoria@amd.com>
> Cc: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
> Cc: Colin Ian King <colin.i.king@gmail.com>
> Cc: Changbin Du <changbin.du@huawei.com>
> Cc: Kan Liang <kan.liang@linux.intel.com>
> Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
> Cc: Tiezhu Yang <yangtiezhu@loongson.cn>
> Cc: Alexey Dobriyan <adobriyan@gmail.com>
> Cc: Georg Müller <georgmueller@gmx.net>
> Cc: Liam Howlett <liam.howlett@oracle.com>
> Cc: bpf@vger.kernel.org
> Cc: coresight@lists.linaro.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-perf-users@vger.kernel.org
>
> Chaitanya S Prakash (10):
> tools lib: adopt str_has_suffix() from bpftool/gen.c
> perf util: Delete ends_with() and replace its use with
> str_has_suffix()
> perf util: Replace an instance of strtailcmp() by str_has_suffix()
> tools lib: Adopt str_has_prefix() from kernel
> libsubcmd: Replace strstarts() usage with str_has_prefix()
> objtool: Replace strstarts() usage with str_has_prefix()
> perf tools: Replace strstarts() usage with str_has_prefix()
> tools lib: Remove strstarts() as all its usecases have been replaced
> by str_has_prefix()
> perf tools: Only treat files as map files when they have the extension
> .map
> perf test: Check output of the probe ... --funcs command
>
> tools/include/linux/string.h | 12 ++---
> tools/lib/string.c | 48 +++++++++++++++++++
> tools/lib/subcmd/help.c | 2 +-
> tools/lib/subcmd/parse-options.c | 18 +++----
> tools/objtool/check.c | 2 +-
> tools/perf/arch/arm/util/pmu.c | 4 +-
> tools/perf/arch/x86/annotate/instructions.c | 14 +++---
> tools/perf/arch/x86/util/env.c | 2 +-
> tools/perf/builtin-c2c.c | 4 +-
> tools/perf/builtin-config.c | 2 +-
> tools/perf/builtin-daemon.c | 2 +-
> tools/perf/builtin-ftrace.c | 2 +-
> tools/perf/builtin-help.c | 6 +--
> tools/perf/builtin-kmem.c | 2 +-
> tools/perf/builtin-kvm.c | 14 +++---
> tools/perf/builtin-kwork.c | 10 ++--
> tools/perf/builtin-lock.c | 6 +--
> tools/perf/builtin-mem.c | 4 +-
> tools/perf/builtin-sched.c | 6 +--
> tools/perf/builtin-script.c | 30 ++++--------
> tools/perf/builtin-stat.c | 4 +-
> tools/perf/builtin-timechart.c | 2 +-
> tools/perf/builtin-trace.c | 6 +--
> tools/perf/perf.c | 12 ++---
> .../shell/test_uprobe_from_different_cu.sh | 2 +-
> tools/perf/tests/symbols.c | 2 +-
> tools/perf/ui/browser.c | 2 +-
> tools/perf/ui/browsers/scripts.c | 2 +-
> tools/perf/ui/stdio/hist.c | 2 +-
> tools/perf/util/amd-sample-raw.c | 4 +-
> tools/perf/util/annotate.c | 2 +-
> tools/perf/util/callchain.c | 2 +-
> tools/perf/util/config.c | 12 ++---
> tools/perf/util/map.c | 8 ++--
> tools/perf/util/pmus.c | 2 +-
> tools/perf/util/probe-event.c | 2 +-
> tools/perf/util/sample-raw.c | 2 +-
> tools/perf/util/symbol-elf.c | 4 +-
> tools/perf/util/symbol.c | 3 +-
> 39 files changed, 148 insertions(+), 117 deletions(-)
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH V3 00/10] perf tools: Fix test "perf probe of function from different CU"
2024-07-10 7:39 ` Chaitanya S Prakash
@ 2024-07-12 19:55 ` Namhyung Kim
2024-07-15 9:34 ` James Clark
1 sibling, 0 replies; 6+ messages in thread
From: Namhyung Kim @ 2024-07-12 19:55 UTC (permalink / raw)
To: Chaitanya S Prakash
Cc: linux-perf-users, Peter Zijlstra, Arnaldo Carvalho de Melo,
Ingo Molnar, anshuman.khandual, james.clark, Josh Poimboeuf,
Suzuki K Poulose, Mike Leach, John Garry, Will Deacon, Leo Yan,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Ian Rogers,
Adrian Hunter, Chenyuan Mi, Masami Hiramatsu, Ravi Bangoria,
Ahelenia Ziemiańska, Colin Ian King, Changbin Du, Kan Liang,
Athira Rajeev, Tiezhu Yang, Alexey Dobriyan, Georg Müller,
Liam Howlett, bpf, coresight, linux-arm-kernel, linux-kernel
Hello,
On Wed, Jul 10, 2024 at 01:09:26PM +0530, Chaitanya S Prakash wrote:
> Gentle ping, are there any updates on the string clean up patch set?
Sorry, I don't see any specific needs to have them.
Thanks,
Namhyung
>
> On 6/1/24 18:29, Chaitanya S Prakash wrote:
> > From: Chaitanya S Prakash <chaitanyas.prakash@arm.com>
> >
> > Perf treated all files beginning with "/tmp/perf-" as a map file despite
> > them always ending in ".map", this caused the test "perf probe of
> > function from different CU" to fail when Perf was built with NO_DWARF=1.
> > As the file was parsed as a map file, the probe...--funcs command output
> > garbage values instead of listing the functions in the binary. After
> > fixing the issue an additional check to test the output of the
> > probe...--funcs command has been added.
> >
> > Additionally, various functions within the codebase have been refactored
> > and restructured. The definition of str_has_suffix() has been adopted
> > from tools/bpf/bpftool/gen.c and added to tools/lib/string.c in an
> > attempt to make the function more generic. The implementation has been
> > retained but the return values have been modified to resemble that of
> > str_has_prefix(), i.e., return strlen(suffix) on success and 0 on
> > failure. In light of the new addition, "ends_with()", a locally defined
> > function used for checking if a string had a given suffix has been
> > deleted and str_has_suffix() has replaced its usage. A call to
> > strtailcmp() has also been replaced as str_has_suffix() seemed more
> > suited for that particular use case.
> >
> > Finally str_has_prefix() is adopted from the kernel and is added to
> > tools/lib/string.c, following which strstarts() is deleted and its use
> > has been replaced with str_has_prefix().
> >
> > This patch series has been tested on 6.10-rc1 mainline kernel, both on
> > arm64 and x86 platforms.
> >
> > Changes in V3:
> >
> > - Patch adding configs required by "perf probe of function from different
> > CU" was originally part of the series but has been merged in 6.10-rc1.
> > https://github.com/torvalds/linux/commit/6b718ac6874c2233b8dec369a8a377d6c5b638e6
> >
> > - Restructure patches according to the maintainer trees.
> > - Add explanation for why '| grep "foo"' is used.
> > - Fix build errors for when perf is built with LLVM=1.
> >
> > Changes in V2:
> > https://lore.kernel.org/all/20240408062230.1949882-1-ChaitanyaS.Prakash@arm.com/
> >
> > - Add str_has_suffix() and str_has_prefix() to tools/lib/string.c
> > - Delete ends_with() and replace its usage with str_has_suffix()
> > - Replace an instance of strtailcmp() with str_has_suffix()
> > - Delete strstarts() from tools/include/linux/string.h and replace its
> > usage with str_has_prefix()
> >
> > Changes in V1:
> > https://lore.kernel.org/all/20240220042957.2022391-1-ChaitanyaS.Prakash@arm.com/
> >
> > Cc: Josh Poimboeuf <jpoimboe@kernel.org>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
> > Cc: Mike Leach <mike.leach@linaro.org>
> > Cc: James Clark <james.clark@arm.com>
> > Cc: John Garry <john.g.garry@oracle.com>
> > Cc: Will Deacon <will@kernel.org>
> > Cc: Leo Yan <leo.yan@linaro.org>
> > Cc: Ingo Molnar <mingo@redhat.com>
> > Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
> > Cc: Namhyung Kim <namhyung@kernel.org>
> > Cc: Mark Rutland <mark.rutland@arm.com>
> > Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> > Cc: Jiri Olsa <jolsa@kernel.org>
> > Cc: Ian Rogers <irogers@google.com>
> > Cc: Adrian Hunter <adrian.hunter@intel.com>
> > Cc: Chenyuan Mi <cymi20@fudan.edu.cn>
> > Cc: Masami Hiramatsu <mhiramat@kernel.org>
> > Cc: Ravi Bangoria <ravi.bangoria@amd.com>
> > Cc: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
> > Cc: Colin Ian King <colin.i.king@gmail.com>
> > Cc: Changbin Du <changbin.du@huawei.com>
> > Cc: Kan Liang <kan.liang@linux.intel.com>
> > Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
> > Cc: Tiezhu Yang <yangtiezhu@loongson.cn>
> > Cc: Alexey Dobriyan <adobriyan@gmail.com>
> > Cc: Georg Müller <georgmueller@gmx.net>
> > Cc: Liam Howlett <liam.howlett@oracle.com>
> > Cc: bpf@vger.kernel.org
> > Cc: coresight@lists.linaro.org
> > Cc: linux-arm-kernel@lists.infradead.org
> > Cc: linux-kernel@vger.kernel.org
> > Cc: linux-perf-users@vger.kernel.org
> >
> > Chaitanya S Prakash (10):
> > tools lib: adopt str_has_suffix() from bpftool/gen.c
> > perf util: Delete ends_with() and replace its use with
> > str_has_suffix()
> > perf util: Replace an instance of strtailcmp() by str_has_suffix()
> > tools lib: Adopt str_has_prefix() from kernel
> > libsubcmd: Replace strstarts() usage with str_has_prefix()
> > objtool: Replace strstarts() usage with str_has_prefix()
> > perf tools: Replace strstarts() usage with str_has_prefix()
> > tools lib: Remove strstarts() as all its usecases have been replaced
> > by str_has_prefix()
> > perf tools: Only treat files as map files when they have the extension
> > .map
> > perf test: Check output of the probe ... --funcs command
> >
> > tools/include/linux/string.h | 12 ++---
> > tools/lib/string.c | 48 +++++++++++++++++++
> > tools/lib/subcmd/help.c | 2 +-
> > tools/lib/subcmd/parse-options.c | 18 +++----
> > tools/objtool/check.c | 2 +-
> > tools/perf/arch/arm/util/pmu.c | 4 +-
> > tools/perf/arch/x86/annotate/instructions.c | 14 +++---
> > tools/perf/arch/x86/util/env.c | 2 +-
> > tools/perf/builtin-c2c.c | 4 +-
> > tools/perf/builtin-config.c | 2 +-
> > tools/perf/builtin-daemon.c | 2 +-
> > tools/perf/builtin-ftrace.c | 2 +-
> > tools/perf/builtin-help.c | 6 +--
> > tools/perf/builtin-kmem.c | 2 +-
> > tools/perf/builtin-kvm.c | 14 +++---
> > tools/perf/builtin-kwork.c | 10 ++--
> > tools/perf/builtin-lock.c | 6 +--
> > tools/perf/builtin-mem.c | 4 +-
> > tools/perf/builtin-sched.c | 6 +--
> > tools/perf/builtin-script.c | 30 ++++--------
> > tools/perf/builtin-stat.c | 4 +-
> > tools/perf/builtin-timechart.c | 2 +-
> > tools/perf/builtin-trace.c | 6 +--
> > tools/perf/perf.c | 12 ++---
> > .../shell/test_uprobe_from_different_cu.sh | 2 +-
> > tools/perf/tests/symbols.c | 2 +-
> > tools/perf/ui/browser.c | 2 +-
> > tools/perf/ui/browsers/scripts.c | 2 +-
> > tools/perf/ui/stdio/hist.c | 2 +-
> > tools/perf/util/amd-sample-raw.c | 4 +-
> > tools/perf/util/annotate.c | 2 +-
> > tools/perf/util/callchain.c | 2 +-
> > tools/perf/util/config.c | 12 ++---
> > tools/perf/util/map.c | 8 ++--
> > tools/perf/util/pmus.c | 2 +-
> > tools/perf/util/probe-event.c | 2 +-
> > tools/perf/util/sample-raw.c | 2 +-
> > tools/perf/util/symbol-elf.c | 4 +-
> > tools/perf/util/symbol.c | 3 +-
> > 39 files changed, 148 insertions(+), 117 deletions(-)
> >
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH V3 00/10] perf tools: Fix test "perf probe of function from different CU"
2024-07-10 7:39 ` Chaitanya S Prakash
2024-07-12 19:55 ` Namhyung Kim
@ 2024-07-15 9:34 ` James Clark
2024-07-15 9:35 ` James Clark
2024-07-15 10:27 ` James Clark
1 sibling, 2 replies; 6+ messages in thread
From: James Clark @ 2024-07-15 9:34 UTC (permalink / raw)
To: Chaitanya S Prakash, linux-perf-users, Arnaldo Carvalho de Melo,
Ian Rogers, Namhyung Kim
Cc: anshuman.khandual, Josh Poimboeuf, Suzuki K Poulose, Mike Leach,
John Garry, Will Deacon, Leo Yan, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Chenyuan Mi,
Masami Hiramatsu, Ravi Bangoria, Ahelenia Ziemiańska,
Colin Ian King, Changbin Du, Kan Liang, Athira Rajeev,
Tiezhu Yang, Alexey Dobriyan, Georg Müller, Liam Howlett,
bpf, coresight, linux-arm-kernel, linux-kernel, Peter Zijlstra,
Ingo Molnar
On 10/07/2024 8:39 am, Chaitanya S Prakash wrote:
> Gentle ping, are there any updates on the string clean up patch set?
>
> On 6/1/24 18:29, Chaitanya S Prakash wrote:
>> From: Chaitanya S Prakash <chaitanyas.prakash@arm.com>
>>
>> Perf treated all files beginning with "/tmp/perf-" as a map file despite
>> them always ending in ".map", this caused the test "perf probe of
>> function from different CU" to fail when Perf was built with NO_DWARF=1.
>> As the file was parsed as a map file, the probe...--funcs command output
>> garbage values instead of listing the functions in the binary. After
>> fixing the issue an additional check to test the output of the
>> probe...--funcs command has been added.
>>
>> Additionally, various functions within the codebase have been refactored
>> and restructured. The definition of str_has_suffix() has been adopted
>> from tools/bpf/bpftool/gen.c and added to tools/lib/string.c in an
>> attempt to make the function more generic. The implementation has been
>> retained but the return values have been modified to resemble that of
>> str_has_prefix(), i.e., return strlen(suffix) on success and 0 on
>> failure. In light of the new addition, "ends_with()", a locally defined
>> function used for checking if a string had a given suffix has been
>> deleted and str_has_suffix() has replaced its usage. A call to
>> strtailcmp() has also been replaced as str_has_suffix() seemed more
>> suited for that particular use case.
>>
>> Finally str_has_prefix() is adopted from the kernel and is added to
>> tools/lib/string.c, following which strstarts() is deleted and its use
>> has been replaced with str_has_prefix().
>>
>> This patch series has been tested on 6.10-rc1 mainline kernel, both on
>> arm64 and x86 platforms.
>>
>> Changes in V3:
>>
>> - Patch adding configs required by "perf probe of function from different
>> CU" was originally part of the series but has been merged in 6.10-rc1.
>>
>> https://github.com/torvalds/linux/commit/6b718ac6874c2233b8dec369a8a377d6c5b638e6
>>
>> - Restructure patches according to the maintainer trees.
>> - Add explanation for why '| grep "foo"' is used.
>> - Fix build errors for when perf is built with LLVM=1.
>>
>> Changes in V2:
>> https://lore.kernel.org/all/20240408062230.1949882-1-ChaitanyaS.Prakash@arm.com/
>>
>> - Add str_has_suffix() and str_has_prefix() to tools/lib/string.c
>> - Delete ends_with() and replace its usage with str_has_suffix()
>> - Replace an instance of strtailcmp() with str_has_suffix()
>> - Delete strstarts() from tools/include/linux/string.h and replace its
>> usage with str_has_prefix()
>>
>> Changes in V1:
>> https://lore.kernel.org/all/20240220042957.2022391-1-ChaitanyaS.Prakash@arm.com/
>>
>> Cc: Josh Poimboeuf <jpoimboe@kernel.org>
>> Cc: Peter Zijlstra <peterz@infradead.org>
>> Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
>> Cc: Mike Leach <mike.leach@linaro.org>
>> Cc: James Clark <james.clark@arm.com>
>> Cc: John Garry <john.g.garry@oracle.com>
>> Cc: Will Deacon <will@kernel.org>
>> Cc: Leo Yan <leo.yan@linaro.org>
>> Cc: Ingo Molnar <mingo@redhat.com>
>> Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
>> Cc: Namhyung Kim <namhyung@kernel.org>
>> Cc: Mark Rutland <mark.rutland@arm.com>
>> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
>> Cc: Jiri Olsa <jolsa@kernel.org>
>> Cc: Ian Rogers <irogers@google.com>
>> Cc: Adrian Hunter <adrian.hunter@intel.com>
>> Cc: Chenyuan Mi <cymi20@fudan.edu.cn>
>> Cc: Masami Hiramatsu <mhiramat@kernel.org>
>> Cc: Ravi Bangoria <ravi.bangoria@amd.com>
>> Cc: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
>> Cc: Colin Ian King <colin.i.king@gmail.com>
>> Cc: Changbin Du <changbin.du@huawei.com>
>> Cc: Kan Liang <kan.liang@linux.intel.com>
>> Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
>> Cc: Tiezhu Yang <yangtiezhu@loongson.cn>
>> Cc: Alexey Dobriyan <adobriyan@gmail.com>
>> Cc: Georg Müller <georgmueller@gmx.net>
>> Cc: Liam Howlett <liam.howlett@oracle.com>
>> Cc: bpf@vger.kernel.org
>> Cc: coresight@lists.linaro.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-kernel@vger.kernel.org
>> Cc: linux-perf-users@vger.kernel.org
>>
>> Chaitanya S Prakash (10):
>> tools lib: adopt str_has_suffix() from bpftool/gen.c
LGTM,
Reviewed-by: James Clark <james.clark@arm.com>
The below commit looked like it could be prone to an off by one error
but I debugged it to confirm that it's ok:
>> perf util: Delete ends_with() and replace its use with
>> str_has_suffix()
>> perf util: Replace an instance of strtailcmp() by str_has_suffix()
>> tools lib: Adopt str_has_prefix() from kernel
>> libsubcmd: Replace strstarts() usage with str_has_prefix()
>> objtool: Replace strstarts() usage with str_has_prefix()
>> perf tools: Replace strstarts() usage with str_has_prefix()
>> tools lib: Remove strstarts() as all its usecases have been replaced
>> by str_has_prefix()
>> perf tools: Only treat files as map files when they have the extension
>> .map
>> perf test: Check output of the probe ... --funcs command
>>
>> tools/include/linux/string.h | 12 ++---
>> tools/lib/string.c | 48 +++++++++++++++++++
>> tools/lib/subcmd/help.c | 2 +-
>> tools/lib/subcmd/parse-options.c | 18 +++----
>> tools/objtool/check.c | 2 +-
>> tools/perf/arch/arm/util/pmu.c | 4 +-
>> tools/perf/arch/x86/annotate/instructions.c | 14 +++---
>> tools/perf/arch/x86/util/env.c | 2 +-
>> tools/perf/builtin-c2c.c | 4 +-
>> tools/perf/builtin-config.c | 2 +-
>> tools/perf/builtin-daemon.c | 2 +-
>> tools/perf/builtin-ftrace.c | 2 +-
>> tools/perf/builtin-help.c | 6 +--
>> tools/perf/builtin-kmem.c | 2 +-
>> tools/perf/builtin-kvm.c | 14 +++---
>> tools/perf/builtin-kwork.c | 10 ++--
>> tools/perf/builtin-lock.c | 6 +--
>> tools/perf/builtin-mem.c | 4 +-
>> tools/perf/builtin-sched.c | 6 +--
>> tools/perf/builtin-script.c | 30 ++++--------
>> tools/perf/builtin-stat.c | 4 +-
>> tools/perf/builtin-timechart.c | 2 +-
>> tools/perf/builtin-trace.c | 6 +--
>> tools/perf/perf.c | 12 ++---
>> .../shell/test_uprobe_from_different_cu.sh | 2 +-
>> tools/perf/tests/symbols.c | 2 +-
>> tools/perf/ui/browser.c | 2 +-
>> tools/perf/ui/browsers/scripts.c | 2 +-
>> tools/perf/ui/stdio/hist.c | 2 +-
>> tools/perf/util/amd-sample-raw.c | 4 +-
>> tools/perf/util/annotate.c | 2 +-
>> tools/perf/util/callchain.c | 2 +-
>> tools/perf/util/config.c | 12 ++---
>> tools/perf/util/map.c | 8 ++--
>> tools/perf/util/pmus.c | 2 +-
>> tools/perf/util/probe-event.c | 2 +-
>> tools/perf/util/sample-raw.c | 2 +-
>> tools/perf/util/symbol-elf.c | 4 +-
>> tools/perf/util/symbol.c | 3 +-
>> 39 files changed, 148 insertions(+), 117 deletions(-)
>>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH V3 00/10] perf tools: Fix test "perf probe of function from different CU"
2024-07-15 9:34 ` James Clark
@ 2024-07-15 9:35 ` James Clark
2024-07-15 10:27 ` James Clark
1 sibling, 0 replies; 6+ messages in thread
From: James Clark @ 2024-07-15 9:35 UTC (permalink / raw)
To: Chaitanya S Prakash, linux-perf-users, Arnaldo Carvalho de Melo,
Ian Rogers, Namhyung Kim
Cc: anshuman.khandual, Josh Poimboeuf, Suzuki K Poulose, Mike Leach,
John Garry, Will Deacon, Leo Yan, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Chenyuan Mi,
Masami Hiramatsu, Ravi Bangoria, Ahelenia Ziemiańska,
Colin Ian King, Changbin Du, Kan Liang, Athira Rajeev,
Tiezhu Yang, Alexey Dobriyan, Georg Müller, Liam Howlett,
bpf, coresight, linux-arm-kernel, linux-kernel, Peter Zijlstra,
Ingo Molnar
On 15/07/2024 10:34 am, James Clark wrote:
>
>
> On 10/07/2024 8:39 am, Chaitanya S Prakash wrote:
>> Gentle ping, are there any updates on the string clean up patch set?
>>
>> On 6/1/24 18:29, Chaitanya S Prakash wrote:
>>> From: Chaitanya S Prakash <chaitanyas.prakash@arm.com>
>>>
>>> Perf treated all files beginning with "/tmp/perf-" as a map file despite
>>> them always ending in ".map", this caused the test "perf probe of
>>> function from different CU" to fail when Perf was built with NO_DWARF=1.
>>> As the file was parsed as a map file, the probe...--funcs command output
>>> garbage values instead of listing the functions in the binary. After
>>> fixing the issue an additional check to test the output of the
>>> probe...--funcs command has been added.
>>>
>>> Additionally, various functions within the codebase have been refactored
>>> and restructured. The definition of str_has_suffix() has been adopted
>>> from tools/bpf/bpftool/gen.c and added to tools/lib/string.c in an
>>> attempt to make the function more generic. The implementation has been
>>> retained but the return values have been modified to resemble that of
>>> str_has_prefix(), i.e., return strlen(suffix) on success and 0 on
>>> failure. In light of the new addition, "ends_with()", a locally defined
>>> function used for checking if a string had a given suffix has been
>>> deleted and str_has_suffix() has replaced its usage. A call to
>>> strtailcmp() has also been replaced as str_has_suffix() seemed more
>>> suited for that particular use case.
>>>
>>> Finally str_has_prefix() is adopted from the kernel and is added to
>>> tools/lib/string.c, following which strstarts() is deleted and its use
>>> has been replaced with str_has_prefix().
>>>
>>> This patch series has been tested on 6.10-rc1 mainline kernel, both on
>>> arm64 and x86 platforms.
>>>
>>> Changes in V3:
>>>
>>> - Patch adding configs required by "perf probe of function from
>>> different
>>> CU" was originally part of the series but has been merged in
>>> 6.10-rc1.
>>> https://github.com/torvalds/linux/commit/6b718ac6874c2233b8dec369a8a377d6c5b638e6
>>>
>>> - Restructure patches according to the maintainer trees.
>>> - Add explanation for why '| grep "foo"' is used.
>>> - Fix build errors for when perf is built with LLVM=1.
>>>
>>> Changes in V2:
>>> https://lore.kernel.org/all/20240408062230.1949882-1-ChaitanyaS.Prakash@arm.com/
>>>
>>> - Add str_has_suffix() and str_has_prefix() to tools/lib/string.c
>>> - Delete ends_with() and replace its usage with str_has_suffix()
>>> - Replace an instance of strtailcmp() with str_has_suffix()
>>> - Delete strstarts() from tools/include/linux/string.h and replace its
>>> usage with str_has_prefix()
>>>
>>> Changes in V1:
>>> https://lore.kernel.org/all/20240220042957.2022391-1-ChaitanyaS.Prakash@arm.com/
>>>
>>> Cc: Josh Poimboeuf <jpoimboe@kernel.org>
>>> Cc: Peter Zijlstra <peterz@infradead.org>
>>> Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
>>> Cc: Mike Leach <mike.leach@linaro.org>
>>> Cc: James Clark <james.clark@arm.com>
>>> Cc: John Garry <john.g.garry@oracle.com>
>>> Cc: Will Deacon <will@kernel.org>
>>> Cc: Leo Yan <leo.yan@linaro.org>
>>> Cc: Ingo Molnar <mingo@redhat.com>
>>> Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
>>> Cc: Namhyung Kim <namhyung@kernel.org>
>>> Cc: Mark Rutland <mark.rutland@arm.com>
>>> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
>>> Cc: Jiri Olsa <jolsa@kernel.org>
>>> Cc: Ian Rogers <irogers@google.com>
>>> Cc: Adrian Hunter <adrian.hunter@intel.com>
>>> Cc: Chenyuan Mi <cymi20@fudan.edu.cn>
>>> Cc: Masami Hiramatsu <mhiramat@kernel.org>
>>> Cc: Ravi Bangoria <ravi.bangoria@amd.com>
>>> Cc: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
>>> Cc: Colin Ian King <colin.i.king@gmail.com>
>>> Cc: Changbin Du <changbin.du@huawei.com>
>>> Cc: Kan Liang <kan.liang@linux.intel.com>
>>> Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
>>> Cc: Tiezhu Yang <yangtiezhu@loongson.cn>
>>> Cc: Alexey Dobriyan <adobriyan@gmail.com>
>>> Cc: Georg Müller <georgmueller@gmx.net>
>>> Cc: Liam Howlett <liam.howlett@oracle.com>
>>> Cc: bpf@vger.kernel.org
>>> Cc: coresight@lists.linaro.org
>>> Cc: linux-arm-kernel@lists.infradead.org
>>> Cc: linux-kernel@vger.kernel.org
>>> Cc: linux-perf-users@vger.kernel.org
>>>
>>> Chaitanya S Prakash (10):
>>> tools lib: adopt str_has_suffix() from bpftool/gen.c
>
> LGTM,
>
> Reviewed-by: James Clark <james.clark@arm.com>
>
> The below commit looked like it could be prone to an off by one error
> but I debugged it to confirm that it's ok:
>
>>> perf util: Delete ends_with() and replace its use with
>>> str_has_suffix()
>
There were some trivial merge conflicts though, so I'm not sure if it's
worth sending a new version out or not.
>>> perf util: Replace an instance of strtailcmp() by str_has_suffix()
>>> tools lib: Adopt str_has_prefix() from kernel
>>> libsubcmd: Replace strstarts() usage with str_has_prefix()
>>> objtool: Replace strstarts() usage with str_has_prefix()
>>> perf tools: Replace strstarts() usage with str_has_prefix()
>>> tools lib: Remove strstarts() as all its usecases have been replaced
>>> by str_has_prefix()
>>> perf tools: Only treat files as map files when they have the
>>> extension
>>> .map
>>> perf test: Check output of the probe ... --funcs command
>>>
>>> tools/include/linux/string.h | 12 ++---
>>> tools/lib/string.c | 48 +++++++++++++++++++
>>> tools/lib/subcmd/help.c | 2 +-
>>> tools/lib/subcmd/parse-options.c | 18 +++----
>>> tools/objtool/check.c | 2 +-
>>> tools/perf/arch/arm/util/pmu.c | 4 +-
>>> tools/perf/arch/x86/annotate/instructions.c | 14 +++---
>>> tools/perf/arch/x86/util/env.c | 2 +-
>>> tools/perf/builtin-c2c.c | 4 +-
>>> tools/perf/builtin-config.c | 2 +-
>>> tools/perf/builtin-daemon.c | 2 +-
>>> tools/perf/builtin-ftrace.c | 2 +-
>>> tools/perf/builtin-help.c | 6 +--
>>> tools/perf/builtin-kmem.c | 2 +-
>>> tools/perf/builtin-kvm.c | 14 +++---
>>> tools/perf/builtin-kwork.c | 10 ++--
>>> tools/perf/builtin-lock.c | 6 +--
>>> tools/perf/builtin-mem.c | 4 +-
>>> tools/perf/builtin-sched.c | 6 +--
>>> tools/perf/builtin-script.c | 30 ++++--------
>>> tools/perf/builtin-stat.c | 4 +-
>>> tools/perf/builtin-timechart.c | 2 +-
>>> tools/perf/builtin-trace.c | 6 +--
>>> tools/perf/perf.c | 12 ++---
>>> .../shell/test_uprobe_from_different_cu.sh | 2 +-
>>> tools/perf/tests/symbols.c | 2 +-
>>> tools/perf/ui/browser.c | 2 +-
>>> tools/perf/ui/browsers/scripts.c | 2 +-
>>> tools/perf/ui/stdio/hist.c | 2 +-
>>> tools/perf/util/amd-sample-raw.c | 4 +-
>>> tools/perf/util/annotate.c | 2 +-
>>> tools/perf/util/callchain.c | 2 +-
>>> tools/perf/util/config.c | 12 ++---
>>> tools/perf/util/map.c | 8 ++--
>>> tools/perf/util/pmus.c | 2 +-
>>> tools/perf/util/probe-event.c | 2 +-
>>> tools/perf/util/sample-raw.c | 2 +-
>>> tools/perf/util/symbol-elf.c | 4 +-
>>> tools/perf/util/symbol.c | 3 +-
>>> 39 files changed, 148 insertions(+), 117 deletions(-)
>>>
>>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH V3 00/10] perf tools: Fix test "perf probe of function from different CU"
2024-07-15 9:34 ` James Clark
2024-07-15 9:35 ` James Clark
@ 2024-07-15 10:27 ` James Clark
1 sibling, 0 replies; 6+ messages in thread
From: James Clark @ 2024-07-15 10:27 UTC (permalink / raw)
To: Chaitanya S Prakash, linux-perf-users, Arnaldo Carvalho de Melo,
Ian Rogers, Namhyung Kim
Cc: anshuman.khandual, Josh Poimboeuf, Suzuki K Poulose, Mike Leach,
John Garry, Will Deacon, Leo Yan, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Chenyuan Mi,
Masami Hiramatsu, Ravi Bangoria, Ahelenia Ziemiańska,
Colin Ian King, Changbin Du, Kan Liang, Athira Rajeev,
Tiezhu Yang, Alexey Dobriyan, Georg Müller, Liam Howlett,
bpf, coresight, linux-arm-kernel, linux-kernel, Peter Zijlstra,
Ingo Molnar
On 15/07/2024 10:34 am, James Clark wrote:
>
>
> On 10/07/2024 8:39 am, Chaitanya S Prakash wrote:
>> Gentle ping, are there any updates on the string clean up patch set?
>>
>> On 6/1/24 18:29, Chaitanya S Prakash wrote:
>>> From: Chaitanya S Prakash <chaitanyas.prakash@arm.com>
>>>
>>> Perf treated all files beginning with "/tmp/perf-" as a map file despite
>>> them always ending in ".map", this caused the test "perf probe of
>>> function from different CU" to fail when Perf was built with NO_DWARF=1.
>>> As the file was parsed as a map file, the probe...--funcs command output
>>> garbage values instead of listing the functions in the binary. After
>>> fixing the issue an additional check to test the output of the
>>> probe...--funcs command has been added.
>>>
>>> Additionally, various functions within the codebase have been refactored
>>> and restructured. The definition of str_has_suffix() has been adopted
>>> from tools/bpf/bpftool/gen.c and added to tools/lib/string.c in an
>>> attempt to make the function more generic. The implementation has been
>>> retained but the return values have been modified to resemble that of
>>> str_has_prefix(), i.e., return strlen(suffix) on success and 0 on
>>> failure. In light of the new addition, "ends_with()", a locally defined
>>> function used for checking if a string had a given suffix has been
>>> deleted and str_has_suffix() has replaced its usage. A call to
>>> strtailcmp() has also been replaced as str_has_suffix() seemed more
>>> suited for that particular use case.
>>>
>>> Finally str_has_prefix() is adopted from the kernel and is added to
>>> tools/lib/string.c, following which strstarts() is deleted and its use
>>> has been replaced with str_has_prefix().
>>>
>>> This patch series has been tested on 6.10-rc1 mainline kernel, both on
>>> arm64 and x86 platforms.
>>>
>>> Changes in V3:
>>>
>>> - Patch adding configs required by "perf probe of function from
>>> different
>>> CU" was originally part of the series but has been merged in
>>> 6.10-rc1.
>>> https://github.com/torvalds/linux/commit/6b718ac6874c2233b8dec369a8a377d6c5b638e6
>>>
>>> - Restructure patches according to the maintainer trees.
>>> - Add explanation for why '| grep "foo"' is used.
>>> - Fix build errors for when perf is built with LLVM=1.
>>>
>>> Changes in V2:
>>> https://lore.kernel.org/all/20240408062230.1949882-1-ChaitanyaS.Prakash@arm.com/
>>>
>>> - Add str_has_suffix() and str_has_prefix() to tools/lib/string.c
>>> - Delete ends_with() and replace its usage with str_has_suffix()
>>> - Replace an instance of strtailcmp() with str_has_suffix()
>>> - Delete strstarts() from tools/include/linux/string.h and replace its
>>> usage with str_has_prefix()
>>>
>>> Changes in V1:
>>> https://lore.kernel.org/all/20240220042957.2022391-1-ChaitanyaS.Prakash@arm.com/
>>>
>>> Cc: Josh Poimboeuf <jpoimboe@kernel.org>
>>> Cc: Peter Zijlstra <peterz@infradead.org>
>>> Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
>>> Cc: Mike Leach <mike.leach@linaro.org>
>>> Cc: James Clark <james.clark@arm.com>
>>> Cc: John Garry <john.g.garry@oracle.com>
>>> Cc: Will Deacon <will@kernel.org>
>>> Cc: Leo Yan <leo.yan@linaro.org>
>>> Cc: Ingo Molnar <mingo@redhat.com>
>>> Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
>>> Cc: Namhyung Kim <namhyung@kernel.org>
>>> Cc: Mark Rutland <mark.rutland@arm.com>
>>> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
>>> Cc: Jiri Olsa <jolsa@kernel.org>
>>> Cc: Ian Rogers <irogers@google.com>
>>> Cc: Adrian Hunter <adrian.hunter@intel.com>
>>> Cc: Chenyuan Mi <cymi20@fudan.edu.cn>
>>> Cc: Masami Hiramatsu <mhiramat@kernel.org>
>>> Cc: Ravi Bangoria <ravi.bangoria@amd.com>
>>> Cc: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
>>> Cc: Colin Ian King <colin.i.king@gmail.com>
>>> Cc: Changbin Du <changbin.du@huawei.com>
>>> Cc: Kan Liang <kan.liang@linux.intel.com>
>>> Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
>>> Cc: Tiezhu Yang <yangtiezhu@loongson.cn>
>>> Cc: Alexey Dobriyan <adobriyan@gmail.com>
>>> Cc: Georg Müller <georgmueller@gmx.net>
>>> Cc: Liam Howlett <liam.howlett@oracle.com>
>>> Cc: bpf@vger.kernel.org
>>> Cc: coresight@lists.linaro.org
>>> Cc: linux-arm-kernel@lists.infradead.org
>>> Cc: linux-kernel@vger.kernel.org
>>> Cc: linux-perf-users@vger.kernel.org
>>>
>>> Chaitanya S Prakash (10):
>>> tools lib: adopt str_has_suffix() from bpftool/gen.c
>
> LGTM,
>
> Reviewed-by: James Clark <james.clark@arm.com>
Reviewed-by: James Clark <james.clark@linaro.org>
Need to fix that...
>
> The below commit looked like it could be prone to an off by one error
> but I debugged it to confirm that it's ok:
>
>>> perf util: Delete ends_with() and replace its use with
>>> str_has_suffix()
>
>>> perf util: Replace an instance of strtailcmp() by str_has_suffix()
>>> tools lib: Adopt str_has_prefix() from kernel
>>> libsubcmd: Replace strstarts() usage with str_has_prefix()
>>> objtool: Replace strstarts() usage with str_has_prefix()
>>> perf tools: Replace strstarts() usage with str_has_prefix()
>>> tools lib: Remove strstarts() as all its usecases have been replaced
>>> by str_has_prefix()
>>> perf tools: Only treat files as map files when they have the
>>> extension
>>> .map
>>> perf test: Check output of the probe ... --funcs command
>>>
>>> tools/include/linux/string.h | 12 ++---
>>> tools/lib/string.c | 48 +++++++++++++++++++
>>> tools/lib/subcmd/help.c | 2 +-
>>> tools/lib/subcmd/parse-options.c | 18 +++----
>>> tools/objtool/check.c | 2 +-
>>> tools/perf/arch/arm/util/pmu.c | 4 +-
>>> tools/perf/arch/x86/annotate/instructions.c | 14 +++---
>>> tools/perf/arch/x86/util/env.c | 2 +-
>>> tools/perf/builtin-c2c.c | 4 +-
>>> tools/perf/builtin-config.c | 2 +-
>>> tools/perf/builtin-daemon.c | 2 +-
>>> tools/perf/builtin-ftrace.c | 2 +-
>>> tools/perf/builtin-help.c | 6 +--
>>> tools/perf/builtin-kmem.c | 2 +-
>>> tools/perf/builtin-kvm.c | 14 +++---
>>> tools/perf/builtin-kwork.c | 10 ++--
>>> tools/perf/builtin-lock.c | 6 +--
>>> tools/perf/builtin-mem.c | 4 +-
>>> tools/perf/builtin-sched.c | 6 +--
>>> tools/perf/builtin-script.c | 30 ++++--------
>>> tools/perf/builtin-stat.c | 4 +-
>>> tools/perf/builtin-timechart.c | 2 +-
>>> tools/perf/builtin-trace.c | 6 +--
>>> tools/perf/perf.c | 12 ++---
>>> .../shell/test_uprobe_from_different_cu.sh | 2 +-
>>> tools/perf/tests/symbols.c | 2 +-
>>> tools/perf/ui/browser.c | 2 +-
>>> tools/perf/ui/browsers/scripts.c | 2 +-
>>> tools/perf/ui/stdio/hist.c | 2 +-
>>> tools/perf/util/amd-sample-raw.c | 4 +-
>>> tools/perf/util/annotate.c | 2 +-
>>> tools/perf/util/callchain.c | 2 +-
>>> tools/perf/util/config.c | 12 ++---
>>> tools/perf/util/map.c | 8 ++--
>>> tools/perf/util/pmus.c | 2 +-
>>> tools/perf/util/probe-event.c | 2 +-
>>> tools/perf/util/sample-raw.c | 2 +-
>>> tools/perf/util/symbol-elf.c | 4 +-
>>> tools/perf/util/symbol.c | 3 +-
>>> 39 files changed, 148 insertions(+), 117 deletions(-)
>>>
>>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-07-15 10:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-01 12:59 [PATCH V3 00/10] perf tools: Fix test "perf probe of function from different CU" Chaitanya S Prakash
2024-07-10 7:39 ` Chaitanya S Prakash
2024-07-12 19:55 ` Namhyung Kim
2024-07-15 9:34 ` James Clark
2024-07-15 9:35 ` James Clark
2024-07-15 10:27 ` James Clark
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).