[PATCH v1 0/4] perf: Remove libcrypto dependency

Yuzhuo Jing posted 4 patches 6 months, 3 weeks ago
There is a newer version of this series
tools/build/Makefile.feature            |   2 -
tools/build/feature/Makefile            |   4 -
tools/build/feature/test-all.c          |   5 -
tools/build/feature/test-libcrypto.c    |  25 -----
tools/include/linux/bitops.h            |  10 ++
tools/include/linux/compiler.h          |  17 ++++
tools/include/linux/string.h            |  22 +++++
tools/perf/Documentation/perf-check.txt |   1 -
tools/perf/Makefile.config              |  13 ---
tools/perf/Makefile.perf                |   3 -
tools/perf/builtin-check.c              |   1 -
tools/perf/tests/make                   |   4 +-
tools/perf/util/Build                   |   2 +
tools/perf/util/genelf.c                |  72 ++------------
tools/perf/util/sha1.c                  | 122 ++++++++++++++++++++++++
tools/perf/util/sha1.h                  |  41 ++++++++
tools/perf/util/sha1_base.h             | 103 ++++++++++++++++++++
tools/perf/util/sha1_generic.c          |  49 ++++++++++
18 files changed, 373 insertions(+), 123 deletions(-)
delete mode 100644 tools/build/feature/test-libcrypto.c
create mode 100644 tools/perf/util/sha1.c
create mode 100644 tools/perf/util/sha1.h
create mode 100644 tools/perf/util/sha1_base.h
create mode 100644 tools/perf/util/sha1_generic.c
[PATCH v1 0/4] perf: Remove libcrypto dependency
Posted by Yuzhuo Jing 6 months, 3 weeks ago
Currently, genelf.c is the only file in the perf tool that depends on
libcrypto (e.g. openssl), which only uses it to calculate a SHA1/MD5
Build ID.  This patch series pulls in the SHA1 implementation from the
kernel tree, and removes the libcrypto dependency from perf.  This also
switches the default Build ID calculation method from MD5 to the more
commonly used SHA1.

Yuzhuo Jing (4):
  perf utils: Add support functions for sha1 utils
  perf tools: Add sha1 utils
  perf genelf: Remove libcrypto dependency and use sha1 utils
  tools: Remove libcrypto dependency

 tools/build/Makefile.feature            |   2 -
 tools/build/feature/Makefile            |   4 -
 tools/build/feature/test-all.c          |   5 -
 tools/build/feature/test-libcrypto.c    |  25 -----
 tools/include/linux/bitops.h            |  10 ++
 tools/include/linux/compiler.h          |  17 ++++
 tools/include/linux/string.h            |  22 +++++
 tools/perf/Documentation/perf-check.txt |   1 -
 tools/perf/Makefile.config              |  13 ---
 tools/perf/Makefile.perf                |   3 -
 tools/perf/builtin-check.c              |   1 -
 tools/perf/tests/make                   |   4 +-
 tools/perf/util/Build                   |   2 +
 tools/perf/util/genelf.c                |  72 ++------------
 tools/perf/util/sha1.c                  | 122 ++++++++++++++++++++++++
 tools/perf/util/sha1.h                  |  41 ++++++++
 tools/perf/util/sha1_base.h             | 103 ++++++++++++++++++++
 tools/perf/util/sha1_generic.c          |  49 ++++++++++
 18 files changed, 373 insertions(+), 123 deletions(-)
 delete mode 100644 tools/build/feature/test-libcrypto.c
 create mode 100644 tools/perf/util/sha1.c
 create mode 100644 tools/perf/util/sha1.h
 create mode 100644 tools/perf/util/sha1_base.h
 create mode 100644 tools/perf/util/sha1_generic.c

-- 
2.49.0.1164.gab81da1b16-goog
Re: [PATCH v1 0/4] perf: Remove libcrypto dependency
Posted by Ian Rogers 6 months, 2 weeks ago
On Wed, May 21, 2025 at 3:54 PM Yuzhuo Jing <yuzhuo@google.com> wrote:
>
> Currently, genelf.c is the only file in the perf tool that depends on
> libcrypto (e.g. openssl), which only uses it to calculate a SHA1/MD5
> Build ID.  This patch series pulls in the SHA1 implementation from the
> kernel tree, and removes the libcrypto dependency from perf.  This also
> switches the default Build ID calculation method from MD5 to the more
> commonly used SHA1.
>
> Yuzhuo Jing (4):
>   perf utils: Add support functions for sha1 utils
>   perf tools: Add sha1 utils
>   perf genelf: Remove libcrypto dependency and use sha1 utils
>   tools: Remove libcrypto dependency

Tested-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

>  tools/build/Makefile.feature            |   2 -
>  tools/build/feature/Makefile            |   4 -
>  tools/build/feature/test-all.c          |   5 -
>  tools/build/feature/test-libcrypto.c    |  25 -----
>  tools/include/linux/bitops.h            |  10 ++
>  tools/include/linux/compiler.h          |  17 ++++
>  tools/include/linux/string.h            |  22 +++++
>  tools/perf/Documentation/perf-check.txt |   1 -
>  tools/perf/Makefile.config              |  13 ---
>  tools/perf/Makefile.perf                |   3 -
>  tools/perf/builtin-check.c              |   1 -
>  tools/perf/tests/make                   |   4 +-
>  tools/perf/util/Build                   |   2 +
>  tools/perf/util/genelf.c                |  72 ++------------
>  tools/perf/util/sha1.c                  | 122 ++++++++++++++++++++++++
>  tools/perf/util/sha1.h                  |  41 ++++++++
>  tools/perf/util/sha1_base.h             | 103 ++++++++++++++++++++
>  tools/perf/util/sha1_generic.c          |  49 ++++++++++
>  18 files changed, 373 insertions(+), 123 deletions(-)
>  delete mode 100644 tools/build/feature/test-libcrypto.c
>  create mode 100644 tools/perf/util/sha1.c
>  create mode 100644 tools/perf/util/sha1.h
>  create mode 100644 tools/perf/util/sha1_base.h
>  create mode 100644 tools/perf/util/sha1_generic.c
>
> --
> 2.49.0.1164.gab81da1b16-goog
>
Re: [PATCH v1 0/4] perf: Remove libcrypto dependency
Posted by Arnaldo Carvalho de Melo 6 months, 2 weeks ago
On Thu, May 29, 2025 at 12:31:59PM -0700, Ian Rogers wrote:
> On Wed, May 21, 2025 at 3:54 PM Yuzhuo Jing <yuzhuo@google.com> wrote:
> >
> > Currently, genelf.c is the only file in the perf tool that depends on
> > libcrypto (e.g. openssl), which only uses it to calculate a SHA1/MD5
> > Build ID.  This patch series pulls in the SHA1 implementation from the
> > kernel tree, and removes the libcrypto dependency from perf.  This also
> > switches the default Build ID calculation method from MD5 to the more
> > commonly used SHA1.
> >
> > Yuzhuo Jing (4):
> >   perf utils: Add support functions for sha1 utils
> >   perf tools: Add sha1 utils
> >   perf genelf: Remove libcrypto dependency and use sha1 utils
> >   tools: Remove libcrypto dependency
> 
> Tested-by: Ian Rogers <irogers@google.com>

I reported a problem with some integer comparision, the code is the same
as is in the kernel, so I left it for later to continue analysis, if
someone can try to continue from where I left, that could help.

But then this can be left for the v6.17 as we're already in the merge
window for v6.16 and we need to have some time for what is in
perf-tools-next to sit in linux-next before sending to Linus.

- Arnaldo