chub: Report chub issue to dropbox
authorWen Xie <xiewen3@motorola.com>
Tue, 12 Feb 2019 08:44:27 +0000 (16:44 +0800)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:30:45 +0000 (17:30 +0800)
Report chub issue to dropbox, please note that when bug2go receive it,
dump files may not exist for dumpping action is executed by sensors hal.

Change-Id: I3597eb51ba1b86789a2e4da2c17d34115032859c
Signed-off-by: Wen Xie <xiewen3@motorola.com>
Reviewed-on: https://gerrit.mot.com/1307564
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Yuchang Guo <guoyc1@mt.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key

drivers/staging/nanohub/chub_dbg.c

index 563868958aa1b152470365d331e9226bcaf9db23..8be4f10ed3c4dbaaa140968856d1c2014b51eecf 100644 (file)
@@ -20,6 +20,7 @@
 #ifdef CONFIG_CHRE_SENSORHUB_HAL
 #include "main.h"
 #endif
+#include "linux/dropbox.h"
 
 #define NUM_OF_GPR (17)
 #define GPR_PC_INDEX (16)
@@ -155,6 +156,14 @@ static void chub_dbg_dump_status(struct contexthub_ipc_info *ipc)
        log_flush(ipc->fw_log);
 }
 
+static void dropbox_report_event(struct contexthub_ipc_info *ipc, enum chub_err_type err)
+{
+       char dropbox_msg[256];
+
+       dev_info(ipc->dev, "%s: reporting dropbox\n", __func__);
+       snprintf(dropbox_msg, sizeof(dropbox_msg), "reason: %d", err);
+       dropbox_queue_event_text("chub_issue", dropbox_msg, strlen(dropbox_msg));
+}
 
 void chub_dbg_dump_hw(struct contexthub_ipc_info *ipc, enum chub_err_type reason)
 {
@@ -167,6 +176,8 @@ void chub_dbg_dump_hw(struct contexthub_ipc_info *ipc, enum chub_err_type reason
        nanohub_add_dump_request(ipc->data);
 #endif
 
+       dropbox_report_event(ipc, reason);
+
 #ifdef SUPPORT_DUMP_ON_DRIVER
        /* dosen't support on android-p */
        if (p_dbg_dump) {