[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE-0n52cX0qhTWdNtJEvy_GUEbXonf9LgmU253Rn8xTehj5OKg@mail.gmail.com>
Date: Wed, 8 May 2024 17:35:53 -0400
From: Stephen Boyd <swboyd@...omium.org>
To: Alexis Lothoré <alexis.lothore@...tlin.com>,
Konstantin Khlebnikov <koct9i@...il.com>, Luca Ceresoli <luca.ceresoli@...tlin.com>,
Sasha Levin <sashal@...nel.org>, Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] scripts/decode_stacktrace.sh: remove find_module
recursion and improve error reporting
Quoting Luca Ceresoli (2024-03-11 08:24:54)
> The find_module() function can fail for two reasons:
>
> * the module was not found
> * the module was found but without debugging info
>
> In both cases the user is reported the same error:
>
> WARNING! Modules path isn't set, but is needed to parse this symbol
>
> This is misleading in case the modules path is set correctly.
>
> find_module() is currently implemented as a recursive function based on
> global variables in order to check up to 4 different paths. This is not
> straightforward to read and even less to modify.
>
> Besides, the debuginfod code at the beginning of find_module() is executed
> identlcally every time the function is entered, i.e. up to 4 times per each
s/identlcally/identically/
> module search due to recursion.
>
> To be able to improve error reporting, first rewrite the find_module()
> function to remove recursion. The new version of the function iterates over
> all the same (up to 4) paths as before and for each of them does the same
> checks as before. At the end of the iteration it is now able to print an
> appropriate error message, so that has been moved from the caller into
> find_module().
>
> Finally, when the module is found but without debugging info, mention the
> two Kconfig variables one needs to set in order to have the needed
> debugging symbols.
>
> Signed-off-by: Luca Ceresoli <luca.ceresoli@...tlin.com>
> ---
Reviewed-by: Stephen Boyd <swboyd@...omium.org>
Powered by blists - more mailing lists