BPF List
 help / color / mirror / Atom feed
From: Philo Lu <lulie@linux.alibaba.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Shung-Hsi Yu <shung-hsi.yu@suse.com>,
	bpf@vger.kernel.org, song@kernel.org, andrii@kernel.org,
	ast@kernel.org, Daniel Borkmann <daniel@iogearbox.net>,
	xuanzhuo@linux.alibaba.com, dust.li@linux.alibaba.com,
	guwen@linux.alibaba.com, alibuda@linux.alibaba.com,
	hengqi@linux.alibaba.com, Nathan Slingerland <slinger@meta.com>,
	"rihams@meta.com" <rihams@meta.com>,
	Alan Maguire <alan.maguire@oracle.com>,
	Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: Question about bpf perfbuf/ringbuf: pinned in backend with overwriting
Date: Fri, 22 Dec 2023 20:25:22 +0800	[thread overview]
Message-ID: <34d790e0-d820-4d24-abe9-89c7a41879cd@linux.alibaba.com> (raw)
In-Reply-To: <20231221094917.20718e9b@gandalf.local.home>

Thank you very much for your reply, making me understand ftrace buffer 
better.

I think it feasible to implement a new type of bpf map based on ftrace 
buffer. As for user interface, perhaps representing as files is still a 
good choice (like tracefs for ftrace)? But we should make sure that each 
map use a exclusive directory.

Also, I have tried relay map and submitted the patches [0], and any 
comment is welcome. Its behavior is exactly what I describe above. The 
buffer is represented as files in debugfs (`/sys/kernel/debug/`), one 
directory for one map. Users can get data with read or mmap interfaces.

The relay interface is also designed as a sub-buffer structure. It is 
light-weighted and provides users with much flexibility to formulate and 
process the data. Meanwhile, ftrace buffer provides thorough 
consideration for various use cases, so that users just care about the 
data entry by entry. It seems that ftrace buffer could be a better 
alternative of perfbuf. Therefore, I think it possible that relay and 
ftrace buffer coexist as bpf maps.

Wish you all happy holidays :)

[0]
https://lore.kernel.org/all/20231222122146.65519-1-lulie@linux.alibaba.com/

      reply	other threads:[~2023-12-22 12:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 13:15 Question about bpf perfbuf/ringbuf: pinned in backend with overwriting Philo Lu
2023-12-07 14:48 ` Alan Maguire
2023-12-08 22:32   ` Andrii Nakryiko
2023-12-11 12:39     ` Philo Lu
2023-12-13 23:35       ` Andrii Nakryiko
2023-12-15 10:10         ` Philo Lu
2023-12-15 22:39           ` Andrii Nakryiko
2023-12-16  8:50             ` Dmitry Vyukov
2023-12-18 12:58               ` Philo Lu
2023-12-19 19:25               ` Andrii Nakryiko
2023-12-19  6:23         ` Shung-Hsi Yu
2023-12-19 13:38           ` Steven Rostedt
2023-12-19 17:01             ` Alexei Starovoitov
2023-12-19 17:28             ` Steven Rostedt
2023-12-21 13:00             ` Philo Lu
2023-12-21 14:49               ` Steven Rostedt
2023-12-22 12:25                 ` Philo Lu [this message]

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=34d790e0-d820-4d24-abe9-89c7a41879cd@linux.alibaba.com \
    --to=lulie@linux.alibaba.com \
    --cc=alan.maguire@oracle.com \
    --cc=alibuda@linux.alibaba.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dust.li@linux.alibaba.com \
    --cc=guwen@linux.alibaba.com \
    --cc=hengqi@linux.alibaba.com \
    --cc=mhiramat@kernel.org \
    --cc=rihams@meta.com \
    --cc=rostedt@goodmis.org \
    --cc=shung-hsi.yu@suse.com \
    --cc=slinger@meta.com \
    --cc=song@kernel.org \
    --cc=xuanzhuo@linux.alibaba.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