Re: [EXPERIENCE] My experience on using perf record BPF filter on a real usecase

From: Alexei Starovoitov
Date: Wed Jun 10 2015 - 02:42:23 EST


On 6/4/15 3:17 AM, Wangnan (F) wrote:
Hi all,

I'd like to share my exprience on using 'perf record' BPF filter in a
real usecase to show the power and shortcome in my patch series:

thanks for sharing!

Here is another inconvenience. Currently I only concern on write
syscall issued by iozone. However, without '-a' I'm unable to collect
information of the locker. If I want to filter sys_{enter,exit}_write
belong to iozone out using eBPF, I need to implement another function
like BPF_FUNC_git_comm. Another method is to use perf '--filter' after
the two events. However it looks strange to use two filter mechanisms
together. This time I choose to do filtering offline using perf script.

that doesn't sound clean.
btw, I've been playing for a while with
bpf_get_current_task_info() helper:
https://git.kernel.org/cgit/linux/kernel/git/ast/bpf.git/commit/?id=c5453ffa107ddf95a91920cc947bb8bf9eab16d6
I think it's a better mechanism.
The user can get pid only via:
u32 pid = 0;
bpf_get_current_task_info(&pid, sizeof(pid));
or full pid + comm + future fields via full 'struct bpf_task_info'
Thoughts?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/