All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastiano Miano <sebastiano.miano@polito.it>
To: netdev@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net
Cc: mingo@redhat.com, rostedt@goodmis.org, brouer@redhat.com,
	fulvio.risso@polito.it
Subject: [bpf-next PATCH 2/3] bpf: add id to prog tracepoint
Date: Wed, 18 Apr 2018 17:30:53 +0200	[thread overview]
Message-ID: <152406545357.3465.11912320259045335712.stgit@localhost.localdomain> (raw)
In-Reply-To: <152406544226.3465.948692097697975172.stgit@localhost.localdomain>

This patch adds the prog id to the bpf tracepoints
that can be used when monitoring or inspecting prog
related functions.

Signed-off-by: Sebastiano Miano <sebastiano.miano@polito.it>
Suggested-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
 include/trace/events/bpf.h |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/include/trace/events/bpf.h b/include/trace/events/bpf.h
index d7c9726..4ec19c5 100644
--- a/include/trace/events/bpf.h
+++ b/include/trace/events/bpf.h
@@ -65,16 +65,19 @@ DECLARE_EVENT_CLASS(bpf_prog_event,
 	TP_STRUCT__entry(
 		__array(u8, prog_tag, 8)
 		__field(u32, type)
+		__field(u32, id)
 	),
 
 	TP_fast_assign(
 		BUILD_BUG_ON(sizeof(__entry->prog_tag) != sizeof(prg->tag));
 		memcpy(__entry->prog_tag, prg->tag, sizeof(prg->tag));
 		__entry->type = prg->type;
+		__entry->id   = prg->aux->id;
 	),
 
-	TP_printk("prog=%s type=%s",
+	TP_printk("prog=%s id=%u type=%s",
 		  __print_hex_str(__entry->prog_tag, 8),
+		  __entry->id,
 		  __print_symbolic(__entry->type, __PROG_TYPE_SYM_TAB))
 );
 
@@ -102,6 +105,7 @@ TRACE_EVENT(bpf_prog_load,
 		__array(u8, prog_tag, 8)
 		__field(u32, type)
 		__field(int, ufd)
+		__field(u32, id)
 	),
 
 	TP_fast_assign(
@@ -109,10 +113,12 @@ TRACE_EVENT(bpf_prog_load,
 		memcpy(__entry->prog_tag, prg->tag, sizeof(prg->tag));
 		__entry->type = prg->type;
 		__entry->ufd  = ufd;
+		__entry->id   = prg->aux->id;
 	),
 
-	TP_printk("prog=%s type=%s ufd=%d",
+	TP_printk("prog=%s id=%u type=%s ufd=%d",
 		  __print_hex_str(__entry->prog_tag, 8),
+		  __entry->id,
 		  __print_symbolic(__entry->type, __PROG_TYPE_SYM_TAB),
 		  __entry->ufd)
 );
@@ -161,6 +167,7 @@ DECLARE_EVENT_CLASS(bpf_obj_prog,
 		__array(u8, prog_tag, 8)
 		__field(int, ufd)
 		__string(path, pname->name)
+		__field(u32, id)
 	),
 
 	TP_fast_assign(
@@ -168,10 +175,12 @@ DECLARE_EVENT_CLASS(bpf_obj_prog,
 		memcpy(__entry->prog_tag, prg->tag, sizeof(prg->tag));
 		__assign_str(path, pname->name);
 		__entry->ufd = ufd;
+		__entry->id  = prg->aux->id;
 	),
 
-	TP_printk("prog=%s path=%s ufd=%d",
+	TP_printk("prog=%s id=%u path=%s ufd=%d",
 		  __print_hex_str(__entry->prog_tag, 8),
+		  __entry->id,
 		  __get_str(path), __entry->ufd)
 );
 

  parent reply	other threads:[~2018-04-18 15:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18 15:30 [bpf-next PATCH 0/3] Add ID to bpf_map/prog tracepoints Sebastiano Miano
2018-04-18 15:30 ` [bpf-next PATCH 1/3] bpf: add id to map tracepoint Sebastiano Miano
2018-04-19  9:08   ` Jesper Dangaard Brouer
2018-04-18 15:30 ` Sebastiano Miano [this message]
2018-04-19  9:10   ` [bpf-next PATCH 2/3] bpf: add id to prog tracepoint Jesper Dangaard Brouer
2018-04-18 15:30 ` [bpf-next PATCH 3/3] bpf: add sample program to trace map events Sebastiano Miano
2018-04-19  9:20   ` Jesper Dangaard Brouer
2018-04-20  0:27   ` Alexei Starovoitov
2018-04-20  9:47     ` Jesper Dangaard Brouer
2018-04-23 14:08       ` Sebastiano Miano
2018-04-23 20:08         ` Alexei Starovoitov
2018-04-23 20:22           ` Jesper Dangaard Brouer

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=152406545357.3465.11912320259045335712.stgit@localhost.localdomain \
    --to=sebastiano.miano@polito.it \
    --cc=ast@kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=fulvio.risso@polito.it \
    --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.