From: Jesper Dangaard Brouer <brouer@redhat.com>
To: David Ahern <dsahern@gmail.com>
Cc: netdev@vger.kernel.org, pstaszewski@itcare.pl, brouer@redhat.com
Subject: Re: [PATCH] qdisc: add tracepoint qdisc:qdisc_dequeue for dequeued SKBs
Date: Wed, 16 Aug 2017 07:15:15 +0200 [thread overview]
Message-ID: <20170816071515.48d9cc7b@redhat.com> (raw)
In-Reply-To: <6f213e4e-601d-fc84-35d8-8fd9fc0748e7@gmail.com>
On Tue, 15 Aug 2017 20:31:44 -0600
David Ahern <dsahern@gmail.com> wrote:
> On 8/15/17 1:11 PM, Jesper Dangaard Brouer wrote:
> > diff --git a/include/trace/events/qdisc.h b/include/trace/events/qdisc.h
> > new file mode 100644
> > index 000000000000..60d0d8bd336d
> > --- /dev/null
> > +++ b/include/trace/events/qdisc.h
> > @@ -0,0 +1,50 @@
> > +#undef TRACE_SYSTEM
> > +#define TRACE_SYSTEM qdisc
> > +
> > +#if !defined(_TRACE_QDISC_H) || defined(TRACE_HEADER_MULTI_READ)
> > +#define _TRACE_QDISC_H_
> > +
> > +#include <linux/skbuff.h>
> > +#include <linux/netdevice.h>
> > +#include <linux/tracepoint.h>
> > +#include <linux/ftrace.h>
> > +
> > +TRACE_EVENT(qdisc_dequeue,
> > +
> > + TP_PROTO(struct Qdisc *qdisc, const struct netdev_queue *txq,
> > + int packets, struct sk_buff *skb),
> > +
> > + TP_ARGS(qdisc, txq, packets, skb),
> > +
> > + TP_STRUCT__entry(
> > + __field( struct Qdisc *, qdisc )
> > + __field(const struct netdev_queue *, txq )
>
> Why save qdisc and txq pointers in the tracepoint data?
I wanted to attach a BPF program, and allow it to dereference these
pointers. Which is done via bpf_probe_read like:
unsigned int qdisc_flags;
bpf_probe_read(&qdisc_flags, sizeof(qdisc_flags), &ctx->qdisc->flags);
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
next prev parent reply other threads:[~2017-08-16 5:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-15 19:11 [PATCH] qdisc: add tracepoint qdisc:qdisc_dequeue for dequeued SKBs Jesper Dangaard Brouer
2017-08-16 2:31 ` David Ahern
2017-08-16 5:15 ` Jesper Dangaard Brouer [this message]
2017-08-16 21:09 ` David Miller
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=20170816071515.48d9cc7b@redhat.com \
--to=brouer@redhat.com \
--cc=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pstaszewski@itcare.pl \
/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.