Re: [PATCH v2 05/18] gpiolib: cdev: support GPIO_GET_LINE_IOCTL and GPIOLINE_GET_VALUES_IOCTL
From: Bartosz Golaszewski
Date: Mon Aug 03 2020 - 15:59:41 EST
On Sun, Aug 2, 2020 at 11:32 AM Kent Gibson <warthog618@xxxxxxxxx> wrote:
>
> On Sun, Aug 02, 2020 at 11:31:58AM +0800, Kent Gibson wrote:
> > On Fri, Jul 31, 2020 at 06:05:10PM +0200, Bartosz Golaszewski wrote:
> > > On Sun, Jul 26, 2020 at 3:12 AM Kent Gibson <warthog618@xxxxxxxxx> wrote:
> > > >
> > >
> > > > >
> > > > > > + dev_dbg(&gdev->dev, "registered chardev handle for line %d\n",
> > > > > > + offset);
> > > > >
> > > > > Perhaps tracepoint / event?
> > > > >
> > > >
> > > > Again, a cut-and-paste from V1, and I have no experience with
> > > > tracepoints or events, so I have no opinion on that.
> > > >
> > > > So, yeah - perhaps?
> > > >
> > >
> > > I think it's a good idea to add some proper instrumentation this time
> > > other than much less reliable logs. Can you take a look at
> > > include/trace/events/gpio.h? Adding new GPIO trace events should be
> > > pretty straightforward by copy-pasti... drawing inspiration from
> > > existing ones.
> > >
> >
> > You only want tracepoints to replace those dev_dbg()s, so when a line
> > is requested? What about the release? Any other points?
> >
>
> Had a closer look and it seems to me that the correct place to add such
> tracepoints would be gpiod_request() and gpiod_free(), so they catch all
> requests, not just the cdev ones. And that moves it outside the scope
> of this patch.
>
> I personally don't have any use for the dev_dbg()s here and am happy to
> remove them - they were only there to match the behaviour of
> linehandle_create as closely as possible.
>
Sounds good, we can work on trace points separately.
Bartosz