[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <00d978e4cf484fecb907a7035201c975@AcuMS.aculab.com>
Date: Wed, 14 Apr 2021 22:15:30 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Andrii Nakryiko' <andrii@...nel.org>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"ast@...com" <ast@...com>,
"daniel@...earbox.net" <daniel@...earbox.net>
CC: "kernel-team@...com" <kernel-team@...com>
Subject: RE: [PATCH bpf-next 13/17] selftests/bpf: use -O0 instead of -Og in
selftests builds
From: Andrii Nakryiko
> Sent: 14 April 2021 21:02
>
> While -Og is designed to work well with debugger, it's still inferior to -O0
> in terms of debuggability experience. It will cause some variables to still be
> inlined, it will also prevent single-stepping some statements and otherwise
> interfere with debugging experience. So switch to -O0 which turns off any
> optimization and provides the best debugging experience.
Surely the selftests need to use the normal compiler options
so the compiler is generating the same type of code.
Otherwise you are likely to miss out some instructions completely.
For normal code I actually prefer using -O2 when dubugging.
If/when you need to look at the generated code you can see
the wood for the trees, with -O0 the code is typically
full of memory read/write to/from the stack.
About the only annoying thing is tail-calls.
They can get confusing.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists