From 21e1b2acad171536923777433f08fb8313eaab7f Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Wed, 25 Sep 2024 11:06:52 -0600 Subject: [PATCH] feat: Add RPC thread analysis support. --- app/src/studio/rpc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/studio/rpc.c b/app/src/studio/rpc.c index bd980eb46..7b8dd605d 100644 --- a/app/src/studio/rpc.c +++ b/app/src/studio/rpc.c @@ -11,6 +11,7 @@ #include #include +#include #include LOG_MODULE_REGISTER(zmk_studio, CONFIG_ZMK_STUDIO_LOG_LEVEL); @@ -215,6 +216,9 @@ static void rpc_main(void) { for (;;) { pb_istream_t stream = pb_istream_for_rx_ring_buf(); zmk_studio_Request req = zmk_studio_Request_init_zero; +#if IS_ENABLED(CONFIG_THREAD_ANALYZER) + thread_analyzer_print(); +#endif // IS_ENABLED(CONFIG_THREAD_ANALYZER) bool status = pb_decode(&stream, &zmk_studio_Request_msg, &req); rpc_framing_state = FRAMING_STATE_IDLE; @@ -223,6 +227,9 @@ static void rpc_main(void) { zmk_studio_Response resp = handle_request(&req); int err = send_response(&resp); +#if IS_ENABLED(CONFIG_THREAD_ANALYZER) + thread_analyzer_print(); +#endif // IS_ENABLED(CONFIG_THREAD_ANALYZER) if (err < 0) { LOG_ERR("Failed to send the RPC response %d", err); }