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@xxxxxxxxxxxxxxxxx/