-
Notifications
You must be signed in to change notification settings - Fork 733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Insert markers into event buffer, and waiting on them #235
Comments
That's an interesting idea, and I'd be curious to hear your practical use case as well. As a temporary solution, the last 3 commits on the master branch (not yet released) contain a fix that make sysdig read the events from the kernel much more frequently than before, so with your 0.5 seconds wait after quitting your program, you should be fairly covered. |
My use case (at this moment) is: synchronizing my script and the logger to ready/quit events. Using timeout delays is necessary at the moment and, even though it seems to work, it strikes me as a hack. So, I wouldn't necessarily need a full marker system, as described above. I figured that if a marker system existed though, it would solve the synchronization problem I have. |
David, The choice of scanning proc first was taken because we wanted to avoid a bunch of sysdig-generated events to saturate the capture buffers when the program starts. This could be solved more elegantly by including a pid filter in the driver. At that point, the capture would start immediately, and sysdig would just efficiently drop the events that it generates when scanning proc. We can open an issue for this, so that one of the developers will take care of it, or if you prefer feel free to send a patch. Regarding the sysdigsend idea. Please take a look at the user_events branch, which unfortunately doesn't compile right now. The idea is creating a fake file (/dev/sysdig-events) where you can write json snippets from an arbitrary script or program. The snippets are injected in the sysdig stream, and they are parsed by the decoding engine to do things similar to the ones you suggest, plus:
and so on. It's going to take a bit before I can merge it into master, but it would be nice to understand if you think this could solve your problem. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I have a pretty awkward way that I am invoking sysdig at the moment:
Basically I need a way of synchronizing with events, kind of like this:
A possible operational theory:
sysdigsend <marker>
Put marker event into the kernel log buffer.
sysdigwait <marker>
Communicate with the running
sysdig
logger instance, and waits for specified marker to be seen and written to output bysysdig
. This could work as follows: Each observed marker increments a count of that marker. Eachsysdigwait
decrements the counter. If counter is 0,sysdigwait
blocks. Ifsysdig
is not running,sysdigwait
blocks.sysdigclear
Set all the counters to 0.
Markers could also be leveraged for more informed analysis, though this example is not the greatest, but hopefully inspires an idea, e.g.,
Btw, I'm very much enjoying sysdig. Many thanks for developing it.
The text was updated successfully, but these errors were encountered: