Re: [linux-yocto] [PATCH] perf: Alias SYS_futex with SYS_futex_time64 on 32-bit arches with 64bit time_t

2020-11-16 Thread Alistair Francis
On Mon, Nov 16, 2020 at 11:07 AM Khem Raj  wrote:
>
> glibc does not define SYS_futex for 32bit architectures using 64bit
> time_t e.g. riscv32, therefore perf fails to compile as it does not find
> SYS_futex in C library headers, define it to SYS_futex_time64 when it
> exists
>
> Upstream-Status: Pending
> Signed-off-by: Khem Raj 

Reviewed-by: Alistair Francis 

Alistair

> ---
>  tools/perf/bench/futex.h | 13 +
>  1 file changed, 13 insertions(+)
>
> diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h
> index 31b53cc7d5bc..33f3f3230ae1 100644
> --- a/tools/perf/bench/futex.h
> +++ b/tools/perf/bench/futex.h
> @@ -13,6 +13,19 @@
>  #include 
>  #include 
>
> +/**
> + * SYS_futex is expected from system C library,
> + * in glibc (/usr/include/bits/syscall.h defines it in terms of of NR_futex)
> + * some newer 32bit architectures e.g. RISCV32 is using 64bit time_t from
> + * get go unlike other 32bit architectures in glibc, therefore it wont have
> + * NR_futex defined but just NR_futex_time64 this aliases it to NR_futex
> + * so that SYS_futex is then defined for rv32
> +*/
> +
> +#if !defined(SYS_futex) && defined(SYS_futex_time64)
> +#define SYS_futex SYS_futex_time64
> +#endif
> +
>  /**
>   * futex() - SYS_futex syscall wrapper
>   * @uaddr: address of first futex
> --
> 2.29.2
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9164): 
https://lists.yoctoproject.org/g/linux-yocto/message/9164
Mute This Topic: https://lists.yoctoproject.org/mt/78299646/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [linux-yocto] [PATCH] perf: Alias SYS_futex with SYS_futex_time64 on 32-bit arches with 64bit time_t

2020-11-16 Thread Bruce Ashfield
On Mon, Nov 16, 2020 at 2:07 PM Khem Raj  wrote:

> glibc does not define SYS_futex for 32bit architectures using 64bit
> time_t e.g. riscv32, therefore perf fails to compile as it does not find
> SYS_futex in C library headers, define it to SYS_futex_time64 when it
> exists
>

I've queued this on linux-yocto.

But which versions were you interested in ? I did -dev and 5.8.

Bruce



>
> Upstream-Status: Pending
> Signed-off-by: Khem Raj 
> ---
>  tools/perf/bench/futex.h | 13 +
>  1 file changed, 13 insertions(+)
>
> diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h
> index 31b53cc7d5bc..33f3f3230ae1 100644
> --- a/tools/perf/bench/futex.h
> +++ b/tools/perf/bench/futex.h
> @@ -13,6 +13,19 @@
>  #include 
>  #include 
>
> +/**
> + * SYS_futex is expected from system C library,
> + * in glibc (/usr/include/bits/syscall.h defines it in terms of of
> NR_futex)
> + * some newer 32bit architectures e.g. RISCV32 is using 64bit time_t from
> + * get go unlike other 32bit architectures in glibc, therefore it wont
> have
> + * NR_futex defined but just NR_futex_time64 this aliases it to NR_futex
> + * so that SYS_futex is then defined for rv32
> +*/
> +
> +#if !defined(SYS_futex) && defined(SYS_futex_time64)
> +#define SYS_futex SYS_futex_time64
> +#endif
> +
>  /**
>   * futex() - SYS_futex syscall wrapper
>   * @uaddr: address of first futex
> --
> 2.29.2
>
>

-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9165): 
https://lists.yoctoproject.org/g/linux-yocto/message/9165
Mute This Topic: https://lists.yoctoproject.org/mt/78299646/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [linux-yocto] [PATCH] perf: Alias SYS_futex with SYS_futex_time64 on 32-bit arches with 64bit time_t

2020-11-16 Thread Khem Raj
Hi Bruce

Thanks, I am interested in 5.8 onwards. since that's what is in
master. Perhaps will be good to have it in dunfell versions too, but
don't sweat over it.

On Mon, Nov 16, 2020 at 5:13 PM Bruce Ashfield  wrote:
>
>
>
> On Mon, Nov 16, 2020 at 2:07 PM Khem Raj  wrote:
>>
>> glibc does not define SYS_futex for 32bit architectures using 64bit
>> time_t e.g. riscv32, therefore perf fails to compile as it does not find
>> SYS_futex in C library headers, define it to SYS_futex_time64 when it
>> exists
>
>
> I've queued this on linux-yocto.
>
> But which versions were you interested in ? I did -dev and 5.8.
>
> Bruce
>
>
>>
>>
>> Upstream-Status: Pending
>> Signed-off-by: Khem Raj 
>> ---
>>  tools/perf/bench/futex.h | 13 +
>>  1 file changed, 13 insertions(+)
>>
>> diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h
>> index 31b53cc7d5bc..33f3f3230ae1 100644
>> --- a/tools/perf/bench/futex.h
>> +++ b/tools/perf/bench/futex.h
>> @@ -13,6 +13,19 @@
>>  #include 
>>  #include 
>>
>> +/**
>> + * SYS_futex is expected from system C library,
>> + * in glibc (/usr/include/bits/syscall.h defines it in terms of of NR_futex)
>> + * some newer 32bit architectures e.g. RISCV32 is using 64bit time_t from
>> + * get go unlike other 32bit architectures in glibc, therefore it wont have
>> + * NR_futex defined but just NR_futex_time64 this aliases it to NR_futex
>> + * so that SYS_futex is then defined for rv32
>> +*/
>> +
>> +#if !defined(SYS_futex) && defined(SYS_futex_time64)
>> +#define SYS_futex SYS_futex_time64
>> +#endif
>> +
>>  /**
>>   * futex() - SYS_futex syscall wrapper
>>   * @uaddr: address of first futex
>> --
>> 2.29.2
>>
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await thee at 
> its end
> - "Use the force Harry" - Gandalf, Star Trek II
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9166): 
https://lists.yoctoproject.org/g/linux-yocto/message/9166
Mute This Topic: https://lists.yoctoproject.org/mt/78299646/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-