From: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: jgg-uk2M96/98Pc@public.gmane.org,
dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Mike Marciniszyn
<mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Kaike Wan <kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH for-next 11/11] IB/rdmavt: Add trace for RNRNAK timer
Date: Mon, 18 Dec 2017 19:57:28 -0800 [thread overview]
Message-ID: <20171219035726.2126.88467.stgit@scvm10.sc.intel.com> (raw)
In-Reply-To: <20171219034753.2126.78386.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
From: Kaike Wan <kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
This patch adds static trace for RNRNAK timer. Currently the output from
hrtimer static trace only shows the addresses of hrtimers in the system
and there is no easy way to correlate an RNRNAK timer with its entries in
the hrtimer trace. This patch adds the correlation among a QP, its RNRNAK
timer, and its entries in the hrtimer trace. This correlation will be
enormously helpful when debugging RNRNAK related issues. In addition, this
patch cleans up rvt_stop_rnr_timer() to be void while here.
Reviewed-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Kaike Wan <kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/sw/rdmavt/qp.c | 11 ++++----
drivers/infiniband/sw/rdmavt/trace_qp.h | 42 +++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index f3c6d2c..ed46801 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -2075,6 +2075,7 @@ void rvt_add_rnr_timer(struct rvt_qp *qp, u32 aeth)
lockdep_assert_held(&qp->s_lock);
qp->s_flags |= RVT_S_WAIT_RNR;
to = rvt_aeth_to_usec(aeth);
+ trace_rvt_rnrnak_add(qp, to);
hrtimer_start(&qp->s_rnr_timer,
ns_to_ktime(1000 * to), HRTIMER_MODE_REL);
}
@@ -2104,15 +2105,14 @@ void rvt_stop_rc_timers(struct rvt_qp *qp)
* stop an rnr timer and return if the timer
* had been pending.
*/
-static int rvt_stop_rnr_timer(struct rvt_qp *qp)
+static void rvt_stop_rnr_timer(struct rvt_qp *qp)
{
- int rval = 0;
-
lockdep_assert_held(&qp->s_lock);
/* Remove QP from rnr timer */
- if (qp->s_flags & RVT_S_WAIT_RNR)
+ if (qp->s_flags & RVT_S_WAIT_RNR) {
qp->s_flags &= ~RVT_S_WAIT_RNR;
- return rval;
+ trace_rvt_rnrnak_stop(qp, 0);
+ }
}
/**
@@ -2165,6 +2165,7 @@ enum hrtimer_restart rvt_rc_rnr_retry(struct hrtimer *t)
spin_lock_irqsave(&qp->s_lock, flags);
rvt_stop_rnr_timer(qp);
+ trace_rvt_rnrnak_timeout(qp, 0);
rdi->driver_f.schedule_send(qp);
spin_unlock_irqrestore(&qp->s_lock, flags);
return HRTIMER_NORESTART;
diff --git a/drivers/infiniband/sw/rdmavt/trace_qp.h b/drivers/infiniband/sw/rdmavt/trace_qp.h
index 4c77a31..efc9d81 100644
--- a/drivers/infiniband/sw/rdmavt/trace_qp.h
+++ b/drivers/infiniband/sw/rdmavt/trace_qp.h
@@ -85,6 +85,48 @@
TP_PROTO(struct rvt_qp *qp, u32 bucket),
TP_ARGS(qp, bucket));
+DECLARE_EVENT_CLASS(
+ rvt_rnrnak_template,
+ TP_PROTO(struct rvt_qp *qp, u32 to),
+ TP_ARGS(qp, to),
+ TP_STRUCT__entry(
+ RDI_DEV_ENTRY(ib_to_rvt(qp->ibqp.device))
+ __field(u32, qpn)
+ __field(void *, hrtimer)
+ __field(u32, s_flags)
+ __field(u32, to)
+ ),
+ TP_fast_assign(
+ RDI_DEV_ASSIGN(ib_to_rvt(qp->ibqp.device))
+ __entry->qpn = qp->ibqp.qp_num;
+ __entry->hrtimer = &qp->s_rnr_timer;
+ __entry->s_flags = qp->s_flags;
+ __entry->to = to;
+ ),
+ TP_printk(
+ "[%s] qpn 0x%x hrtimer 0x%p s_flags 0x%x timeout %u us",
+ __get_str(dev),
+ __entry->qpn,
+ __entry->hrtimer,
+ __entry->s_flags,
+ __entry->to
+ )
+);
+
+DEFINE_EVENT(
+ rvt_rnrnak_template, rvt_rnrnak_add,
+ TP_PROTO(struct rvt_qp *qp, u32 to),
+ TP_ARGS(qp, to));
+
+DEFINE_EVENT(
+ rvt_rnrnak_template, rvt_rnrnak_timeout,
+ TP_PROTO(struct rvt_qp *qp, u32 to),
+ TP_ARGS(qp, to));
+
+DEFINE_EVENT(
+ rvt_rnrnak_template, rvt_rnrnak_stop,
+ TP_PROTO(struct rvt_qp *qp, u32 to),
+ TP_ARGS(qp, to));
#endif /* __RVT_TRACE_QP_H */
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-12-19 3:57 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-19 3:56 [PATCH for-next 00/11] IB/hfi1, rdmavt, qib: Driver updates for 12/18/2017 Dennis Dalessandro
[not found] ` <20171219034753.2126.78386.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-12-19 3:56 ` [PATCH for-next 01/11] IB/hfi1: Destroy link_wq workqueue after free_irq() Dennis Dalessandro
[not found] ` <20171219035612.2126.10447.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-12-19 20:57 ` Jason Gunthorpe
[not found] ` <20171219205754.GE14814-uk2M96/98Pc@public.gmane.org>
2017-12-20 21:01 ` Ruhl, Michael J
[not found] ` <14063C7AD467DE4B82DEDB5C278E86639F0E3917-AtyAts71sc88Ug9VwtkbtrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-12-20 21:11 ` Jason Gunthorpe
[not found] ` <20171220211112.GG22908-uk2M96/98Pc@public.gmane.org>
2017-12-22 13:13 ` Ruhl, Michael J
2017-12-19 3:56 ` [PATCH for-next 02/11] IB/hfi1: Check return value of strchr before using it Dennis Dalessandro
[not found] ` <20171219035621.2126.23093.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-12-20 8:25 ` Leon Romanovsky
[not found] ` <20171220082555.GN2942-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2018-01-03 15:05 ` Dennis Dalessandro
[not found] ` <f5849e2b-c8cd-b93b-f32f-f423bff9ae31-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-01-03 15:27 ` Leon Romanovsky
[not found] ` <20180103152721.GT10145-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2018-01-03 15:42 ` Dennis Dalessandro
[not found] ` <4555c08f-a568-48ea-e183-2d49ebd36c7c-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-01-05 17:39 ` Doug Ledford
2017-12-19 3:56 ` [PATCH for-next 03/11] IB/rdmavt: No need to cancel RNRNAK retry timer when it is running Dennis Dalessandro
2017-12-19 3:56 ` [PATCH for-next 04/11] IB/{rdmavt, hfi1, qib}: Self determine driver name Dennis Dalessandro
[not found] ` <20171219035635.2126.59763.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-12-19 20:59 ` Jason Gunthorpe
2017-12-19 3:56 ` [PATCH for-next 05/11] IB/{rdmavt, hfi1, qib}: Remove get_card_name() downcall Dennis Dalessandro
2017-12-19 3:56 ` [PATCH for-next 06/11] IB/rdmavt: Use correct numa node for SRQ allocation Dennis Dalessandro
[not found] ` <20171219035649.2126.1625.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-12-20 8:17 ` Leon Romanovsky
[not found] ` <20171220081720.GM2942-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-12-20 8:31 ` Leon Romanovsky
2017-12-19 3:56 ` [PATCH for-next 07/11] IB/hfi1: Fix infinite loop in 8051 command error path Dennis Dalessandro
[not found] ` <20171219035657.2126.88651.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-12-20 8:08 ` Leon Romanovsky
[not found] ` <20171220080854.GL2942-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-12-20 18:02 ` Sanchez, Sebastian
[not found] ` <5CDA63463B33C94CA80846587415F0772829387D-8oqHQFITsIGkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-12-20 18:12 ` Jason Gunthorpe
[not found] ` <20171220181244.GD22908-uk2M96/98Pc@public.gmane.org>
2017-12-20 22:24 ` Sanchez, Sebastian
2017-12-19 3:57 ` [PATCH for-next 08/11] IB/rdmavt: Allocate CQ memory on the correct node Dennis Dalessandro
2017-12-19 3:57 ` [PATCH for-next 09/11] rdma: Update maintainer contact for Intel RDMA drivers Dennis Dalessandro
[not found] ` <20171219035711.2126.47130.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-12-19 20:51 ` Jason Gunthorpe
2017-12-22 23:39 ` Jason Gunthorpe
2017-12-19 3:57 ` [PATCH for-next 10/11] IB/{hfi1, qib}: Fix a concurrency issue with device name in logging Dennis Dalessandro
2017-12-19 3:57 ` Dennis Dalessandro [this message]
2018-01-05 18:36 ` [PATCH for-next 00/11] IB/hfi1, rdmavt, qib: Driver updates for 12/18/2017 Doug Ledford
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=20171219035726.2126.88467.stgit@scvm10.sc.intel.com \
--to=dennis.dalessandro-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=jgg-uk2M96/98Pc@public.gmane.org \
--cc=kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.