-
Notifications
You must be signed in to change notification settings - Fork 17
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
Debugger filterx #356
base: main
Are you sure you want to change the base?
Debugger filterx #356
Commits on Oct 27, 2024
-
scratch-buffers: do not use ivykis in non-ivykis threads
scratch_buffers_lazy_update_stats() uses the ivykis time state to check if it is time to update the stats about scratch buffers. Do not do that if ivykis is not initialized. This may happen in control threads and the debugger threads that do use scratch buffers but don't use ivykis. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1eb3781 - Browse repository at this point
Copy the full SHA 1eb3781View commit details -
control: make it possible to query if a worker relates to a connection
A better solution would be to have a connection specific worker list, and a list of connections. But for now this suffices for my purposes of being able to cancel connection specific workers. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d14cb21 - Browse repository at this point
Copy the full SHA d14cb21View commit details -
control: cancel connection related workers
Up to now, control worker threads were only cancelled at exit. Truth be told we never really detected if the peer has disconnected either. This patch implements thread cancellation whenever a connection closes, to detect the closure of the connection comes in a separate patch. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 273eb9b - Browse repository at this point
Copy the full SHA 273eb9bView commit details -
control: call app_thread_start/stop from command threads
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b4020dd - Browse repository at this point
Copy the full SHA b4020ddView commit details -
control: add support for passing 3 fds through the control socket
This will be used to pass over the stdio file descriptors from syslog-ng-ctl so we can attach to the syslog-ng process after it was started in the background. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fe854f7 - Browse repository at this point
Copy the full SHA fe854f7View commit details -
console: new module to track the interactive connection to a terminal
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 43f28e7 - Browse repository at this point
Copy the full SHA 43f28e7View commit details -
gprocess: integrate startup with the new console management module
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for aad0567 - Browse repository at this point
Copy the full SHA aad0567View commit details -
mainloop-control: add support for ATTACH STDIO
This new command allows to reconnect the stdio streams even if syslog-ng runs in the background. syslog-ng-ctl will be able to pass 3 fds to the syslog-ng process, which will be duplicated into the standard fds and with that syslog-ng will happily start displaying its stdout to that terminal. The ATTACH command itself is threaded and the control socket is only used to indicate that the peers are still alive. syslog-ng will start sending "ALIVE" messages to this stream every second or so. If sending this packet is not successful, the connection is closed and the thread is cancelled. Upon cancellation, the stdio fds are restored to point to /dev/null. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 11fcfc8 - Browse repository at this point
Copy the full SHA 11fcfc8View commit details -
syslog-ng-ctl: add support for "attach" command
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6242056 - Browse repository at this point
Copy the full SHA 6242056View commit details -
control: remove and bump verbosity for some control socket related me…
…ssages Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 66e575e - Browse repository at this point
Copy the full SHA 66e575eView commit details -
gprocess: get rid off the stderr_present variable
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6dcf9ab - Browse repository at this point
Copy the full SHA 6dcf9abView commit details -
logpipe: uninline log_pipe_queue()
This is never inlined anyway, but duplicated into all modules using log_pipe_queue(), it is then better to just have it in one location. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1f68f2b - Browse repository at this point
Copy the full SHA 1f68f2bView commit details -
logpipe: eliminate s->queue == NULL trick
log_pipe_forward_msg() is not inlined anyway, so it will just add an extra branch. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 44a8275 - Browse repository at this point
Copy the full SHA 44a8275View commit details -
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 78cf282 - Browse repository at this point
Copy the full SHA 78cf282View commit details -
logpipe: move PIF_CONFIG_RELATED check to the call site
Checking the global variable pipe_single_step_hook is quite complicated as it is addressed $rip relative, so let's filter out the config related pipes first and remove the same check from the debugger. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 695b3c0 - Browse repository at this point
Copy the full SHA 695b3c0View commit details -
debugger: add cancellation support to Tracer
The tracer is responsible with the communication between the debugger thread and any worker threads. Up to this point this was not cancellable, e.g. once a breakpoint fired, the worker stopped with no way of cancelling this. With the addition to tracer_cancel() pending breakpoints are let go and at the same time tracer_wait_for_breakpoint() returns as well with a gboolean to indicate whether it was cancelled. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0031f3e - Browse repository at this point
Copy the full SHA 0031f3eView commit details -
The new debugger_exit() can be called from any thread, triggers the cancellation of the tracer and then waits for the debugger thread to finish. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 79d2f3c - Browse repository at this point
Copy the full SHA 79d2f3cView commit details -
debugger: rename interactive_thread to debugger_thread
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f43d0fb - Browse repository at this point
Copy the full SHA f43d0fbView commit details -
debugger: attach and deattach the single step hook in a synchronized …
…manner The debugger installed the pipe_single_step_hook without locking, but that only works if we do that at startup. Since I want to be able to start the debugger on demand, this needs to sync with any workers that might be executing. On x86 it might be safe to just store the pointer, but other less forgiving architectures (e.g. ARM) may not like that. Let's do this properly. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for abe1d39 - Browse repository at this point
Copy the full SHA abe1d39View commit details -
debugger: add debugger_stop() call alongside debugger_start()
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4f15ff1 - Browse repository at this point
Copy the full SHA 4f15ff1View commit details -
debugger: make sure that debugger_start_console and debugger_exit() r…
…un from the main thread Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d24ee74 - Browse repository at this point
Copy the full SHA d24ee74View commit details -
tracer: move the Tracer struct to the implementation file
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b3ecc34 - Browse repository at this point
Copy the full SHA b3ecc34View commit details -
debugger: support multi-threaded mode
The key ingredient to support multi-threaded debugger session is to allow the breakpoint sites to submit debugger_stop_on_breakpoint() calls in parallel so that these requests are queued and no variables are used for the different invocations. The solution is to introduce the BreakpointSite struct, this is where we store state that relates to each distinct breakpoint events. This struct contains both the state the debugger may want to inspect (e.g. msg, pipe) and also the state related to inter-thread communication (e.g. resume_requested). Each such site instances are queued in an internal queue which is then processed by the interactive debugger. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3a402c3 - Browse repository at this point
Copy the full SHA 3a402c3View commit details -
syslog-ng-ctl: add support for "attach debugger"
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ca8b036 - Browse repository at this point
Copy the full SHA ca8b036View commit details -
mainloop: do not register signal handlers as exclusive
As long as we have a single signal registrations, these will be executed anyway. IV_SIGNAL_FLAG_EXCLUSIVE are for registrations that want to suppress previous registrations. I intend to use SIGINT in the debugger to break into the debugger to allow executing commands even outside of the pipeline (e.g. setting breakpoints for the future). Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for de5c76e - Browse repository at this point
Copy the full SHA de5c76eView commit details -
tracer: implement interrupt support
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 45672ea - Browse repository at this point
Copy the full SHA 45672eaView commit details -
debugger: get into the debugger on SIGINT
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 677d350 - Browse repository at this point
Copy the full SHA 677d350View commit details -
logreader: retry on main_loop_io_worker_job_submit() failure
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5ba6d4d - Browse repository at this point
Copy the full SHA 5ba6d4dView commit details -
console: extract console_printf from gprocess
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3228a54 - Browse repository at this point
Copy the full SHA 3228a54View commit details -
gprocess: add fatal signal logging with a backtrace
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a136792 - Browse repository at this point
Copy the full SHA a136792View commit details -
logreader: add exit-on-eof flag()
With the exit-on-eof flag, you can request syslog-ng to exit whenever the first EOF is hit on the specific source, similarly to how the stdin() source behaves. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8949ea5 - Browse repository at this point
Copy the full SHA 8949ea5View commit details -
cfg-source: add num_lines argument to _print_underlined_source_block()
Instead of using "NULL" as the indicator for the end of the lines to print, just pass the number of entries in the lines array. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5ce77a2 - Browse repository at this point
Copy the full SHA 5ce77a2View commit details -
cfg-source: refactor source file printing to use line numbers
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 00996cb - Browse repository at this point
Copy the full SHA 00996cbView commit details -
cfg-source: add cfg_source_print_source_text() function
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e02b15a - Browse repository at this point
Copy the full SHA e02b15aView commit details -
debugger: add source display using the cfg-source module
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f263108 - Browse repository at this point
Copy the full SHA f263108View commit details -
debugger: extract _set_command()
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 34e2e1f - Browse repository at this point
Copy the full SHA 34e2e1fView commit details -
logpipe: add PIF_BREAKPOINT flag
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f67c4bf - Browse repository at this point
Copy the full SHA f67c4bfView commit details -
The mode field in debugger determines how we respond to trace and breakpoints and is used by the hook to trigger various debugging scenarios. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 709de3b - Browse repository at this point
Copy the full SHA 709de3bView commit details -
debugger: filter out uninteresting stop events
Some breakpoints are not interesting once the mode changes, even though they were submitted by the pipe hook and are waiting to be resumed. Let's quickly acknowledge them and don't bother the user. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 11144b7 - Browse repository at this point
Copy the full SHA 11144b7View commit details -
debugger: clean up trace command
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bd2cdb6 - Browse repository at this point
Copy the full SHA bd2cdb6View commit details -
debugger: add welcome blurb on startup
Also, stop at the prompt immediately, instead of wait for a message. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3415137 - Browse repository at this point
Copy the full SHA 3415137View commit details -
debugger: add step and follow commands
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d1d8188 - Browse repository at this point
Copy the full SHA d1d8188View commit details -
filterx: make FilterXExpr ref_cnt atomic
This is not a fastpath, so we can use atomics and the debugger needs to ref/unref expressions in the debugger thread, which causes failed assertions. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 51439b3 - Browse repository at this point
Copy the full SHA 51439b3View commit details -
filterx: return list of exprs from the grammar
Instead of returning a fully formed compound expression, just return the list of expressions, so the brace is processed by the parent grammar. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2f7d3a4 - Browse repository at this point
Copy the full SHA 2f7d3a4View commit details -
filterx: don't require filterx expr parsing to run in the main thread
Exclude other threads simply by only allowing these calls to be made while parsing is in progress, which is inherently single-threaded. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bb6053e - Browse repository at this point
Copy the full SHA bb6053eView commit details -
filterx: rename error formatting functions for consistency
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ca77ae9 - Browse repository at this point
Copy the full SHA ca77ae9View commit details -
filterx: add filterx_error_format() function
Which returns a borrowed string instead of an EVTTAG. Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e7d3cb2 - Browse repository at this point
Copy the full SHA e7d3cb2View commit details -
cfg-source: fix off-by-one in report_buffer_location()
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 92a161a - Browse repository at this point
Copy the full SHA 92a161aView commit details -
debugger: add path_options argument to debugger stop/trace entry points
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8f6124c - Browse repository at this point
Copy the full SHA 8f6124cView commit details -
debugger: move commands into their separate implementation file
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1c5f08a - Browse repository at this point
Copy the full SHA 1c5f08aView commit details -
debugger: make the help output a bit more consistent
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 96d0b94 - Browse repository at this point
Copy the full SHA 96d0b94View commit details -
debugger: implement printx command to evaluate filterx expressions
Signed-off-by: Balazs Scheidler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 225043f - Browse repository at this point
Copy the full SHA 225043fView commit details