All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: rostedt <rostedt@goodmis.org>
Cc: "Geneviève Bastien" <gbastien@versatic.net>,
	"David S. Miller" <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>, "Ingo Molnar" <mingo@redhat.com>
Subject: Re: [PATCH v2] net: Add trace events for all receive exit points
Date: Mon, 12 Nov 2018 15:56:17 -0500 (EST)	[thread overview]
Message-ID: <1612949188.4054.1542056177765.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <1354786248.4048.1542055613213.JavaMail.zimbra@efficios.com>

----- On Nov 12, 2018, at 3:46 PM, Mathieu Desnoyers mathieu.desnoyers@efficios.com wrote:

> ----- On Nov 12, 2018, at 3:40 PM, rostedt rostedt@goodmis.org wrote:
> 
>> On Mon, 12 Nov 2018 15:20:55 -0500 (EST)
>> Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:
>> 
>>> 
>>> Hrm, looking at this again, I notice that there is a single DEFINE_EVENT
>>> using net_dev_template_simple.
>>> 
>>> We could simply turn netif_receive_skb_list_exit into a TRACE_EVENT(),
>>> remove the net_dev_template_simple, and rename the net_dev_template_return
>>> to net_dev_template ?
>> 
>> This too is only cosmetic and doesn't affect the code at all, because a
>> TRACE_EVENT() is really just:
>> 
>> #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
>>	DECLARE_EVENT_CLASS(name,			       \
>>			     PARAMS(proto),		       \
>>			     PARAMS(args),		       \
>>			     PARAMS(tstruct),		       \
>>			     PARAMS(assign),		       \
>>			     PARAMS(print));		       \
>>	DEFINE_EVENT(name, name, PARAMS(proto), PARAMS(args));
>> 
>> -- Steve
>> 
> 
> Of course.
> 
> I also notice that in two cases, a "gro_result_t" is implicitly cast
> to "int". I usually frown upon this kind of stuff, because it's asking
> for trouble if gro_result_t typedef to something else than "int" in the
> future.
> 
> I would recommend going for two templates, one which takes a "int"
> ret parameter, and the other a "gro_result_t" ret parameter.
> 
> Or am I being too cautious ?

Digging further, gro_result_t maps to:

enum gro_result {
        GRO_MERGED,
        GRO_MERGED_FREE,
        GRO_HELD,
        GRO_NORMAL,
        GRO_DROP,
        GRO_CONSUMED,
};
typedef enum gro_result gro_result_t;

So we should add a TRACE_DEFINE_ENUM() for those.

Thanks,

Mathieu



> 
> Thanks,
> 
> Mathieu
> 
> 
>>> 
>>> It's pretty clear from the prototype that it expects a "ret" argument,
>>> so I don't see the need to also state it in the template name.
>>> 
> 
> --
> Mathieu Desnoyers
> EfficiOS Inc.
> http://www.efficios.com

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

  reply	other threads:[~2018-11-13  6:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12 19:44 [PATCH v2] net: Add trace events for all receive exit points Geneviève Bastien
2018-11-12 20:09 ` Mathieu Desnoyers
2018-11-12 20:20   ` Mathieu Desnoyers
2018-11-12 20:37     ` Mathieu Desnoyers
2018-11-12 20:40     ` Steven Rostedt
2018-11-12 20:46       ` Mathieu Desnoyers
2018-11-12 20:56         ` Mathieu Desnoyers [this message]
2018-11-13  1:47         ` Steven Rostedt
2018-11-12 20:32 ` Steven Rostedt

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=1612949188.4054.1542056177765.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=davem@davemloft.net \
    --cc=gbastien@versatic.net \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=rostedt@goodmis.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.