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

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Wed Jun 4 13:47:01 GMT 2025



On 03/06/25 19:13, Collin Funk wrote:
> 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

It makes sense, I will add it.


More information about the Libc-alpha mailing list