diff options
author | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-07-28 15:43:47 +0200 |
---|---|---|
committer | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-08-08 17:24:00 +0200 |
commit | 8cd840e49ad293ece796d32db87d4b1980502cf3 (patch) | |
tree | 67a09901cea738e5285471461b4a5eda9a6b6210 | |
parent | 74c2debc328c78a49d5ac779e9a83f3b7459c0a5 (diff) |
app: add debug_terminate() event, quick hack to terminate
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
-rw-r--r-- | generate-binding-glue.py | 1 | ||||
-rw-r--r-- | src/app.cpp | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/generate-binding-glue.py b/generate-binding-glue.py index cec4fea..e1f1d5a 100644 --- a/generate-binding-glue.py +++ b/generate-binding-glue.py @@ -94,6 +94,7 @@ API = { { 'name': 'debug_status', }, { 'name': 'debug_layers', }, { 'name': 'debug_surfaces', }, + { 'name': 'debug_terminate' }, ] } diff --git a/src/app.cpp b/src/app.cpp index 255a64a..5ff8729 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -18,6 +18,8 @@ #include <fstream> #include <json.hpp> +#include <bits/signum.h> +#include <csignal> namespace wm { @@ -282,6 +284,12 @@ binding_api::result_type binding_api::debug_status() { return Ok(jr); } +binding_api::result_type binding_api::debug_terminate() { + logdebug("%s", __func__); + raise(SIGKILL); // XXX afb-daemon kills it's pgroup using TERM, which doesn't play well with perf + return Ok(json_object_new_object()); +} + // _ _ _ _ _ // ___ ___ _ __ | |_ _ __ ___ | | | ___ _ __ | |__ ___ ___ | | _____ // / __/ _ \| '_ \| __| '__/ _ \| | |/ _ \ '__|| '_ \ / _ \ / _ \| |/ / __| |