[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZcNw-ek8s3AHxxCB@casper.infradead.org>
Date: Wed, 7 Feb 2024 12:00:57 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Miklos Szeredi <miklos@...redi.hu>
Cc: Jan Kara <jack@...e.cz>, lsf-pc <lsf-pc@...ts.linux-foundation.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [Lsf-pc] [LSF/MM/BPF TOPIC] tracing the source of errors
On Wed, Feb 07, 2024 at 12:23:41PM +0100, Miklos Szeredi wrote:
> On Wed, 7 Feb 2024 at 12:00, Jan Kara <jack@...e.cz> wrote:
>
> > The problem always has been how to implement this functionality in a
> > transparent way so the code does not become a mess. So if you have some
> > idea, I'd say go for it :)
>
> My first idea would be to wrap all instances of E* (e.g. ERR(E*)).
> But this could be made completely transparent by renaming current
> definition of E* to _E* and defining E* to be the wrapped ones.
> There's probably a catch (or several catches) somewhere, though.
To be perfectly clear, you're suggesting two things.
Option (a) change "all" code like this:
- ret = -EINVAL;
+ ret = -ERR(EINVAL);
where ERR would do some magic with __func__ and __LINE__.
Option (b)
-#define EINVAL 22
+#define E_INVAL 22
+#define EINVAL ERR(E_INVAL)
and then change all code that does something like:
if (err == -EINVAL)
to
if (err == -E_INVAL)
Or have I misunderstood?
Powered by blists - more mailing lists