Comments (3)
Well, basically your script is generating more data than ply can keep up with. By default ply will then exit rather than providing incomplete data; you can override this behavior with the -k
option.
In general, using print
/printf
for these kinds of hot paths is not very useful. I would suggest trying to either filter the output using some predicate (e.g. are you only interested in a particular comm
/pid
) or aggregate the data (e.g. tracepoint:syscalls/sys_enter_close { @[data->fd] = count(); }
).
Re: poll(2)
vs. epoll(7)
Could you elaborate on the inferior performance of poll(2)
? There is one fd per cpu in the poll set, so unless you are on a massive machine, I don't really see how that would matter much.
Re: perf vs ftrace
Not sure what you are referring to. The code uses perf events because that was the mechanism available at the time this code was written. Nowadays you could also use a bpf ring buffer, but I fail to see how this relates to ftrace.
from ply.
thanks for your perfect replying.
poll(2) vs. epoll(7):
Although both sleep and alternate, select and poll need to traverse the entire FD set when they are "awake", while epoll only needs to judge whether the ready list is empty when they are "awake", which saves a lot of CPU time. This is the performance improvement brought by the callback mechanism.
perf vs ftrace:
you are right. BPF ringbuf is gooder than perfbuf. maybe i mistake ftrace for BPF .
from ply.
I understand how epoll works. I just don't know if I buy the argument that traversing a small array is the limiting factor here. You would have to measure of course, but my guess would be that you are limited by whatever medium you are writing the output to (tty/disk/whatever).
Anyway, if I ever get around to improving this code, it will be to replace the perf event with a bpf ring buffer. In that case the poll set will shrink down to 1, so poll will most likely continue to work just fine.
from ply.
Related Issues (20)
- build ply for arm64 target HOT 1
- cross compiling issue, run time error HOT 7
- help writing a program using ply HOT 5
- feature request: add module name to backtrace HOT 1
- YACC build error in ubuntu 18.04
- ply in QEMU: error: unable to create map 'stdbuf', errno:38 HOT 7
- question about cross compile HOT 4
- compile error HOT 6
- debugfs needs to be mounted before starting ply HOT 9
- How
- What's the reason about this error: syntax error, unexpected IDENT, expecting ')' ? HOT 1
- errno 22 on kprobe loading but the ply script runs! HOT 2
- Embedded linux system:Verifying kprobe... ERR:-22 HOT 3
- Does the "field:__data_loc " supported? HOT 3
- tracepoint_parse bug HOT 1
- How can aarch64_be be supported? HOT 1
- ply not compiling on linux <v5.5 because of BPF_FUNC_probe_read_kernel HOT 2
- tracepoint self-test failed HOT 1
- ply: compile.c:215: ply_compile: Assertion `!err' failed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ply.