|
Minimum LLVM version for bcc
This is a good question. For packaging purpose, no, it does not matter much. The people who builds package can choose whatever it is available to them to package. bcc is supposed to work for all major
This is a good question. For packaging purpose, no, it does not matter much. The people who builds package can choose whatever it is available to them to package. bcc is supposed to work for all major
|
By
Yonghong Song
· #1930
·
|
|
[Ext] Re: [iovisor-dev] Questions about current eBPF usages
e.g., in kernel/events/core.c, for perf event overflow handler, we have rcu_read_lock(); ret = BPF_PROG_RUN(event->prog, &ctx); rcu_read_unlock(); out: __this_cpu_dec(bpf_prog_active); if (!ret) retur
e.g., in kernel/events/core.c, for perf event overflow handler, we have rcu_read_lock(); ret = BPF_PROG_RUN(event->prog, &ctx); rcu_read_unlock(); out: __this_cpu_dec(bpf_prog_active); if (!ret) retur
|
By
Yonghong Song
· #1927
·
|
|
Questions about current eBPF usages
<jtu3=hawk.iit.edu@...> wrote: Currently, no. Kernel has support to replace a bpf program, but not kernel function. Replacing kernel functions may easily causing kernel mishehave. There
<jtu3=hawk.iit.edu@...> wrote: Currently, no. Kernel has support to replace a bpf program, but not kernel function. Replacing kernel functions may easily causing kernel mishehave. There
|
By
Yonghong Song
· #1925
·
|
|
Tracepoint/Kprobe for tracking inbound connections
XDP only tracks raw packet. There is no skb or other meta data is available at that point. You either need to track by yourself or you add another skb or sk level hook.
XDP only tracks raw packet. There is no skb or other meta data is available at that point. You either need to track by yourself or you add another skb or sk level hook.
|
By
Yonghong Song
· #1923
·
|
|
Tracepoint/Kprobe for tracking inbound connections
Maybe you can use sk_local_storage? You can attach a piece of information to the socket during TCP_SYN_RECV and later on during TCP_ESTABLISHED to check that data, and you can delete that data from th
Maybe you can use sk_local_storage? You can attach a piece of information to the socket during TCP_SYN_RECV and later on during TCP_ESTABLISHED to check that data, and you can delete that data from th
|
By
Yonghong Song
· #1913
·
|
|
Load BPF program at boot-time?
It is possible. See the patch below: https://lore.kernel.org/bpf/20200819042759.51280-1-alexei.starovoitov@... I tried to load a BPF program and pin it in bpffs system. The system could be exte
It is possible. See the patch below: https://lore.kernel.org/bpf/20200819042759.51280-1-alexei.starovoitov@... I tried to load a BPF program and pin it in bpffs system. The system could be exte
|
By
Yonghong Song
· #1911
·
|
|
Reading Pinned maps in eBPF Programs
You can use bpf_obj_get() API to get a reference to the pinned map. BPF_ANNOTATE_KV_PAIR is old way to provide map key/value types, mostly for pretty print. bcc still uses it. libbpf can use more adva
You can use bpf_obj_get() API to get a reference to the pinned map. BPF_ANNOTATE_KV_PAIR is old way to provide map key/value types, mostly for pretty print. bcc still uses it. libbpf can use more adva
|
By
Yonghong Song
· #1893
·
|
|
BPF Concurrency
You cannot use the return value. A recent llvm should return an error if you try to use it. There is some preliminary work to have more atomic operations in the BPF ISA. https://reviews.llvm.org/D7218
You cannot use the return value. A recent llvm should return an error if you try to use it. There is some preliminary work to have more atomic operations in the BPF ISA. https://reviews.llvm.org/D7218
|
By
Yonghong Song
· #1872
·
|
|
BPF Concurrency
BPF_XADD is to make one map element inside the kenel to update atomically. Could you filx an issue with more details? This way, we will have a better record. Not sure what do you mean here. yes, one c
BPF_XADD is to make one map element inside the kenel to update atomically. Could you filx an issue with more details? This way, we will have a better record. Not sure what do you mean here. yes, one c
|
By
Yonghong Song
· #1856
·
|
|
USDT probe to trace based on path to binary
Could you file a separate issue so it is easy for people to help? Do you have a minimum reproducible test case? This will make it easy to debug. application without pid should work. A test case will b
Could you file a separate issue so it is easy for people to help? Do you have a minimum reproducible test case? This will make it easy to debug. application without pid should work. A test case will b
|
By
Yonghong Song
· #1855
·
|
|
eBPF map - Control and Data plane concurrency
#bcc
Your approach seems okay. You can use two maps or use map-in-map. Using batch operation from user space should speedup the deletion operation.
Your approach seems okay. You can use two maps or use map-in-map. Using batch operation from user space should speedup the deletion operation.
|
By
Yonghong Song
· #1846
·
|
|
#bcc - skb_network_header crashes in a BPF Kernel trace function
#bcc
<ys114321=gmail.com@...> wrote: I see the issue now. ip_hdr(skb) eventually transforms to static inline unsigned char *skb_network_header(const struct sk_buff *skb) { return skb->head +
<ys114321=gmail.com@...> wrote: I see the issue now. ip_hdr(skb) eventually transforms to static inline unsigned char *skb_network_header(const struct sk_buff *skb) { return skb->head +
|
By
Yonghong Song
· #1844
·
|
|
#bcc - skb_network_header crashes in a BPF Kernel trace function
#bcc
You did not show the code which actually caused the problem. There must be code after "if ( (ip_Hdr.protocol != IPPROTO_TCP)) return 0;" . You may need bpf_probe_read() for memory accesses there.
You did not show the code which actually caused the problem. There must be code after "if ( (ip_Hdr.protocol != IPPROTO_TCP)) return 0;" . You may need bpf_probe_read() for memory accesses there.
|
By
Yonghong Song
· #1843
·
|
|
Array brace-enclosed initialization
The init list is too long. The compiler puts {0, 1, 2, ..., 9} in a readonly section. That is why you got the failure below. If you use native clang compilation and a recent kernel, libbpf should be a
The init list is too long. The compiler puts {0, 1, 2, ..., 9} in a readonly section. That is why you got the failure below. If you use native clang compilation and a recent kernel, libbpf should be a
|
By
Yonghong Song
· #1830
·
|
|
Can multiple BPF programs use same per-cpu perf ring buffer?
<halivingston@...> wrote: Yes, you can do this.
<halivingston@...> wrote: Yes, you can do this.
|
By
Yonghong Song
· #1807
·
|
|
Why is BPF_PERF_OUTPUT max_entries set to total processor count?
<halivingston@...> wrote: Perf event ring buffer is per cpu. Yes, it is what it did in the kernel. Each array element holds one ring buffer.
<halivingston@...> wrote: Perf event ring buffer is per cpu. Yes, it is what it did in the kernel. Each array element holds one ring buffer.
|
By
Yonghong Song
· #1803
·
|
|
Why is BPF_PERF_OUTPUT max_entries set to total processor count?
PERF_EVENT_OUTPUT map is to hold per cpu ring buffers created by perf_event_open. That is why its typical size is the number of cpus on the host. <halivingston@...> wrote:
PERF_EVENT_OUTPUT map is to hold per cpu ring buffers created by perf_event_open. That is why its typical size is the number of cpus on the host. <halivingston@...> wrote:
|
By
Yonghong Song
· #1801
·
|
|
Build error on current Amazon Linux 2
What is your llvm version? What is your cmake output? Looks like llvm libraries are not really linked?
What is your llvm version? What is your cmake output? Looks like llvm libraries are not really linked?
|
By
Yonghong Song
· #1787
·
|
|
[agenda] IO Visor TSC/Dev Meeting
Hi, All, Brenden is on vacation this week. So I am sending out the notice. Does anybody have any agenda to discuss on our pre-schedule 30min meeting on Sept 4, 11:00am - 11:30am? If you do, please rep
Hi, All, Brenden is on vacation this week. So I am sending out the notice. Does anybody have any agenda to discuss on our pre-schedule 30min meeting on Sept 4, 11:00am - 11:30am? If you do, please rep
|
By
Yonghong Song
· #1784
·
|
|
CPU Concurrency Issues
<arnaldo.melo@...> wrote: You did not miss anything. Currently, there are no counters to count those drops due to nmi or due to bpf program already running on that cpu. There is effort by Daniel
<arnaldo.melo@...> wrote: You did not miss anything. Currently, there are no counters to count those drops due to nmi or due to bpf program already running on that cpu. There is effort by Daniel
|
By
Yonghong Song
· #1783
·
|