GithubHelp home page GithubHelp logo

ERR:75 & error: lost 36 events about ply HOT 3 CLOSED

xumn3348 avatar xumn3348 commented on August 27, 2024
ERR:75 & error: lost 36 events

from ply.

Comments (3)

wkz avatar wkz commented on August 27, 2024

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.

xumn3348 avatar xumn3348 commented on August 27, 2024

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.

wkz avatar wkz commented on August 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.