mbox series

[v3,0/3] IB CM tracepoints

Message ID 159767229823.2968.6482101365744305238.stgit@klimt.1015granger.net (mailing list archive)
Headers show
Series IB CM tracepoints | expand

Message

Chuck Lever III Aug. 17, 2020, 1:53 p.m. UTC
Oracle has an interest in a common observability infrastructure in
the RDMA core and ULPs. Introduce static tracepoints that can also
be used as hooks for eBPF scripts, replacing infrastructure that
is based on printk. This takes the same approach as tracepoints
added recently in the RDMA CM.

Change since v2:
* Rebase on v5.9-rc1

Changes since RFC:
* Correct spelling of example tracepoint in patch description
* Newer tool chains don't care for tracepoints with the same name
 in different subsystems
* Display ib_cm_events, not ib_events

---

Chuck Lever (3):
      RDMA/core: Move the rdma_show_ib_cm_event() macro
      RDMA/cm: Replace pr_debug() call sites with tracepoints
      RDMA/cm: Add tracepoints to track MAD send operations


 drivers/infiniband/core/Makefile   |   2 +-
 drivers/infiniband/core/cm.c       | 102 ++++---
 drivers/infiniband/core/cm_trace.c |  15 ++
 drivers/infiniband/core/cm_trace.h | 414 +++++++++++++++++++++++++++++
 4 files changed, 476 insertions(+), 57 deletions(-)
 create mode 100644 drivers/infiniband/core/cm_trace.c
 create mode 100644 drivers/infiniband/core/cm_trace.h

--
Chuck Lever

Comments

Jason Gunthorpe Aug. 24, 2020, 5:42 p.m. UTC | #1
On Mon, Aug 17, 2020 at 09:53:05AM -0400, Chuck Lever wrote:
> Oracle has an interest in a common observability infrastructure in
> the RDMA core and ULPs. Introduce static tracepoints that can also
> be used as hooks for eBPF scripts, replacing infrastructure that
> is based on printk. This takes the same approach as tracepoints
> added recently in the RDMA CM.
> 
> Change since v2:
> * Rebase on v5.9-rc1
> 
> Changes since RFC:
> * Correct spelling of example tracepoint in patch description
> * Newer tool chains don't care for tracepoints with the same name
>  in different subsystems
> * Display ib_cm_events, not ib_events

Doesn't compile:

In file included from drivers/infiniband/core/cm_trace.h:414,
                 from drivers/infiniband/core/cm_trace.c:15:
./include/trace/define_trace.h:95:42: fatal error: ./cm_trace.h: No such file or directory
   95 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
      |                                          ^
compilation terminated.

Jason
Chuck Lever III Aug. 24, 2020, 5:43 p.m. UTC | #2
> On Aug 24, 2020, at 1:42 PM, Jason Gunthorpe <jgg@nvidia.com> wrote:
> 
> On Mon, Aug 17, 2020 at 09:53:05AM -0400, Chuck Lever wrote:
>> Oracle has an interest in a common observability infrastructure in
>> the RDMA core and ULPs. Introduce static tracepoints that can also
>> be used as hooks for eBPF scripts, replacing infrastructure that
>> is based on printk. This takes the same approach as tracepoints
>> added recently in the RDMA CM.
>> 
>> Change since v2:
>> * Rebase on v5.9-rc1
>> 
>> Changes since RFC:
>> * Correct spelling of example tracepoint in patch description
>> * Newer tool chains don't care for tracepoints with the same name
>> in different subsystems
>> * Display ib_cm_events, not ib_events
> 
> Doesn't compile:
> 
> In file included from drivers/infiniband/core/cm_trace.h:414,
>                 from drivers/infiniband/core/cm_trace.c:15:
> ./include/trace/define_trace.h:95:42: fatal error: ./cm_trace.h: No such file or directory
>   95 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
>      |                                          ^
> compilation terminated.

I've been using these patches for several weeks, so WFM.
I'll have a look.


--
Chuck Lever
Chuck Lever III Aug. 24, 2020, 6:24 p.m. UTC | #3
> On Aug 24, 2020, at 1:42 PM, Jason Gunthorpe <jgg@nvidia.com> wrote:
> 
> On Mon, Aug 17, 2020 at 09:53:05AM -0400, Chuck Lever wrote:
>> Oracle has an interest in a common observability infrastructure in
>> the RDMA core and ULPs. Introduce static tracepoints that can also
>> be used as hooks for eBPF scripts, replacing infrastructure that
>> is based on printk. This takes the same approach as tracepoints
>> added recently in the RDMA CM.
>> 
>> Change since v2:
>> * Rebase on v5.9-rc1
>> 
>> Changes since RFC:
>> * Correct spelling of example tracepoint in patch description
>> * Newer tool chains don't care for tracepoints with the same name
>> in different subsystems
>> * Display ib_cm_events, not ib_events
> 
> Doesn't compile:
> 
> In file included from drivers/infiniband/core/cm_trace.h:414,
>                 from drivers/infiniband/core/cm_trace.c:15:
> ./include/trace/define_trace.h:95:42: fatal error: ./cm_trace.h: No such file or directory
>   95 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
>      |                                          ^
> compilation terminated.

I am not able to reproduce this failure.

gcc (GCC) 10.1.1 20200507 (Red Hat 10.1.1-1)

What if you edit drivers/infiniband/core/cm_trace.h and
change the definition of TRACE_INCLUDE_PATH from "." to
"../../drivers/infiniband/core" ?


--
Chuck Lever
Jason Gunthorpe Aug. 24, 2020, 9:56 p.m. UTC | #4
On Mon, Aug 24, 2020 at 02:24:40PM -0400, Chuck Lever wrote:
> 
> 
> > On Aug 24, 2020, at 1:42 PM, Jason Gunthorpe <jgg@nvidia.com> wrote:
> > 
> > On Mon, Aug 17, 2020 at 09:53:05AM -0400, Chuck Lever wrote:
> >> Oracle has an interest in a common observability infrastructure in
> >> the RDMA core and ULPs. Introduce static tracepoints that can also
> >> be used as hooks for eBPF scripts, replacing infrastructure that
> >> is based on printk. This takes the same approach as tracepoints
> >> added recently in the RDMA CM.
> >> 
> >> Change since v2:
> >> * Rebase on v5.9-rc1
> >> 
> >> Changes since RFC:
> >> * Correct spelling of example tracepoint in patch description
> >> * Newer tool chains don't care for tracepoints with the same name
> >> in different subsystems
> >> * Display ib_cm_events, not ib_events
> > 
> > Doesn't compile:
> > 
> > In file included from drivers/infiniband/core/cm_trace.h:414,
> >                 from drivers/infiniband/core/cm_trace.c:15:
> > ./include/trace/define_trace.h:95:42: fatal error: ./cm_trace.h: No such file or directory
> >   95 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
> >      |                                          ^
> > compilation terminated.
> 
> I am not able to reproduce this failure.
> 
> gcc (GCC) 10.1.1 20200507 (Red Hat 10.1.1-1)

Yep, using gcc 10 too

Start from a clean tree?
 
> What if you edit drivers/infiniband/core/cm_trace.h and
> change the definition of TRACE_INCLUDE_PATH from "." to
> "../../drivers/infiniband/core" ?

It works

It is because ./ is relative to include/trace/define_trace.h ?
 
Jason
Chuck Lever III Aug. 24, 2020, 10:30 p.m. UTC | #5
> On Aug 24, 2020, at 5:56 PM, Jason Gunthorpe <jgg@nvidia.com> wrote:
> 
> On Mon, Aug 24, 2020 at 02:24:40PM -0400, Chuck Lever wrote:
>> 
>> 
>>> On Aug 24, 2020, at 1:42 PM, Jason Gunthorpe <jgg@nvidia.com> wrote:
>>> 
>>> On Mon, Aug 17, 2020 at 09:53:05AM -0400, Chuck Lever wrote:
>>>> Oracle has an interest in a common observability infrastructure in
>>>> the RDMA core and ULPs. Introduce static tracepoints that can also
>>>> be used as hooks for eBPF scripts, replacing infrastructure that
>>>> is based on printk. This takes the same approach as tracepoints
>>>> added recently in the RDMA CM.
>>>> 
>>>> Change since v2:
>>>> * Rebase on v5.9-rc1
>>>> 
>>>> Changes since RFC:
>>>> * Correct spelling of example tracepoint in patch description
>>>> * Newer tool chains don't care for tracepoints with the same name
>>>> in different subsystems
>>>> * Display ib_cm_events, not ib_events
>>> 
>>> Doesn't compile:
>>> 
>>> In file included from drivers/infiniband/core/cm_trace.h:414,
>>>                from drivers/infiniband/core/cm_trace.c:15:
>>> ./include/trace/define_trace.h:95:42: fatal error: ./cm_trace.h: No such file or directory
>>>  95 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
>>>     |                                          ^
>>> compilation terminated.
>> 
>> I am not able to reproduce this failure.
>> 
>> gcc (GCC) 10.1.1 20200507 (Red Hat 10.1.1-1)
> 
> Yep, using gcc 10 too
> 
> Start from a clean tree?

Always.


>> What if you edit drivers/infiniband/core/cm_trace.h and
>> change the definition of TRACE_INCLUDE_PATH from "." to
>> "../../drivers/infiniband/core" ?
> 
> It works
> 
> It is because ./ is relative to include/trace/define_trace.h ?

Yes.

It appears that the many instances of "#define TRACE_INCLUDE_PATH ."
already in the kernel are each accompanied by Makefile magic to make
that work correctly. I neglected (again) to add that.

But now that I've read the instructions in include/trace/define_trace.h,
I prefer using a full relative path instead of "."-with-Makefile.

Do I need to send a v4?

--
Chuck Lever
Jason Gunthorpe Aug. 24, 2020, 10:40 p.m. UTC | #6
On Mon, Aug 24, 2020 at 06:30:11PM -0400, Chuck Lever wrote:
> 
> 
> > On Aug 24, 2020, at 5:56 PM, Jason Gunthorpe <jgg@nvidia.com> wrote:
> > 
> > On Mon, Aug 24, 2020 at 02:24:40PM -0400, Chuck Lever wrote:
> >> 
> >> 
> >>> On Aug 24, 2020, at 1:42 PM, Jason Gunthorpe <jgg@nvidia.com> wrote:
> >>> 
> >>> On Mon, Aug 17, 2020 at 09:53:05AM -0400, Chuck Lever wrote:
> >>>> Oracle has an interest in a common observability infrastructure in
> >>>> the RDMA core and ULPs. Introduce static tracepoints that can also
> >>>> be used as hooks for eBPF scripts, replacing infrastructure that
> >>>> is based on printk. This takes the same approach as tracepoints
> >>>> added recently in the RDMA CM.
> >>>> 
> >>>> Change since v2:
> >>>> * Rebase on v5.9-rc1
> >>>> 
> >>>> Changes since RFC:
> >>>> * Correct spelling of example tracepoint in patch description
> >>>> * Newer tool chains don't care for tracepoints with the same name
> >>>> in different subsystems
> >>>> * Display ib_cm_events, not ib_events
> >>> 
> >>> Doesn't compile:
> >>> 
> >>> In file included from drivers/infiniband/core/cm_trace.h:414,
> >>>                from drivers/infiniband/core/cm_trace.c:15:
> >>> ./include/trace/define_trace.h:95:42: fatal error: ./cm_trace.h: No such file or directory
> >>>  95 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
> >>>     |                                          ^
> >>> compilation terminated.
> >> 
> >> I am not able to reproduce this failure.
> >> 
> >> gcc (GCC) 10.1.1 20200507 (Red Hat 10.1.1-1)
> > 
> > Yep, using gcc 10 too
> > 
> > Start from a clean tree?
> 
> Always.
> 
> 
> >> What if you edit drivers/infiniband/core/cm_trace.h and
> >> change the definition of TRACE_INCLUDE_PATH from "." to
> >> "../../drivers/infiniband/core" ?
> > 
> > It works
> > 
> > It is because ./ is relative to include/trace/define_trace.h ?
> 
> Yes.
> 
> It appears that the many instances of "#define TRACE_INCLUDE_PATH ."
> already in the kernel are each accompanied by Makefile magic to make
> that work correctly. I neglected (again) to add that.
> 
> But now that I've read the instructions in include/trace/define_trace.h,
> I prefer using a full relative path instead of "."-with-Makefile.
> 
> Do I need to send a v4?

No, I fixed it

Jason
Jason Gunthorpe Aug. 25, 2020, 5:05 p.m. UTC | #7
On Mon, Aug 17, 2020 at 09:53:05AM -0400, Chuck Lever wrote:
> Oracle has an interest in a common observability infrastructure in
> the RDMA core and ULPs. Introduce static tracepoints that can also
> be used as hooks for eBPF scripts, replacing infrastructure that
> is based on printk. This takes the same approach as tracepoints
> added recently in the RDMA CM.
> 
> Change since v2:
> * Rebase on v5.9-rc1
> 
> Changes since RFC:
> * Correct spelling of example tracepoint in patch description
> * Newer tool chains don't care for tracepoints with the same name
>  in different subsystems
> * Display ib_cm_events, not ib_events
> 
> 
> Chuck Lever (3):
>       RDMA/core: Move the rdma_show_ib_cm_event() macro
>       RDMA/cm: Replace pr_debug() call sites with tracepoints
>       RDMA/cm: Add tracepoints to track MAD send operations

Applied to for-next, thanks

Jason