[PATCH 1/3] benchtests: Add IPv4 inet_ntop benchmark

Collin Funk collin.funk1@gmail.com
Tue Jun 3 22:13:12 GMT 2025


Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:

> Random IP addresses in the full range.
> ---
>  benchtests/Makefile                |    5 +
>  benchtests/inet_ntop_ipv4-inputs   | 1003 ++++++++++++++++++++++++++++
>  benchtests/inet_ntop_ipv4-source.c |   10 +
>  3 files changed, 1018 insertions(+)
>  create mode 100644 benchtests/inet_ntop_ipv4-inputs
>  create mode 100644 benchtests/inet_ntop_ipv4-source.c
>
> diff --git a/benchtests/Makefile b/benchtests/Makefile
> index 5470be7f40..fd4ed5270c 100644
> --- a/benchtests/Makefile
> +++ b/benchtests/Makefile
> @@ -159,6 +159,10 @@ bench-pthread := \
>    thread_create \
>    # bench-pthread
>  
> +bench-resolv := \
> +  inet_ntop_ipv4 \
> +  # bench-resolv
> +
>  LDLIBS-bench-pthread-mutex-lock += -lm
>  LDLIBS-bench-pthread-mutex-trylock += -lm
>  LDLIBS-bench-pthread-spin-lock += -lm
> @@ -418,6 +422,7 @@ ifeq (${BENCHSET},)
>  bench := \
>    $(bench-math) \
>    $(bench-pthread) \
> +  $(bench-resolv) \
>    $(bench-string) \
>    # bench
>  else

Shouldn't bench-resolv be added to VALIDBENCHSETNAMES? I expected the
following to work:

    $ make bench BENCHSET='bench-resolv'
    make -C /home/collin/.local/src/glibc/benchtests  objdir=`pwd` bench
    make[1]: Entering directory '/home/collin/.local/src/glibc/benchtests'
    The following values in BENCHSET are invalid: bench-resolv
    The valid ones are: bench-math bench-pthread bench-string calloc-simple calloc-tcache calloc-thread hash-benchset malloc-simple malloc-tcache malloc-thread math-benchset stdio-benchset stdio-common-benchset stdlib-benchset string-benchset wcsmbs-benchset 
    Makefile:485: *** Invalid BENCHSET value.  Stop.
    make[1]: Leaving directory '/home/collin/.local/src/glibc/benchtests'
    make: *** [Makefile:40: bench] Error 2

Thanks,
Collin


More information about the Libc-alpha mailing list