[PATCH -next V7 0/7] riscv: Optimize function trace

David Laight David.Laight at ACULAB.COM
Thu Feb 9 01:00:13 PST 2023


From: Guo Ren
> Sent: 09 February 2023 01:51
...
> Yours cost one more instruction, right?
>          addr-12  auipc
>          addr-8    jalr
>          addr-4    // Literal (32-bits)
>          addr+0   nop or jmp addr-n // one more?
>          addr+4   function_code

Yes, it is 4 bytes larger but there is one less
instruction executed (only one nop) when ftrace is disabled.
That probably matters more than anything in the ftrace
'prologue' code.

I also suspect that you can use a 32bit integer as
a table index in 64bit mode to save a word there.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


More information about the linux-riscv mailing list