-
Notifications
You must be signed in to change notification settings - Fork 14
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
Syslog ng ctl attach debugger #327
base: main
Are you sure you want to change the base?
Commits on Oct 27, 2024
-
console: new module to track the interactive connection to a terminal
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 9c709c6 - Browse repository at this point
Copy the full SHA 9c709c6View commit details -
gprocess: integrate startup with the new console management module
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for ea50968 - Browse repository at this point
Copy the full SHA ea50968View commit details -
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 <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for d383a47 - Browse repository at this point
Copy the full SHA d383a47View 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 <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 0db54f7 - Browse repository at this point
Copy the full SHA 0db54f7View 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 <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 54fe078 - Browse repository at this point
Copy the full SHA 54fe078View commit details -
control: call app_thread_start/stop from command threads
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 6372220 - Browse repository at this point
Copy the full SHA 6372220View 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 <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 3cc81d1 - Browse repository at this point
Copy the full SHA 3cc81d1View 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 <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for c02ad9b - Browse repository at this point
Copy the full SHA c02ad9bView commit details -
syslog-ng-ctl: add support for "attach" command
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 8e139da - Browse repository at this point
Copy the full SHA 8e139daView commit details -
control: remove and bump verbosity for some control socket related me…
…ssages Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 24b966c - Browse repository at this point
Copy the full SHA 24b966cView commit details -
gprocess: get rid off the stderr_present variable
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 8a28d0d - Browse repository at this point
Copy the full SHA 8a28d0dView 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 <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for c944448 - Browse repository at this point
Copy the full SHA c944448View 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 <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 2374611 - Browse repository at this point
Copy the full SHA 2374611View commit details -
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 8dd472c - Browse repository at this point
Copy the full SHA 8dd472cView 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 <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 06bf929 - Browse repository at this point
Copy the full SHA 06bf929View 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 <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 99c4eb2 - Browse repository at this point
Copy the full SHA 99c4eb2View 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 <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 3cada6d - Browse repository at this point
Copy the full SHA 3cada6dView commit details -
debugger: rename interactive_thread to debugger_thread
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 14a8596 - Browse repository at this point
Copy the full SHA 14a8596View 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 <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 5d818c7 - Browse repository at this point
Copy the full SHA 5d818c7View commit details -
debugger: add debugger_stop() call alongside debugger_start()
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 6538f65 - Browse repository at this point
Copy the full SHA 6538f65View commit details -
debugger: make sure that debugger_start_console and debugger_exit() r…
…un from the main thread Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 1433f96 - Browse repository at this point
Copy the full SHA 1433f96View commit details -
tracer: move the Tracer struct to the implementation file
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 842d0fd - Browse repository at this point
Copy the full SHA 842d0fdView 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 <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for 7a5d781 - Browse repository at this point
Copy the full SHA 7a5d781View commit details -
syslog-ng-ctl: add support for "attach debugger"
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Configuration menu - View commit details
-
Copy full SHA for e058b86 - Browse repository at this point
Copy the full SHA e058b86View commit details