#
be3dd0e6 |
| 21-Dec-2023 |
Andrew Jeffery <andrew@aj.id.au> |
main: Address strncat() overflow warning
``` FAILED: debug-trigger.p/main.c.o ccache cc -Idebug-trigger.p -I. -I.. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wped
main: Address strncat() overflow warning
``` FAILED: debug-trigger.p/main.c.o ccache cc -Idebug-trigger.p -I. -I.. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=gnu18 -O0 -g -MD -MQ debug-trigger.p/main.c.o -MF debug-trigger.p/main.c.o.d -o debug-trigger.p/main.c.o -c ../main.c ../main.c: In function ‘main’: ../main.c:549:17: error: ‘strncat’ specified bound 4096 equals destination size [-Werror=stringop-overflow=] 549 | strncat(devnode, devid, sizeof(devnode)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors ```
Change-Id: Id9abfb900ad7601acd595febf00eb92c5a56d3af Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
#
1161642d |
| 14-Jan-2022 |
Andrew Jeffery <andrew@aj.id.au> |
main: Log command read from source
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ifeec81b37768052cabed63ff814499c8972817e1
|
#
ea84ad97 |
| 14-Jan-2022 |
Andrew Jeffery <andrew@aj.id.au> |
main: Be clear about what we failed to open
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I5884b83716f73da8f055a7267b3efab36c856ea8
|
#
86094694 |
| 13-Jan-2022 |
Andrew Jeffery <andrew@aj.id.au> |
main: Add a 'dbus' set of sink actions
The sysrq sink actions are are intended for use with kdump, which will capture relevant kernel and userspace memory. It's implementation is thus pretty straigh
main: Add a 'dbus' set of sink actions
The sysrq sink actions are are intended for use with kdump, which will capture relevant kernel and userspace memory. It's implementation is thus pretty straight forward.
Most BMCs don't use kdump, so implement a set of sink actions that talk via D-Bus to generate a dump and gracefully reboot the BMC.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I126b0118faaa793011268a785eeb955139739eaf
show more ...
|
#
b1ea254e |
| 13-Jan-2022 |
Andrew Jeffery <andrew@aj.id.au> |
main: Extract a 'source' abstraction
The D-Bus set of sink actions will require polling the D-Bus fd and processing any inbound messages. To do this, the polling must happen where we're currently re
main: Extract a 'source' abstraction
The D-Bus set of sink actions will require polling the D-Bus fd and processing any inbound messages. To do this, the polling must happen where we're currently reading from the source file descriptor. In the same manner as the sink abstraction extract a source abstraction to hide the details. process() is then implemented in terms of the abstract source interface.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I629e0d71f30592fa30affac1a920104e8086d8b0
show more ...
|
#
e998ba77 |
| 12-Jan-2022 |
Andrew Jeffery <andrew@aj.id.au> |
main: Add --sink-actions=... command-line option
Allow explicit configuration of the actions to take when a valid command is received from the source. This patch gives the current set of actions the
main: Add --sink-actions=... command-line option
Allow explicit configuration of the actions to take when a valid command is received from the source. This patch gives the current set of actions the name 'sysrq'.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ie8e7446599edb5927468865bcea36b596aef12f6
show more ...
|
#
1dc6adc9 |
| 12-Jan-2022 |
Andrew Jeffery <andrew@aj.id.au> |
main: Extract a 'sink' abstraction
In the future we'll add a set of sink actions that call through D-Bus to generate a BMC dump and do a graceful reboot rather than crashing the system through /proc
main: Extract a 'sink' abstraction
In the future we'll add a set of sink actions that call through D-Bus to generate a BMC dump and do a graceful reboot rather than crashing the system through /proc/sysrq-trigger. Reorganise the code so the process() function operates on abstract sink types. This way we can encapsulate the D-Bus specifics in a way that doesn't affect the process() implementation.
Concretely, there are two actions that can be triggered by the source, 'debug' and 'reboot'. Add the same as callbacks on the sink structure and implement the 'sysrq' behaviours in terms of the new abstraction.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ic62348365e9d0f13abbdcd81848bc4ca344135ee
show more ...
|
#
d65368be |
| 18-Jan-2022 |
Andrew Jeffery <andrew@aj.id.au> |
main: Add some documentation
Some tricks like defaulting the source and sink file descriptors to stdin and stdout aren't necessarily obvious, so add some commentary and justifications throughout.
S
main: Add some documentation
Some tricks like defaulting the source and sink file descriptors to stdin and stdout aren't necessarily obvious, so add some commentary and justifications throughout.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I515f36857a7056aa589ecbb09c46372ec4d3976d
show more ...
|
#
30b6496a |
| 19-Jan-2022 |
Andrew Jeffery <andrew@aj.id.au> |
main: Use /proc/sysrq-trigger for reboot as well as crash
This way when using stdout as the sink we don't accidentally reboot the system.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id:
main: Use /proc/sysrq-trigger for reboot as well as crash
This way when using stdout as the sink we don't accidentally reboot the system.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: If6b08f7a2773debf10bd1439790f8f9c83604d59
show more ...
|
#
210ad636 |
| 12-Jan-2022 |
Andrew Jeffery <andrew@aj.id.au> |
process: Lift reboot implementation to separate function
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I400d923781b3dd434dc51178c4dc9a8be6d3408f
|
#
db47cd7f |
| 12-Jan-2022 |
Andrew Jeffery <andrew@aj.id.au> |
process: Lift debug implementation to separate function
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I8f4ed09dfd8a0f034678530e6fc9799d2c8f34b6
|
#
11cd254b |
| 02-May-2021 |
Andrew Jeffery <andrew@aj.id.au> |
debug-trigger: Do what we can to debug unresponsive systems
debug-trigger is a small daemon which translates an external signal that the system is unresponsive into a system crash for debug data col
debug-trigger: Do what we can to debug unresponsive systems
debug-trigger is a small daemon which translates an external signal that the system is unresponsive into a system crash for debug data collection.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ic04f1a95aaf651d56b75f5261d8a6f76d34477a7
show more ...
|