Thread (13 messages) flat view 13 messages, 4 authors, 2021-11-17

Re: [PATCH net-next 1/2] net: snmp: add tracepoint support for snmp

From: Menglong Dong <hidden>
Date: 2021-11-17 13:56:44
Also in: lkml

On Wed, Nov 17, 2021 at 5:34 AM Steven Rostedt [off-list ref] wrote:
On Thu, 11 Nov 2021 21:35:29 +0800
menglong8.dong@gmail.com wrote:
quoted
+#define DEFINE_SNMP_EVENT(proto)                             \
+DEFINE_EVENT(snmp_template, snmp_##proto,                    \
+     TP_PROTO(struct sk_buff *skb, int field, int val),      \
+     TP_ARGS(skb, field, val)                                \
+)
+
+#define TRACE_SNMP(skb, proto, field, val) \
+     trace_snmp_##proto(skb, field, val)
+
+#endif
Why make a separate trace event for each protocol, and not just create an
enum that gets passed to the trace event? Then you could just filter on
what you want.
enn....I'm not sure, just feel comfortable to create a separate trace event for
each protocol. Maybe it is easier to use? However, making them together
seems more fridently to users who want to do statistics for all protocols. I'll
think over it~~~

Thanks!
Menglong Dong
-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help