Loading drivers/soc/qcom/glink_loopback_server.c +18 −32 Original line number Diff line number Diff line Loading @@ -19,42 +19,23 @@ #include <soc/qcom/glink.h> #include <soc/qcom/tracer_pkt.h> #include "glink_loopback_commands.h" #include "glink_private.h" enum { INFO_MASK = 1U << 0, DEBUG_MASK = 1U << 1, PERF_MASK = 1U << 2, }; static int glink_lbsrv_debug_mask; module_param_named(debug_mask, glink_lbsrv_debug_mask, int, S_IRUGO | S_IWUSR | S_IWGRP); #define LBSRV_PERF(fmt, args...) do { \ if (glink_lbsrv_debug_mask & PERF_MASK) \ GLINK_IPC_LOG_STR("<LBSRV> " fmt, args); \ } while (0) /* Number of internal IPC Logging log pages */ #define GLINK_LBSRV_NUM_LOG_PAGES 3 #define LBSRV_INFO(x...) do { \ if (glink_lbsrv_debug_mask & INFO_MASK) \ GLINK_INFO("<LBSRV> " x); \ } while (0) static void *glink_lbsrv_log_ctx; #define LBSRV_INFO_PERF(fmt, args...) do { \ if (glink_lbsrv_debug_mask & (INFO_MASK | PERF_MASK)) \ GLINK_IPC_LOG_STR("<LBSRV> " fmt, args); \ #define GLINK_LBSRV_IPC_LOG_STR(x...) do { \ if (glink_lbsrv_log_ctx) \ ipc_log_string(glink_lbsrv_log_ctx, x); \ } while (0) #define LBSRV_DBG(x...) do { \ if (glink_lbsrv_debug_mask & DEBUG_MASK) \ GLINK_IPC_LOG_STR("<LBSRV> " x); \ } while (0) #define LBSRV_INFO(x...) GLINK_LBSRV_IPC_LOG_STR("<LBSRV> " x) #define LBSRV_ERR(x...) do { \ if (!(glink_lbsrv_debug_mask & PERF_MASK)) \ pr_err("<LBSRV> " x); \ GLINK_IPC_LOG_STR("<LBSRV> " x); \ GLINK_LBSRV_IPC_LOG_STR("<LBSRV> " x); \ } while (0) enum ch_type { Loading Loading @@ -745,7 +726,7 @@ void glink_lpbsrv_notify_rx(void *handle, const void *priv, struct rx_work_info *tmp_work_info; struct ch_info *rx_ch_info = (struct ch_info *)priv; LBSRV_INFO_PERF( LBSRV_INFO( "%s:%s:%s %s: end (Success) RX priv[%p] data[%p] size[%zu]\n", rx_ch_info->transport, rx_ch_info->edge, rx_ch_info->name, __func__, pkt_priv, (char *)ptr, size); Loading Loading @@ -802,7 +783,7 @@ void glink_lpbsrv_notify_rx_tp(void *handle, const void *priv, struct rx_work_info *tmp_work_info; struct ch_info *rx_ch_info = (struct ch_info *)priv; LBSRV_INFO_PERF( LBSRV_INFO( "%s:%s:%s %s: end (Success) RX priv[%p] data[%p] size[%zu]\n", rx_ch_info->transport, rx_ch_info->edge, rx_ch_info->name, __func__, pkt_priv, (char *)ptr, size); Loading @@ -829,7 +810,7 @@ void glink_lpbsrv_notify_tx_done(void *handle, const void *priv, const void *pkt_priv, const void *ptr) { struct ch_info *tx_done_ch_info = (struct ch_info *)priv; LBSRV_INFO_PERF("%s:%s:%s %s: end (Success) TX_DONE ptr[%p]\n", LBSRV_INFO("%s:%s:%s %s: end (Success) TX_DONE ptr[%p]\n", tx_done_ch_info->transport, tx_done_ch_info->edge, tx_done_ch_info->name, __func__, ptr); Loading Loading @@ -1148,7 +1129,7 @@ static void glink_lbsrv_tx_worker(struct work_struct *work) uint32_t delay_ms; uint32_t flags; LBSRV_INFO_PERF("%s:%s:%s %s: start TX data[%p] size[%zu]\n", LBSRV_INFO("%s:%s:%s %s: start TX data[%p] size[%zu]\n", tmp_ch_info->transport, tmp_ch_info->edge, tmp_ch_info->name, __func__, tmp_work_info->data, tmp_work_info->size); while (1) { Loading Loading @@ -1283,6 +1264,11 @@ static int glink_loopback_server_init(void) int ret; struct ch_info *tmp_ch_info; glink_lbsrv_log_ctx = ipc_log_context_create(GLINK_LBSRV_NUM_LOG_PAGES, "glink_lbsrv", 0); if (!glink_lbsrv_log_ctx) pr_err("%s: unable to create log context\n", __func__); glink_lbsrv_wq = create_singlethread_workqueue("glink_lbsrv"); if (!glink_lbsrv_wq) { LBSRV_ERR("%s: Error creating glink_lbsrv_wq\n", __func__); Loading Loading
drivers/soc/qcom/glink_loopback_server.c +18 −32 Original line number Diff line number Diff line Loading @@ -19,42 +19,23 @@ #include <soc/qcom/glink.h> #include <soc/qcom/tracer_pkt.h> #include "glink_loopback_commands.h" #include "glink_private.h" enum { INFO_MASK = 1U << 0, DEBUG_MASK = 1U << 1, PERF_MASK = 1U << 2, }; static int glink_lbsrv_debug_mask; module_param_named(debug_mask, glink_lbsrv_debug_mask, int, S_IRUGO | S_IWUSR | S_IWGRP); #define LBSRV_PERF(fmt, args...) do { \ if (glink_lbsrv_debug_mask & PERF_MASK) \ GLINK_IPC_LOG_STR("<LBSRV> " fmt, args); \ } while (0) /* Number of internal IPC Logging log pages */ #define GLINK_LBSRV_NUM_LOG_PAGES 3 #define LBSRV_INFO(x...) do { \ if (glink_lbsrv_debug_mask & INFO_MASK) \ GLINK_INFO("<LBSRV> " x); \ } while (0) static void *glink_lbsrv_log_ctx; #define LBSRV_INFO_PERF(fmt, args...) do { \ if (glink_lbsrv_debug_mask & (INFO_MASK | PERF_MASK)) \ GLINK_IPC_LOG_STR("<LBSRV> " fmt, args); \ #define GLINK_LBSRV_IPC_LOG_STR(x...) do { \ if (glink_lbsrv_log_ctx) \ ipc_log_string(glink_lbsrv_log_ctx, x); \ } while (0) #define LBSRV_DBG(x...) do { \ if (glink_lbsrv_debug_mask & DEBUG_MASK) \ GLINK_IPC_LOG_STR("<LBSRV> " x); \ } while (0) #define LBSRV_INFO(x...) GLINK_LBSRV_IPC_LOG_STR("<LBSRV> " x) #define LBSRV_ERR(x...) do { \ if (!(glink_lbsrv_debug_mask & PERF_MASK)) \ pr_err("<LBSRV> " x); \ GLINK_IPC_LOG_STR("<LBSRV> " x); \ GLINK_LBSRV_IPC_LOG_STR("<LBSRV> " x); \ } while (0) enum ch_type { Loading Loading @@ -745,7 +726,7 @@ void glink_lpbsrv_notify_rx(void *handle, const void *priv, struct rx_work_info *tmp_work_info; struct ch_info *rx_ch_info = (struct ch_info *)priv; LBSRV_INFO_PERF( LBSRV_INFO( "%s:%s:%s %s: end (Success) RX priv[%p] data[%p] size[%zu]\n", rx_ch_info->transport, rx_ch_info->edge, rx_ch_info->name, __func__, pkt_priv, (char *)ptr, size); Loading Loading @@ -802,7 +783,7 @@ void glink_lpbsrv_notify_rx_tp(void *handle, const void *priv, struct rx_work_info *tmp_work_info; struct ch_info *rx_ch_info = (struct ch_info *)priv; LBSRV_INFO_PERF( LBSRV_INFO( "%s:%s:%s %s: end (Success) RX priv[%p] data[%p] size[%zu]\n", rx_ch_info->transport, rx_ch_info->edge, rx_ch_info->name, __func__, pkt_priv, (char *)ptr, size); Loading @@ -829,7 +810,7 @@ void glink_lpbsrv_notify_tx_done(void *handle, const void *priv, const void *pkt_priv, const void *ptr) { struct ch_info *tx_done_ch_info = (struct ch_info *)priv; LBSRV_INFO_PERF("%s:%s:%s %s: end (Success) TX_DONE ptr[%p]\n", LBSRV_INFO("%s:%s:%s %s: end (Success) TX_DONE ptr[%p]\n", tx_done_ch_info->transport, tx_done_ch_info->edge, tx_done_ch_info->name, __func__, ptr); Loading Loading @@ -1148,7 +1129,7 @@ static void glink_lbsrv_tx_worker(struct work_struct *work) uint32_t delay_ms; uint32_t flags; LBSRV_INFO_PERF("%s:%s:%s %s: start TX data[%p] size[%zu]\n", LBSRV_INFO("%s:%s:%s %s: start TX data[%p] size[%zu]\n", tmp_ch_info->transport, tmp_ch_info->edge, tmp_ch_info->name, __func__, tmp_work_info->data, tmp_work_info->size); while (1) { Loading Loading @@ -1283,6 +1264,11 @@ static int glink_loopback_server_init(void) int ret; struct ch_info *tmp_ch_info; glink_lbsrv_log_ctx = ipc_log_context_create(GLINK_LBSRV_NUM_LOG_PAGES, "glink_lbsrv", 0); if (!glink_lbsrv_log_ctx) pr_err("%s: unable to create log context\n", __func__); glink_lbsrv_wq = create_singlethread_workqueue("glink_lbsrv"); if (!glink_lbsrv_wq) { LBSRV_ERR("%s: Error creating glink_lbsrv_wq\n", __func__); Loading