lkml.org 
[lkml]   [2021]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH v1 1/4] arm64: Implement infrastructure for stack trace reliability checks
From
Date


On 4/1/21 10:27 AM, Mark Brown wrote:
> On Tue, Mar 30, 2021 at 02:09:52PM -0500, madvenka@linux.microsoft.com wrote:
>> From: "Madhavan T. Venkataraman" <madvenka@linux.microsoft.com>
>>
>> Implement a check_reliability() function that will contain checks for the
>> presence of various features and conditions that can render the stack trace
>> unreliable.
>
> This looks good to me with one minor stylistic thing:
>
>> +/*
>> + * Special functions where the stack trace is unreliable.
>> + */
>> +static struct function_range special_functions[] = {
>> + { 0, 0 }
>> +};
>
> Might be good to put a comment here saying that this is terminating the
> list rather than detecting a NULL function pointer:
>
> { /* sentinel */ }
>
> is a common idiom for that.
>
> Given that it's a fixed array we could also...
>
>> + for (func = special_functions; func->start; func++) {
>> + if (pc >= func->start && pc < func->end)
>
> ...do these as
>
> for (i = 0; i < ARRAY_SIZE(special_functions); i++)
>
> so you don't need something like that, though that gets awkward when you
> have to write out special_functions[i].field a lot.
>
> So many different potential colours for the bikeshed!
I will make the above changes.

Thanks!

Madhavan

\
 
 \ /
  Last update: 2021-04-01 20:08    [W:0.044 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site