This group is locked. No changes can be made to the group while it is locked.
|
Locked
Sticky
The iovisor-dev group has been locked.
This group is no longer maintained and has been locked at the request of moderator Alexei Starovoitov.
|
|
Accessing parameters and arguments for C++ functions using uprobes
Hello All, Just came across this old message on accessing parameters and arguments for C++ functions: https://lists.iovisor.org/g/iovisor-dev/message/1934?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3ACreated%2C%2Cposterid%3A5211156%2C20%2C2%2C0%2C78060277 “I am learning about ebpf and the bcc tools/library. I have a question about dynamic uprobe of C++ code. I have been able to attach a uprobe successfully by looking up the mangled symbol name. However, I am curious how the bpf program will access the parameters or arguments of a function I am probing. For a C++ object, do I just create an equivalent C struct that represents the application's C++ object/class, and then typecast the argument (from PT_REGS_PARM[x](ctx)) ?” I am wondering the same. \Rob
|
|
Questions about samples/bpf/sockex3_user.c
Hello iovisor friends, I found that there seems to be a problem in the eBPF sample source code of the Linux kernel samples/bpf/sockex3_user.c. This program contains the following code: printf("%s.%05d -> %s.%05d %12lld %12lld", inet_ntoa((struct in_addr){htonl(next_key.src)}), next_key.port16[0], inet_ntoa((struct in_addr){htonl(next_key.dst)}), next_key.port16[1], value.bytes, value.packets); the "port16[0]" is the source port and the "port16[1]" is the destination port. I found that "ports" was obtained in the following way when I view the samples/bpf/sockex3_kern.c: g->flow.ports = load_word(skb, nhoff); The byte order of my host is Little-Endian. In this case, port[1] should be the source port, while port[0] is the destination port.I tested this on my machine. Is this an error in this example?I hope I can get your answers and help. Thank you, Siyao Zhou
|
|
one-shot BPF program in the context of a specific PID
5
Hello iovisor friends, I'm curious what my options are for running a BPF program once, immediately, in the virtual memory context of a particular (user space) process. For example, say I want to read the current value from a known virtual memory address in the process' space. I'm curious if there's an official answer or, short of that, tricks that people might have used. What I want is similar in spirit to BPF_PROG_RUN, I think, except that I think I want my program type to be perf-event (and BPF_PROG_RUN doesn't seem to support this program type), and I want to also control specify which process I'm interested in. I feel like one solution might be around sending a signal to the process I'm interested in and placing a uprobe somewhere on the signal handling path, but I'm not sure of a general way to do this. Any suggestion is most welcome. Thank you! - Andrei
|
|
Print slow commit operations in nfsslower
3
Hi, I was using nfsslower in bcc tools and noticed that it doesn't print out slow commit operations, which sometimes cause long delays in NFS writes. I tried adding code to trace slow commit operations and created the attached patch. Please let me hear your opinions. NFS commits are quite slow and are not performed often, so the patch shouldn't incur visible overhead. Below is a sample output from the modified tool when writing a large file using dd command. Most commits are issued from kworker threads, so the commit output may be mostly dropped when filtered by PID. TIME COMM PID T BYTES OFF_KB LAT(ms) FILENAME ... 16:46:11 dd 1212 W 1048576 651264 46.58 testfile 16:46:11 dd 1212 W 1048576 653312 54.41 testfile 16:46:11 dd 1212 W 1048576 654336 18.96 testfile 16:46:11 dd 1212 W 1048576 655360 49.05 testfile 16:46:11 dd 1212 W 1048576 657408 82.96 testfile 16:46:11 dd 1212 W 1048576 659456 109.25 testfile 16:46:12 dd 1212 W 1048576 660480 163.55 testfile 16:46:12 dd 1212 W 1048576 662528 205.44 testfile 16:46:13 dd 1212 W 1048576 663552 751.02 testfile 16:46:37 kworker/u8:5 1207 C 0 0 27449.05 testfile 16:46:37 kworker/u8:5 1207 C 0 0 26725.16 testfile 16:46:37 kworker/u8:5 1207 C 0 0 27592.04 testfile 16:46:37 kworker/u8:4 1206 C 0 0 22188.75 testfile 16:46:37 kworker/u8:4 1206 C 0 0 26092.59 testfile 16:46:37 kworker/u8:4 1206 C 0 0 27268.90 testfile 16:46:37 kworker/u8:4 1206 C 0 0 22303.24 testfile 16:46:37 kworker/u8:4 1206 C 0 0 27081.34 testfile 16:46:37 dd 1212 W 1048576 664576 24337.80 testfile 16:46:38 dd 1212 W 1048576 958464 61.77 testfile 16:46:38 dd 1212 W 1048576 960512 56.60 testfile 16:46:38 dd 1212 W 1048576 963584 55.75 testfile 16:46:38 dd 1212 W 1048576 965632 54.84 testfile ... Best regards. --- Kosuke TATSUKAWA | 1st Platform Software Division | NEC Solution Innovators | tatsu-ab1@... ------------------------------------------------------------------------ diff -rup a/tools/nfsslower.py b/tools/nfsslower.py --- a/tools/nfsslower 2022-11-14 12:39:23.677073240 +0900 +++ b/tools/nfsslower 2022-11-14 14:44:49.960073240 +0900 @@ -9,6 +9,8 @@ # This script traces some common NFS operations: read, write, opens and # getattr. It measures the time spent in these operations, and prints details # for each that exceeded a threshold. +# The script also traces commit operations, which is specific to nfs and could +# be pretty slow. # # WARNING: This adds low-overhead instrumentation to these NFS operations, # including reads and writes from the file system cache. Such reads and writes @@ -25,6 +27,8 @@ # Currently there aren't any tracepoints available for nfs_read_file, # nfs_write_file and nfs_open_file, nfs_getattr does have entry and exit # tracepoints but we chose to use kprobes for consistency +# Raw tracepoints are used to trace nfs:nfs_initiate_commit and +# nfs:nfs_commit_done. # # 31-Aug-2017 Samuel Nair created this. Should work with NFSv{3,4} @@ -41,8 +45,8 @@ examples = """ ./nfsslower -p 121 # trace pid 121 only """ parser = argparse.ArgumentParser( - description="""Trace READ, WRITE, OPEN \ -and GETATTR NFS calls slower than a threshold,\ + description="""Trace READ, WRITE, OPEN, GETATTR \ +and COMMIT NFS calls slower than a threshold,\ supports NFSv{3,4}""", formatter_class=argparse.RawDescriptionHelpFormatter, epilog=examples) @@ -66,11 +70,13 @@ bpf_text = """ #include <linux/fs.h> #include <linux/sched.h> #include <linux/dcache.h> +#include <linux/nfs_fs.h> #define TRACE_READ 0 #define TRACE_WRITE 1 #define TRACE_OPEN 2 #define TRACE_GETATTR 3 +#define TRACE_COMMIT 4 struct val_t { u64 ts; @@ -79,6 +85,12 @@ struct val_t { struct dentry *d; }; +struct commit_t { + u64 ts; + u64 offset; + u64 count; +}; + struct data_t { // XXX: switch some to u32's when supported u64 ts_us; @@ -93,6 +105,7 @@ struct data_t { BPF_HASH(entryinfo, u64, struct val_t); BPF_PERF_OUTPUT(events); +BPF_HASH(commitinfo, u64, struct commit_t); int trace_rw_entry(struct pt_regs *ctx, struct kiocb *iocb, struct iov_iter *data) @@ -227,6 +240,56 @@ int trace_getattr_return(struct pt_regs return trace_exit(ctx, TRACE_GETATTR
|
|
Tracing queries within DB transactions with dbslower
2
Hello, as part of a university project I am analysing the dbslower tool to evaluate the performance cost of tracing the queries and to test what can be traced with it. As MySQL dropped support for Dtrace for v8.0+ I am using the alternative with uprobes. During my own testing with MySQL v8.0.28 I found out that regular queries get traced without issues, but if they are within a transaction only the queries b'START TRANSACTION' and b'COMMIT' are detected and none of the queries within the transaction get traced. Is there a way to adapt the tracing to include the queries within a transaction aswell, e.g. by adapting the mysql_func_name? Best regards, Kevin Maier
|
|
Questions about cachetop.py tool
#bcc
I have some questions about cachetop.py tool. Why the total accesses is defined as the times of entering mark_page_accessed plus mark_buffer_dirty functions? Doesn't enter mark_buffer_dirty must also enter mark_page_accessed, that is, doesn't they overlap? I don't really get it...... If someone can tell me why, I will be grateful!
|
|
Parsing Non linear packet payload in TC BPF programs
Hi all, We are parsing DHCP packets in TC egress program, In our case, the packet after the UDP header was not present in between skb->data and skb->data_end. On further investigation we found that it lies in non-linear portion. and we have bpf_skb_pull_data(skb,len) to direct access non-linear data. Few questions based on above: 1. After call to bpf_skb_pull_data(skb, skb->len); the value of skb->data and skb->data_end pointers changed. Can there be any implication down the stack with change in value of skb->data pointer. Also is this helper function analogous to skb_pull which changes the skb->data pointer and is typically moved when the packet goes up the stack as a result of packet being parsed on that layer? Do we have something similar to skb_linearize() in BPF or any other way to parse non-linear portion? 2. For our case, packet after the UDP header was in non-linear portion, can it happen that packet after IP header go in non-linear or packet after ethernet-header? Regards, Deepankur
|
|
Looking for some bcc issues for new bie
2
Hi I am looking for some bcc issues for newbie. Any link ? Jules ..
|
|
LPC 2022 Networking and BPF Track CFP (Final Reminder)
This is the final reminder for the Call for Proposals (CFP) for the Networking and BPF track at the 2022 edition of the Linux Plumbers Conference (LPC), which is planned to be held in Dublin, Ireland, on September 12th - 14th, 2022. Note that the conference is planned to be both in person and remote (hybrid). CFP submitters should ideally be able to give their presentation in person to minimize technical issues if circumstances permit, although presenting remotely will also be possible. This year's Networking and BPF track technical committee is comprised of: David S. Miller <davem@...> Jakub Kicinski <kuba@...> Paolo Abeni <pabeni@...> Eric Dumazet <edumazet@...> Alexei Starovoitov <ast@...> Daniel Borkmann <daniel@...> Andrii Nakryiko <andrii@...> We are seeking proposals of 40 minutes in length (including Q&A discussion). Any kind of advanced Linux networking and/or BPF related topic will be considered. Please submit your proposals through the official LPC website at: https://lpc.events/event/16/abstracts/ Make sure to select "eBPF & Networking" in the track pull-down menu. Proposals must be submitted by August 10th, and submitters will be notified of acceptance by August 12th. Final slides (as PDF) are due on the first day of the conference. We are very much looking forward to a great conference and seeing you all!
|
|
LPC 2022 Networking and BPF Track CFP (Reminder)
This is a reminder for the Call for Proposals (CFP) for the Networking and BPF track at the 2022 edition of the Linux Plumbers Conference (LPC), which is planned to be held in Dublin, Ireland, on September 12th - 14th, 2022. Note that the conference is planned to be both in person and remote (hybrid). CFP submitters should ideally be able to give their presentation in person to minimize technical issues if circumstances permit, although presenting remotely will also be possible. This year's Networking and BPF track technical committee is comprised of: David S. Miller <davem@...> Jakub Kicinski <kuba@...> Paolo Abeni <pabeni@...> Eric Dumazet <edumazet@...> Alexei Starovoitov <ast@...> Daniel Borkmann <daniel@...> Andrii Nakryiko <andrii@...> We are seeking proposals of 40 minutes in length (including Q&A discussion). Any kind of advanced Linux networking and/or BPF related topic will be considered. Please submit your proposals through the official LPC website at: https://lpc.events/event/16/abstracts/ Make sure to select "eBPF & Networking" in the track pull-down menu. Proposals must be submitted by August 10th, and submitters will be notified of acceptance by August 12th. Final slides (as PDF) are due on the first day of the conference. We are very much looking forward to a great conference and seeing you all!
|
|
stackcount return *blank* stack.
https://github.com/iovisor/bcc/issues/3891 I have the same issue, anyone can help me to fix it?
|
|
LPC 2022 Networking and BPF Track CFP
We are pleased to announce the Call for Proposals (CFP) for the Networking and BPF track at the 2022 edition of the Linux Plumbers Conference (LPC), which is planned to be held in Dublin, Ireland, on September 12th - 14th, 2022. Note that the conference is planned to be both in person and remote (hybrid). CFP submitters should ideally be able to give their presentation in person to minimize technical issues if circumstances permit, although presenting remotely will also be possible. This year's Networking and BPF track technical committee is comprised of: David S. Miller <davem@...> Jakub Kicinski <kuba@...> Paolo Abeni <pabeni@...> Eric Dumazet <edumazet@...> Alexei Starovoitov <ast@...> Daniel Borkmann <daniel@...> Andrii Nakryiko <andrii@...> We are seeking proposals of 40 minutes in length (including Q&A discussion). Any kind of advanced Linux networking and/or BPF related topic will be considered. Please submit your proposals through the official LPC website at: https://lpc.events/event/16/abstracts/ Make sure to select "eBPF & Networking" in the track pull-down menu. Proposals must be submitted by August 10th, and submitters will be notified of acceptance by August 12th. Final slides (as PDF) are due on the first day of the conference. We are very much looking forward to a great conference and seeing you all!
|
|
RPI install with snapcraft
I installed on latest Raspbian (bullseye) with Snapcraft. However, when I tried to run hello_world.py with python3, I got modprobe: FATAL: Module kheaders not found in directory /lib/modules/5.10.63-v7+ Unable to find kernel headers. Try rebuilding kernel with CONFIG_IKHEADERS=m (mo dule) or installing the kernel development package for your running kernel versi on. chdir(/lib/modules/5.10.63-v7+/build): No such file or directory Traceback (most recent call last): File "/bcc/examples/./hello_world.py", line 12, in <module> BPF(text='int kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World! \\n"); return 0; }').trace_print() File "/usr/lib/python3/dist-packages/bcc/__init__.py", line 364, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> I guess this means I have to rebuild kernel? Thanks so much in advance Joe
|
|
#bcc Count map.ringbuf_reserve() failures
4
#bcc
Thought I added the #bcc tag but I no longer see it :( So just in case, it's not clear, this is with BCC.
|
|
Count map.ringbuf_reserve() failures
Hi, Was wondering if there is a way to count the number of times map.ringbuf_reserve() fails for a BPF_RINGBUF_OUTPUT buffer? This way I can get notified in userspace that I have missed events, and might need to increase the buffer size. Cheers, Eelco
|
|
Access packet payload in TC egress programs
5
Dear all, how can I access the payload of the packet in a program attached to the TC egress hook (SCHED_CLS attached to clsact qdisc)? ctx->data_end points to the end of the L4 header, while on the ingress hook it points to the end of the packet (tested on kernel v5.14). Best regards, Federico Parola
|
|
Tracing CPU utilisation
2
Hi, Can someone please let me know that there is any way to get a CPU profile for a specific function using eBPF? Thanks & Regards, Ragalahari
|
|
LPC 2021 Networking and BPF Track CFP (2nd reminder)
This is a reminder for the Call for Proposals (CFP) for the Networking and BPF track at the 2021 edition of the Linux Plumbers Conference (LPC), which will be held virtually on the wider Internet, on September 20th - 24th, 2021. This year's Networking and BPF track technical committee is comprised of: David S. Miller <davem@...> Jakub Kicinski <kuba@...> Eric Dumazet <edumazet@...> Alexei Starovoitov <ast@...> Daniel Borkmann <daniel@...> Andrii Nakryiko <andrii@...> We are seeking proposals of 40 minutes in length (including Q&A discussion), optionally accompanied by papers of 2 to 10 pages in length. Any kind of advanced Linux networking and/or BPF related topic will be considered. Please submit your proposals through the official LPC website at: https://linuxplumbersconf.org/event/11/abstracts/ Make sure to select "Networking & BPF Summit" in the Track pull-down menu. Proposals must be submitted by August 13th, and submitters will be notified of acceptance by August 16th. Final slides and papers (as PDF) are due on the first day of the conference.
|
|
LPC 2021 Networking and BPF Track CFP (Reminder)
This is a reminder for the Call for Proposals (CFP) for the Networking and BPF track at the 2021 edition of the Linux Plumbers Conference (LPC), which will be held virtually on the wider Internet, on September 20th - 24th, 2021. This year's Networking and BPF track technical committee is comprised of: David S. Miller <davem@...> Jakub Kicinski <kuba@...> Eric Dumazet <edumazet@...> Alexei Starovoitov <ast@...> Daniel Borkmann <daniel@...> Andrii Nakryiko <andrii@...> We are seeking proposals of 40 minutes in length (including Q&A discussion), optionally accompanied by papers of 2 to 10 pages in length. Any kind of advanced Linux networking and/or BPF related topic will be considered. Please submit your proposals through the official LPC website at: https://linuxplumbersconf.org/event/11/abstracts/ Make sure to select "Networking & BPF Summit" in the Track pull-down menu. Proposals must be submitted by August 13th, and submitters will be notified of acceptance by August 16th. Final slides and papers (as PDF) are due on the first day of the conference.
|