Skip to contentSkip to conversation

rdma/ib: Add trace point macros to display human-readable values

RFC PATCH In review Chuck Lever 4 participants 8 messages Oct 30, 2017 – Nov 2, 2017 5 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 rdma/ib: Add trace point macros to display human-readable values

These can be shared with all kernel ULPs, and more can easily be added as needed.

---
 include/trace/events/rdma.h |  128 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 128 insertions(+)
 create mode 100644 include/trace/events/rdma.h

Hi-

I'm putting together a series of patches for v4.16 (or later) that add static ftrace trace points to the RPC-over-RDMA client imple- mentation. As part of that effort, I've constructed some trace point helpers that might be useful for other kernel ULPs.

So far this patch adds just helpers that xprtrdma needs. It is not complete, but additional helpers can be introduced as they are needed.

I'd like to hear comments about these, or please let me know if such helpers already exist and where xprtrdma can find them.

Thanks!

include/trace/events/rdma.h new file +128 -0
new file mode 100644
index 0000000..9d02fbe
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2017 Oracle.  All rights reserved.
+ */
+
+/*
+ * enum ib_event_type, from include/rdma/ib_verbs.h
+ */
+
+#define IB_EVENT_LIST				\
+	ib_event(CQ_ERR)			\
+	ib_event(QP_FATAL)			\
+	ib_event(QP_REQ_ERR)			\
+	ib_event(QP_ACCESS_ERR)			\
+	ib_event(COMM_EST)			\
+	ib_event(SQ_DRAINED)			\
+	ib_event(PATH_MIG)			\
+	ib_event(PATH_MIG_ERR)			\
+	ib_event(DEVICE_FATAL)			\
+	ib_event(PORT_ACTIVE)			\
+	ib_event(PORT_ERR)			\
+	ib_event(LID_CHANGE)			\
+	ib_event(PKEY_CHANGE)			\
+	ib_event(SM_CHANGE)			\
+	ib_event(SRQ_ERR)			\
+	ib_event(SRQ_LIMIT_REACHED)		\
+	ib_event(QP_LAST_WQE_REACHED)		\
+	ib_event(CLIENT_REREGISTER)		\
+	ib_event(GID_CHANGE)			\
+	ib_event_end(WQ_FATAL)
+
+#undef ib_event
+#undef ib_event_end
+
+#define ib_event(x)		TRACE_DEFINE_ENUM(IB_EVENT_##x);
+#define ib_event_end(x)		TRACE_DEFINE_ENUM(IB_EVENT_##x);
+
+IB_EVENT_LIST
+
+#undef ib_event
+#undef ib_event_end
+
+#define ib_event(x)		{ IB_EVENT_##x, #x },
+#define ib_event_end(x)		{ IB_EVENT_##x, #x }
+
+#define rdma_show_ib_event(x) \
+		__print_symbolic(x, IB_EVENT_LIST)
+
+/*
+ * enum ib_wc_status type, from include/rdma/ib_verbs.h
+ */
+#define IB_WC_STATUS_LIST			\
+	ib_wc_status(SUCCESS)			\
+	ib_wc_status(LOC_LEN_ERR)		\
+	ib_wc_status(LOC_QP_OP_ERR)		\
+	ib_wc_status(LOC_EEC_OP_ERR)		\
+	ib_wc_status(LOC_PROT_ERR)		\
+	ib_wc_status(WR_FLUSH_ERR)		\
+	ib_wc_status(MW_BIND_ERR)		\
+	ib_wc_status(BAD_RESP_ERR)		\
+	ib_wc_status(LOC_ACCESS_ERR)		\
+	ib_wc_status(REM_INV_REQ_ERR)		\
+	ib_wc_status(REM_ACCESS_ERR)		\
+	ib_wc_status(REM_OP_ERR)		\
+	ib_wc_status(RETRY_EXC_ERR)		\
+	ib_wc_status(RNR_RETRY_EXC_ERR)		\
+	ib_wc_status(LOC_RDD_VIOL_ERR)		\
+	ib_wc_status(REM_INV_RD_REQ_ERR)	\
+	ib_wc_status(REM_ABORT_ERR)		\
+	ib_wc_status(INV_EECN_ERR)		\
+	ib_wc_status(INV_EEC_STATE_ERR)		\
+	ib_wc_status(FATAL_ERR)			\
+	ib_wc_status(RESP_TIMEOUT_ERR)		\
+	ib_wc_status_end(GENERAL_ERR)
+
+#undef ib_wc_status
+#undef ib_wc_status_end
+
+#define ib_wc_status(x)		TRACE_DEFINE_ENUM(IB_WC_##x);
+#define ib_wc_status_end(x)	TRACE_DEFINE_ENUM(IB_WC_##x);
+
+IB_WC_STATUS_LIST
+
+#undef ib_wc_status
+#undef ib_wc_status_end
+
+#define ib_wc_status(x)		{ IB_WC_##x, #x },
+#define ib_wc_status_end(x)	{ IB_WC_##x, #x }
+
+#define rdma_show_wc_status(x) \
+		__print_symbolic(x, IB_WC_STATUS_LIST)
+
+/*
+ * enum rdma_cm_event_type, from include/rdma/rdma_cm.h
+ */
+#define RDMA_CM_EVENT_LIST			\
+	rdma_cm_event(ADDR_RESOLVED)		\
+	rdma_cm_event(ADDR_ERROR)		\
+	rdma_cm_event(ROUTE_RESOLVED)		\
+	rdma_cm_event(ROUTE_ERROR)		\
+	rdma_cm_event(CONNECT_REQUEST)		\
+	rdma_cm_event(CONNECT_RESPONSE)		\
+	rdma_cm_event(CONNECT_ERROR)		\
+	rdma_cm_event(UNREACHABLE)		\
+	rdma_cm_event(REJECTED)			\
+	rdma_cm_event(ESTABLISHED)		\
+	rdma_cm_event(DISCONNECTED)		\
+	rdma_cm_event(DEVICE_REMOVAL)		\
+	rdma_cm_event(MULTICAST_JOIN)		\
+	rdma_cm_event(MULTICAST_ERROR)		\
+	rdma_cm_event(ADDR_CHANGE)		\
+	rdma_cm_event_end(TIMEWAIT_EXIT)
+
+#undef rdma_cm_event
+#undef rdma_cm_event_end
+
+#define rdma_cm_event(x)	TRACE_DEFINE_ENUM(RDMA_CM_EVENT_##x);
+#define rdma_cm_event_end(x)	TRACE_DEFINE_ENUM(RDMA_CM_EVENT_##x);
+
+RDMA_CM_EVENT_LIST
+
+#undef rdma_cm_event
+#undef rdma_cm_event_end
+
+#define rdma_cm_event(x)	{ RDMA_CM_EVENT_##x, #x },
+#define rdma_cm_event_end(x)	{ RDMA_CM_EVENT_##x, #x }
+
+#define rdma_show_cm_event(x) \
+		__print_symbolic(x, RDMA_CM_EVENT_LIST)

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20171030215809.31286.46685.stgit-FYjufvaPoItvLzlybtyyYzGyq/[email protected]

#2 lore raw
Quoted 16 lines · Chuck Lever

These can be shared with all kernel ULPs, and more can easily be added as needed.

---
 include/trace/events/rdma.h |  128 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 128 insertions(+)
 create mode 100644 include/trace/events/rdma.h

Hi-

I'm putting together a series of patches for v4.16 (or later) that add static ftrace trace points to the RPC-over-RDMA client imple- mentation. As part of that effort, I've constructed some trace point helpers that might be useful for other kernel ULPs.

Quoted 6 lines

So far this patch adds just helpers that xprtrdma needs. It is not complete, but additional helpers can be introduced as they are needed.

I'd like to hear comments about these, or please let me know if such helpers already exist and where xprtrdma can find them.

Bart, Steve

You attended the MS track, and for the rest of us, the quote below sounds a little bit cryptic. Does the quote below mean that Chuck's proposal is no-go?

From LWN.net "Another attempt to address the tracepoint ABI problem" [1]

"The solution that was arrived at for now, as related by Torvalds,
is to hold off on adding explicit tracepoints to the kernel. Instead, support will be added to make it easy for an application to attach a BPF script to any function in the kernel, with access to that function's arguments."

[1] https://lwn.net/Articles/737530/

Thanks

Quoted 143 lines

Thanks!

include/trace/events/rdma.h new file +128 -1
new file mode 100644
index 0000000..9d02fbe
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2017 Oracle.  All rights reserved.
+ */
+
+/*
+ * enum ib_event_type, from include/rdma/ib_verbs.h
+ */
+
+#define IB_EVENT_LIST				\
+	ib_event(CQ_ERR)			\
+	ib_event(QP_FATAL)			\
+	ib_event(QP_REQ_ERR)			\
+	ib_event(QP_ACCESS_ERR)			\
+	ib_event(COMM_EST)			\
+	ib_event(SQ_DRAINED)			\
+	ib_event(PATH_MIG)			\
+	ib_event(PATH_MIG_ERR)			\
+	ib_event(DEVICE_FATAL)			\
+	ib_event(PORT_ACTIVE)			\
+	ib_event(PORT_ERR)			\
+	ib_event(LID_CHANGE)			\
+	ib_event(PKEY_CHANGE)			\
+	ib_event(SM_CHANGE)			\
+	ib_event(SRQ_ERR)			\
+	ib_event(SRQ_LIMIT_REACHED)		\
+	ib_event(QP_LAST_WQE_REACHED)		\
+	ib_event(CLIENT_REREGISTER)		\
+	ib_event(GID_CHANGE)			\
+	ib_event_end(WQ_FATAL)
+
+#undef ib_event
+#undef ib_event_end
+
+#define ib_event(x)		TRACE_DEFINE_ENUM(IB_EVENT_##x);
+#define ib_event_end(x)		TRACE_DEFINE_ENUM(IB_EVENT_##x);
+
+IB_EVENT_LIST
+
+#undef ib_event
+#undef ib_event_end
+
+#define ib_event(x)		{ IB_EVENT_##x, #x },
+#define ib_event_end(x)		{ IB_EVENT_##x, #x }
+
+#define rdma_show_ib_event(x) \
+		__print_symbolic(x, IB_EVENT_LIST)
+
+/*
+ * enum ib_wc_status type, from include/rdma/ib_verbs.h
+ */
+#define IB_WC_STATUS_LIST			\
+	ib_wc_status(SUCCESS)			\
+	ib_wc_status(LOC_LEN_ERR)		\
+	ib_wc_status(LOC_QP_OP_ERR)		\
+	ib_wc_status(LOC_EEC_OP_ERR)		\
+	ib_wc_status(LOC_PROT_ERR)		\
+	ib_wc_status(WR_FLUSH_ERR)		\
+	ib_wc_status(MW_BIND_ERR)		\
+	ib_wc_status(BAD_RESP_ERR)		\
+	ib_wc_status(LOC_ACCESS_ERR)		\
+	ib_wc_status(REM_INV_REQ_ERR)		\
+	ib_wc_status(REM_ACCESS_ERR)		\
+	ib_wc_status(REM_OP_ERR)		\
+	ib_wc_status(RETRY_EXC_ERR)		\
+	ib_wc_status(RNR_RETRY_EXC_ERR)		\
+	ib_wc_status(LOC_RDD_VIOL_ERR)		\
+	ib_wc_status(REM_INV_RD_REQ_ERR)	\
+	ib_wc_status(REM_ABORT_ERR)		\
+	ib_wc_status(INV_EECN_ERR)		\
+	ib_wc_status(INV_EEC_STATE_ERR)		\
+	ib_wc_status(FATAL_ERR)			\
+	ib_wc_status(RESP_TIMEOUT_ERR)		\
+	ib_wc_status_end(GENERAL_ERR)
+
+#undef ib_wc_status
+#undef ib_wc_status_end
+
+#define ib_wc_status(x)		TRACE_DEFINE_ENUM(IB_WC_##x);
+#define ib_wc_status_end(x)	TRACE_DEFINE_ENUM(IB_WC_##x);
+
+IB_WC_STATUS_LIST
+
+#undef ib_wc_status
+#undef ib_wc_status_end
+
+#define ib_wc_status(x)		{ IB_WC_##x, #x },
+#define ib_wc_status_end(x)	{ IB_WC_##x, #x }
+
+#define rdma_show_wc_status(x) \
+		__print_symbolic(x, IB_WC_STATUS_LIST)
+
+/*
+ * enum rdma_cm_event_type, from include/rdma/rdma_cm.h
+ */
+#define RDMA_CM_EVENT_LIST			\
+	rdma_cm_event(ADDR_RESOLVED)		\
+	rdma_cm_event(ADDR_ERROR)		\
+	rdma_cm_event(ROUTE_RESOLVED)		\
+	rdma_cm_event(ROUTE_ERROR)		\
+	rdma_cm_event(CONNECT_REQUEST)		\
+	rdma_cm_event(CONNECT_RESPONSE)		\
+	rdma_cm_event(CONNECT_ERROR)		\
+	rdma_cm_event(UNREACHABLE)		\
+	rdma_cm_event(REJECTED)			\
+	rdma_cm_event(ESTABLISHED)		\
+	rdma_cm_event(DISCONNECTED)		\
+	rdma_cm_event(DEVICE_REMOVAL)		\
+	rdma_cm_event(MULTICAST_JOIN)		\
+	rdma_cm_event(MULTICAST_ERROR)		\
+	rdma_cm_event(ADDR_CHANGE)		\
+	rdma_cm_event_end(TIMEWAIT_EXIT)
+
+#undef rdma_cm_event
+#undef rdma_cm_event_end
+
+#define rdma_cm_event(x)	TRACE_DEFINE_ENUM(RDMA_CM_EVENT_##x);
+#define rdma_cm_event_end(x)	TRACE_DEFINE_ENUM(RDMA_CM_EVENT_##x);
+
+RDMA_CM_EVENT_LIST
+
+#undef rdma_cm_event
+#undef rdma_cm_event_end
+
+#define rdma_cm_event(x)	{ RDMA_CM_EVENT_##x, #x },
+#define rdma_cm_event_end(x)	{ RDMA_CM_EVENT_##x, #x }
+
+#define rdma_show_cm_event(x) \
+		__print_symbolic(x, RDMA_CM_EVENT_LIST)
 
--

To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20171101062743.GO16127-U/[email protected]

#4 lore raw
Quoted 21 lines · On Wed, 1 Nov 2017 08:27:43 +0200 Leon Romanovsky…
Quoted 20 lines · Chuck Lever

These can be shared with all kernel ULPs, and more can easily be added as needed.

---
 include/trace/events/rdma.h |  128 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 128 insertions(+)
 create mode 100644 include/trace/events/rdma.h

Hi-

I'm putting together a series of patches for v4.16 (or later) that add static ftrace trace points to the RPC-over-RDMA client imple- mentation. As part of that effort, I've constructed some trace point helpers that might be useful for other kernel ULPs.

So far this patch adds just helpers that xprtrdma needs. It is not complete, but additional helpers can be introduced as they are needed.

Quoted 8 lines
Quoted 2 lines

I'd like to hear comments about these, or please let me know if such helpers already exist and where xprtrdma can find them.

Bart, Steve

You attended the MS track, and for the rest of us, the quote below sounds a little bit cryptic. Does the quote below mean that Chuck's proposal is no-go?

Actually, I wasn't invited to the Maintainer's Summit. Perhaps I should have been.

Quoted 10 lines

From LWN.net "Another attempt to address the tracepoint ABI problem" [1]

"The solution that was arrived at for now, as related by Torvalds,
is to hold off on adding explicit tracepoints to the kernel. Instead, support will be added to make it easy for an application to attach a BPF script to any function in the kernel, with access to that function's arguments."

[1] https://lwn.net/Articles/737530/

What I can tell you is what I talked to Linus about when I cornered him in the hallway. ;-)

Basically, nothing has changed. If a maintainer is fine with trace events, then they can add new trace events. The issue is with the maintainers that don't want the possibility of having to maintain stale trace events because some tool depends on them and it becomes a burden in the future. This is mostly an issues with the scheduler and VFS.

What Linus asked me to do is to build an infrastructure on top of ftrace, and make it easier to extract data from these "dynamic function trace events". I need to add easier use cases for eBPF because the usage of eBPF is still a large learning curve compared to the ease of accessing the current trace event infrastructure.

I'll be working on this in the very near future, but I don't expect anything to be useful for within a year's time. Thus, continue doing what you have been doing, and hopefully in a year we will be able to extract more data from the kernel from anywhere a function is traced.

-- Steve

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20171101112932.4485ba6a-f9ZlEuEWxVcJvu8Pb33WZ0EMvNT87kid@public.gmane.org

#6 lore raw
Quoted 62 lines · Steven Rostedt
Quoted 21 lines · On Wed, 1 Nov 2017 08:27:43 +0200 Leon Romanovsky…
Quoted 20 lines · Chuck Lever

These can be shared with all kernel ULPs, and more can easily be added as needed.

---
 include/trace/events/rdma.h |  128 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 128 insertions(+)
 create mode 100644 include/trace/events/rdma.h

Hi-

I'm putting together a series of patches for v4.16 (or later) that add static ftrace trace points to the RPC-over-RDMA client imple- mentation. As part of that effort, I've constructed some trace point helpers that might be useful for other kernel ULPs.

So far this patch adds just helpers that xprtrdma needs. It is not complete, but additional helpers can be introduced as they are needed.

Quoted 8 lines
Quoted 2 lines

I'd like to hear comments about these, or please let me know if such helpers already exist and where xprtrdma can find them.

Bart, Steve

You attended the MS track, and for the rest of us, the quote below sounds a little bit cryptic. Does the quote below mean that Chuck's proposal is no-go?

Actually, I wasn't invited to the Maintainer's Summit. Perhaps I should have been.

Quoted 10 lines

From LWN.net "Another attempt to address the tracepoint ABI problem" [1]

"The solution that was arrived at for now, as related by Torvalds,
is to hold off on adding explicit tracepoints to the kernel. Instead, support will be added to make it easy for an application to attach a BPF script to any function in the kernel, with access to that function's arguments."

[1] https://lwn.net/Articles/737530/

What I can tell you is what I talked to Linus about when I cornered him in the hallway. ;-)

Basically, nothing has changed. If a maintainer is fine with trace events, then they can add new trace events. The issue is with the maintainers that don't want the possibility of having to maintain stale trace events because some tool depends on them and it becomes a burden in the future. This is mostly an issues with the scheduler and VFS.

What Linus asked me to do is to build an infrastructure on top of ftrace, and make it easier to extract data from these "dynamic function trace events". I need to add easier use cases for eBPF because the usage of eBPF is still a large learning curve compared to the ease of accessing the current trace event infrastructure.

Quoted 4 lines

I'll be working on this in the very near future, but I don't expect anything to be useful for within a year's time. Thus, continue doing what you have been doing, and hopefully in a year we will be able to extract more data from the kernel from anywhere a function is traced.

Thanks

Quoted 3 lines

-- Steve

#7 lore raw
In reply to a message not in the archive

T24gV2VkLCAyMDE3LTExLTAxIGF0IDA4OjI3ICswMjAwLCBMZW9uIFJvbWFub3Zza3kgd3JvdGU6 DQo+IEJhcnQsIFN0ZXZlDQo+IA0KPiBZb3UgYXR0ZW5kZWQgdGhlIE1TIHRyYWNrLCBhbmQgZm9y IHRoZSByZXN0IG9mIHVzLCB0aGUgcXVvdGUgYmVsb3cNCj4gc291bmRzIGEgbGl0dGxlIGJpdCBj cnlwdGljLiBEb2VzIHRoZSBxdW90ZSBiZWxvdyBtZWFuIHRoYXQgQ2h1Y2sncw0KPiBwcm9wb3Nh bCBpcyBuby1nbz8NCj4gDQo+IEZyb20gTFdOLm5ldCAiQW5vdGhlciBhdHRlbXB0IHRvIGFkZHJl c3MgdGhlIHRyYWNlcG9pbnQgQUJJIHByb2JsZW0iIFsxXQ0KPiANCj4gIlRoZSBzb2x1dGlvbiB0 aGF0IHdhcyBhcnJpdmVkIGF0IGZvciBub3csIGFzIHJlbGF0ZWQgYnkgVG9ydmFsZHMsDQo+ICBp cyB0byBob2xkIG9mZiBvbiBhZGRpbmcgZXhwbGljaXQgdHJhY2Vwb2ludHMgdG8gdGhlIGtlcm5l bC4gSW5zdGVhZCwNCj4gIHN1cHBvcnQgd2lsbCBiZSBhZGRlZCB0byBtYWtlIGl0IGVhc3kgZm9y IGFuIGFwcGxpY2F0aW9uIHRvIGF0dGFjaCBhDQo+ICBCUEYgc2NyaXB0IHRvIGFueSBmdW5jdGlv biBpbiB0aGUga2VybmVsLCB3aXRoIGFjY2VzcyB0byB0aGF0IGZ1bmN0aW9uJ3MNCj4gIGFyZ3Vt ZW50cy4iDQo+IA0KPiBbMV0gaHR0cHM6Ly9sd24ubmV0L0FydGljbGVzLzczNzUzMC8NCg0KV2hh dCBJIHJlbWVtYmVyIGlzIHRoYXQgTGludXMgZG9lcyBub3QgcmVxdWlyZSB1cyB0byBhdm9pZCBi cmVha2luZyB1c2VyDQpzcGFjZSBhcHBsaWNhdGlvbnMgdGhhdCB1c2UgdHJhY2Vwb2ludHMuIFBv d2VydG9wIGhvd2V2ZXIgaXMgYW4gZXhjZXB0aW9uDQp0byB0aGlzIHJ1bGUuIEFsdGhvdWdoIGl0 IHVzZXMgdHJhY2Vwb2ludHMsIHdlIG11c3Qgbm90IGJyZWFrIGl0LiBJIGFsc28NCnJlbWVtYmVy IHRoYXQgTGludXMgbm90aWNlZCB0aGF0IHRoZSBwdXJwb3NlIG9mIG1hbnkgdHJhY2Vwb2ludHMg aXMgdG8NCmFsbG93IHVzZXJzIHRvIHRyYWNlIGEgZnVuY3Rpb24gYW5kIGl0cyBhcmd1bWVudHMu IExpbnVzIHdhbnRzIGEgYmV0dGVyDQphcHByb2FjaCBmb3IgdHJhY2luZyBrZXJuZWwgZnVuY3Rp b25zIHRoYW4gYWRkaW5nIGFuIGV4cGxpY2l0IHRyYWNlcG9pbnQNCnRvIGVhY2gga2VybmVsIGZ1 bmN0aW9uLiBNYXliZSBJIHdhc24ndCBsaXN0ZW5pbmcgY2FyZWZ1bGx5IGVub3VnaCBidXQgSQ0K aGF2ZW4ndCBoZWFyZCBMaW51cyBzYXlpbmcgdGhhdCB3ZSB3b3VsZCBub3QgYmUgYWxsb3dlZCB0 byBhZGQgbmV3DQp0cmFjZXBvaW50cy4NCg0KQmFydC4=
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw
Quoted 17 lines · Bart Van Assche
Quoted 8 lines · Leon Romanovsky

Bart, Steve

You attended the MS track, and for the rest of us, the quote below sounds a little bit cryptic. Does the quote below mean that Chuck's proposal is no-go?

From LWN.net "Another attempt to address the tracepoint ABI problem" [1]

Quoted 7 lines

"The solution that was arrived at for now, as related by Torvalds,
is to hold off on adding explicit tracepoints to the kernel. Instead, support will be added to make it easy for an application to attach a BPF script to any function in the kernel, with access to that function's arguments."

[1] https://lwn.net/Articles/737530/

Quoted 9 lines

What I remember is that Linus does not require us to avoid breaking user space applications that use tracepoints. Powertop however is an exception to this rule. Although it uses tracepoints, we must not break it. I also remember that Linus noticed that the purpose of many tracepoints is to allow users to trace a function and its arguments. Linus wants a better approach for tracing kernel functions than adding an explicit tracepoint to each kernel function. Maybe I wasn't listening carefully enough but I haven't heard Linus saying that we would not be allowed to add new tracepoints.

Like Steven, I wasn't in MS either and the sentence "is to hold off on adding explicit tracepoints to the kernel" made me worry.

Thanks.

Quoted 2 lines

Bart.

#10 lore raw
In reply to a message not in the archive
Quoted 19 lines · Chuck Lever

These can be shared with all kernel ULPs, and more can easily be added as needed.

---
include/trace/events/rdma.h | 128 +++++++++++++++++++++++++++++++++++++++++++

1 file changed, 128 insertions(+)

create mode 100644 include/trace/events/rdma.h

Hi-

I'm putting together a series of patches for v4.16 (or later) that add static ftrace trace points to the RPC-over-RDMA client imple- mentation. As part of that effort, I've constructed some trace point helpers that might be useful for other kernel ULPs.

Quoted 6 lines

So far this patch adds just helpers that xprtrdma needs. It is not complete, but additional helpers can be introduced as they are needed.

I'd like to hear comments about these, or please let me know if such helpers already exist and where xprtrdma can find them.

Now that the question of whether new trace points will be allowed has been answered...

The helpers that are used for displaying errors in the kernel log display the spelled out text, not the symbolic name of the error code, as is done here.

Would the community prefer long-form text or symbolic error names in trace reports?

Quoted 139 lines

Thanks!

include/trace/events/rdma.h new file +128 -1
new file mode 100644
index 0000000..9d02fbe
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2017 Oracle.  All rights reserved.
+ */
+
+/*
+ * enum ib_event_type, from include/rdma/ib_verbs.h
+ */
+
+#define IB_EVENT_LIST				\
+	ib_event(CQ_ERR)			\
+	ib_event(QP_FATAL)			\
+	ib_event(QP_REQ_ERR)			\
+	ib_event(QP_ACCESS_ERR)			\
+	ib_event(COMM_EST)			\
+	ib_event(SQ_DRAINED)			\
+	ib_event(PATH_MIG)			\
+	ib_event(PATH_MIG_ERR)			\
+	ib_event(DEVICE_FATAL)			\
+	ib_event(PORT_ACTIVE)			\
+	ib_event(PORT_ERR)			\
+	ib_event(LID_CHANGE)			\
+	ib_event(PKEY_CHANGE)			\
+	ib_event(SM_CHANGE)			\
+	ib_event(SRQ_ERR)			\
+	ib_event(SRQ_LIMIT_REACHED)		\
+	ib_event(QP_LAST_WQE_REACHED)		\
+	ib_event(CLIENT_REREGISTER)		\
+	ib_event(GID_CHANGE)			\
+	ib_event_end(WQ_FATAL)
+
+#undef ib_event
+#undef ib_event_end
+
+#define ib_event(x)		TRACE_DEFINE_ENUM(IB_EVENT_##x);
+#define ib_event_end(x)		TRACE_DEFINE_ENUM(IB_EVENT_##x);
+
+IB_EVENT_LIST
+
+#undef ib_event
+#undef ib_event_end
+
+#define ib_event(x)		{ IB_EVENT_##x, #x },
+#define ib_event_end(x)		{ IB_EVENT_##x, #x }
+
+#define rdma_show_ib_event(x) \
+		__print_symbolic(x, IB_EVENT_LIST)
+
+/*
+ * enum ib_wc_status type, from include/rdma/ib_verbs.h
+ */
+#define IB_WC_STATUS_LIST			\
+	ib_wc_status(SUCCESS)			\
+	ib_wc_status(LOC_LEN_ERR)		\
+	ib_wc_status(LOC_QP_OP_ERR)		\
+	ib_wc_status(LOC_EEC_OP_ERR)		\
+	ib_wc_status(LOC_PROT_ERR)		\
+	ib_wc_status(WR_FLUSH_ERR)		\
+	ib_wc_status(MW_BIND_ERR)		\
+	ib_wc_status(BAD_RESP_ERR)		\
+	ib_wc_status(LOC_ACCESS_ERR)		\
+	ib_wc_status(REM_INV_REQ_ERR)		\
+	ib_wc_status(REM_ACCESS_ERR)		\
+	ib_wc_status(REM_OP_ERR)		\
+	ib_wc_status(RETRY_EXC_ERR)		\
+	ib_wc_status(RNR_RETRY_EXC_ERR)		\
+	ib_wc_status(LOC_RDD_VIOL_ERR)		\
+	ib_wc_status(REM_INV_RD_REQ_ERR)	\
+	ib_wc_status(REM_ABORT_ERR)		\
+	ib_wc_status(INV_EECN_ERR)		\
+	ib_wc_status(INV_EEC_STATE_ERR)		\
+	ib_wc_status(FATAL_ERR)			\
+	ib_wc_status(RESP_TIMEOUT_ERR)		\
+	ib_wc_status_end(GENERAL_ERR)
+
+#undef ib_wc_status
+#undef ib_wc_status_end
+
+#define ib_wc_status(x)		TRACE_DEFINE_ENUM(IB_WC_##x);
+#define ib_wc_status_end(x)	TRACE_DEFINE_ENUM(IB_WC_##x);
+
+IB_WC_STATUS_LIST
+
+#undef ib_wc_status
+#undef ib_wc_status_end
+
+#define ib_wc_status(x)		{ IB_WC_##x, #x },
+#define ib_wc_status_end(x)	{ IB_WC_##x, #x }
+
+#define rdma_show_wc_status(x) \
+		__print_symbolic(x, IB_WC_STATUS_LIST)
+
+/*
+ * enum rdma_cm_event_type, from include/rdma/rdma_cm.h
+ */
+#define RDMA_CM_EVENT_LIST			\
+	rdma_cm_event(ADDR_RESOLVED)		\
+	rdma_cm_event(ADDR_ERROR)		\
+	rdma_cm_event(ROUTE_RESOLVED)		\
+	rdma_cm_event(ROUTE_ERROR)		\
+	rdma_cm_event(CONNECT_REQUEST)		\
+	rdma_cm_event(CONNECT_RESPONSE)		\
+	rdma_cm_event(CONNECT_ERROR)		\
+	rdma_cm_event(UNREACHABLE)		\
+	rdma_cm_event(REJECTED)			\
+	rdma_cm_event(ESTABLISHED)		\
+	rdma_cm_event(DISCONNECTED)		\
+	rdma_cm_event(DEVICE_REMOVAL)		\
+	rdma_cm_event(MULTICAST_JOIN)		\
+	rdma_cm_event(MULTICAST_ERROR)		\
+	rdma_cm_event(ADDR_CHANGE)		\
+	rdma_cm_event_end(TIMEWAIT_EXIT)
+
+#undef rdma_cm_event
+#undef rdma_cm_event_end
+
+#define rdma_cm_event(x)	TRACE_DEFINE_ENUM(RDMA_CM_EVENT_##x);
+#define rdma_cm_event_end(x)	TRACE_DEFINE_ENUM(RDMA_CM_EVENT_##x);
+
+RDMA_CM_EVENT_LIST
+
+#undef rdma_cm_event
+#undef rdma_cm_event_end
+
+#define rdma_cm_event(x)	{ RDMA_CM_EVENT_##x, #x },
+#define rdma_cm_event_end(x)	{ RDMA_CM_EVENT_##x, #x }
+
+#define rdma_show_cm_event(x) \
+		__print_symbolic(x, RDMA_CM_EVENT_LIST)
 
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Chuck Lever

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 0370B773-BB98-49BD-9C9D-DFD3220CCC20-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org

#12 lore raw
Quoted 29 lines · Chuck Lever
Quoted 19 lines · Chuck Lever

These can be shared with all kernel ULPs, and more can easily be added as needed.

---
include/trace/events/rdma.h | 128 +++++++++++++++++++++++++++++++++++++++++++

1 file changed, 128 insertions(+)

create mode 100644 include/trace/events/rdma.h

Hi-

I'm putting together a series of patches for v4.16 (or later) that add static ftrace trace points to the RPC-over-RDMA client imple- mentation. As part of that effort, I've constructed some trace point helpers that might be useful for other kernel ULPs.

Quoted 6 lines

So far this patch adds just helpers that xprtrdma needs. It is not complete, but additional helpers can be introduced as they are needed.

I'd like to hear comments about these, or please let me know if such helpers already exist and where xprtrdma can find them.

Now that the question of whether new trace points will be allowed has been answered...

Quoted 6 lines

The helpers that are used for displaying errors in the kernel log display the spelled out text, not the symbolic name of the error code, as is done here.

Would the community prefer long-form text or symbolic error names in trace reports?

IMHO, short names are preferred. It is intended for the developers who have access to the code, so anyway they will check the meaning if necessary.

Thanks