linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	 Jiri Olsa <jolsa@kernel.org>,
	linux-perf-users@vger.kernel.org,
	 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] perf beauty: Don't use 'find ... -printf' as it isn't available in busybox
Date: Thu, 30 Nov 2023 14:12:08 -0800	[thread overview]
Message-ID: <CAM9d7chi4OQRZRpbNnHFwJ6Esfr+P3b6FQBmHiqU9HXcp8+HLw@mail.gmail.com> (raw)
In-Reply-To: <ZWkEeqdmCHMLhLr2@kernel.org>

Hi Arnaldo,

On Thu, Nov 30, 2023 at 1:54 PM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> Namhyung reported:
>
>   I'm seeing a build error on my Alpine linux image which uses busybox +
>   musl libc:
>
>     In file included from trace/beauty/arch_errno_names.c:1,
>                      from builtin-trace.c:899:
>     /build/trace/beauty/generated/arch_errno_name_array.c: In function 'arch_syscalls__strerrno':
>     /build/trace/beauty/generated/arch_errno_name_array.c:142:49: error: unused parameter 'arch' [-Werror=unused-parameter]
>       142 | const char *arch_syscalls__strerrno(const char *arch, int err)
>
>   It looks like busybox find command doesn't have -printf option
>
>     find: unrecognized: -printf
>     , Yesterday 9:16 PM
>     ,
>     BusyBox v1.36.1 (2023-07-27 17:12:24 UTC) multi-call binary.
>
>     Usage: find [-HL] [PATH]... [OPTIONS] [ACTIONS]
>
>     Search for files and perform actions on them.
>     First failed action stops processing of current file.
>     Defaults: PATH is current directory, action is '-print'
>
> So just remove it and pipe find's entry to a basename loop to produce
> the same result.
>
> Fixes: 0337cf74ccf2a434 ("perf util: Introduce architecture specific errno/name mapping")
> Reported-by: Namhyung Kim <namhyung@kernel.org>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
> Cc: Ian Rogers <irogers@google.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Michael Petlan <mpetlan@redhat.com>
> Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Thanks for the fix!

Tested-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> ---
>  tools/perf/trace/beauty/arch_errno_names.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/trace/beauty/arch_errno_names.sh b/tools/perf/trace/beauty/arch_errno_names.sh
> index cc09dcaa891e04bb..3ec8781344db13ba 100755
> --- a/tools/perf/trace/beauty/arch_errno_names.sh
> +++ b/tools/perf/trace/beauty/arch_errno_names.sh
> @@ -76,7 +76,7 @@ EoHEADER
>
>  # Create list of architectures that have a specific errno.h.
>  archlist=""
> -for arch in $(find $toolsdir/arch -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | sort -r); do
> +for arch in $(find $toolsdir/arch -maxdepth 1 -mindepth 1 -type d | while read arch ; do basename $arch ; done | sort -r); do
>         test -f $toolsdir/arch/$arch/include/uapi/asm/errno.h && archlist="$archlist $arch"
>  done
>
> --
> 2.41.0
>

  reply	other threads:[~2023-11-30 22:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-30 21:54 [PATCH 1/1] perf beauty: Don't use 'find ... -printf' as it isn't available in busybox Arnaldo Carvalho de Melo
2023-11-30 22:12 ` Namhyung Kim [this message]
2023-12-01 12:05 ` David Laight
2023-12-01 17:01   ` Arnaldo Carvalho de Melo
2023-12-01 17:16     ` David Laight

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAM9d7chi4OQRZRpbNnHFwJ6Esfr+P3b6FQBmHiqU9HXcp8+HLw@mail.gmail.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).