linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH v4] IB/core: Trace points for diagnosing completion queue issues
Date: Thu, 7 Nov 2019 14:08:56 -0500	[thread overview]
Message-ID: <C804F833-C864-44D2-BAA2-0C6164ED6A70@oracle.com> (raw)
In-Reply-To: <20191106201730.GA25804@ziepe.ca>



> On Nov 6, 2019, at 3:17 PM, Jason Gunthorpe <jgg@ziepe.ca> wrote:
> 
> On Sat, Oct 12, 2019 at 03:42:56PM -0400, Chuck Lever wrote:
>> +static int __ib_poll_cq(struct ib_cq *cq, int num_entries, struct ib_wc *wc)
>> +{
>> +	int rc;
>> +
>> +	rc = ib_poll_cq(cq, num_entries, wc);
>> +	trace_cq_poll(cq, num_entries, rc);
>> +	return rc;
>> +}
> 
> Why not put the trace point in ib_poll_cq directly?

in rdma/ib_verbs.h:

3876 static inline int ib_poll_cq(struct ib_cq *cq, int num_entries,
3877                              struct ib_wc *wc)
3878 {
3879         return cq->device->ops.poll_cq(cq, num_entries, wc);
3880 }

The trace point would have to go in every driver's ->poll_cq.

Putting #include <trace/events/rdma_core.h> in a header could
be a problem. I've found it almost never works well, due to the
extra stuff that is pulled into every source file that would
include rdma/ib_verbs.h.

Note that the use of an indirect call here is also challenging
for adding a kprobe in this path (ie, for eBPF). Maybe a better
approach would be to move ib_poll_cq to drivers/infiniband/core/cq.c
and then add the trace point there?


> What is the overhead of these things if you don't use them?

IIUC, one conditional branch.


--
Chuck Lever




      reply	other threads:[~2019-11-07 19:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-12 19:42 [PATCH v4] IB/core: Trace points for diagnosing completion queue issues Chuck Lever
2019-10-21  0:07 ` Parav Pandit
2019-10-21 14:13   ` Chuck Lever
2019-11-06 20:17 ` Jason Gunthorpe
2019-11-07 19:08   ` Chuck Lever [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C804F833-C864-44D2-BAA2-0C6164ED6A70@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).