netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Martin KaFai Lau <kafai@fb.com>
Cc: Yonghong Song <yhs@fb.com>,
	peterz@infradead.org, ast@fb.com, daniel@iogearbox.net,
	netdev@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH bpf-next v3 2/7] bpf: introduce bpf subcommand BPF_TASK_FD_QUERY
Date: Wed, 23 May 2018 14:04:01 -0700	[thread overview]
Message-ID: <20180523210359.dz2zwqcb76hebrtn@ast-mbp> (raw)
In-Reply-To: <20180523171320.ziswsvpsyelxb6fz@kafai-mbp>

On Wed, May 23, 2018 at 10:13:22AM -0700, Martin KaFai Lau wrote:
> > +		__u32		prog_id;	/* output: prod_id */
> > +		__u32		attach_info;	/* output: BPF_ATTACH_* */
> > +		__u64		probe_offset;	/* output: probe_offset */
> > +		__u64		probe_addr;	/* output: probe_addr */
> > +	} task_fd_query;
> >  } __attribute__((aligned(8)));
> >  
> >  /* The description below is an attempt at providing documentation to eBPF
> > @@ -2458,4 +2475,14 @@ struct bpf_fib_lookup {
> >  	__u8	dmac[6];     /* ETH_ALEN */
> >  };
> >  
> > +/* used by <task, fd> based query */
> > +enum {
> Nit. Instead of a comment, is it better to give this
> enum a descriptive name?
> 
> > +	BPF_ATTACH_RAW_TRACEPOINT,	/* tp name */
> > +	BPF_ATTACH_TRACEPOINT,		/* tp name */
> > +	BPF_ATTACH_KPROBE,		/* (symbol + offset) or addr */
> > +	BPF_ATTACH_KRETPROBE,		/* (symbol + offset) or addr */
> > +	BPF_ATTACH_UPROBE,		/* filename + offset */
> > +	BPF_ATTACH_URETPROBE,		/* filename + offset */
> > +};

One more nit here.
Can we come up with better names for the above?
'attach' is a verb. I cannot help but read above as it's an action
for the kernel to attach to something and not the type of event
where the program was attached to.
Since we pass task+fd into that BPF_TASK_FD_QUERY command how
about returning BPF_FD_TYPE_KPROBE, BPF_FD_TYPE_TRACEPOINT, ... ?

  reply	other threads:[~2018-05-23 21:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22 16:30 [PATCH bpf-next v3 0/7] bpf: implement BPF_TASK_FD_QUERY Yonghong Song
2018-05-22 16:30 ` [PATCH bpf-next v3 1/7] perf/core: add perf_get_event() to return perf_event given a struct file Yonghong Song
2018-05-22 16:30 ` [PATCH bpf-next v3 2/7] bpf: introduce bpf subcommand BPF_TASK_FD_QUERY Yonghong Song
2018-05-23 17:13   ` Martin KaFai Lau
2018-05-23 21:04     ` Alexei Starovoitov [this message]
2018-05-23 21:27       ` Yonghong Song
2018-05-23 21:25     ` Yonghong Song
2018-05-22 16:30 ` [PATCH bpf-next v3 3/7] tools/bpf: sync kernel header bpf.h and add bpf_trace_event_query in libbpf Yonghong Song
2018-05-22 16:30 ` [PATCH bpf-next v3 4/7] tools/bpf: add ksym_get_addr() in trace_helpers Yonghong Song
2018-05-23 17:16   ` Martin KaFai Lau

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=20180523210359.dz2zwqcb76hebrtn@ast-mbp \
    --to=alexei.starovoitov@gmail.com \
    --cc=ast@fb.com \
    --cc=daniel@iogearbox.net \
    --cc=kafai@fb.com \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=yhs@fb.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).