diff options
author | Andre Eisenbach <eisenbach@google.com> | 2014-09-17 16:40:53 -0700 |
---|---|---|
committer | Andre Eisenbach <eisenbach@google.com> | 2014-09-17 16:44:59 -0700 |
commit | 311e88dd46311534c6fd1a25ec9c5c1da6d55ded (patch) | |
tree | edb28dd505506ca2687705a875d66c408740d72c /main/bte_main.c | |
parent | 24adb37e4106bf8544c7729d34451fdf2777c4dc (diff) | |
download | android_system_bt-311e88dd46311534c6fd1a25ec9c5c1da6d55ded.tar.gz android_system_bt-311e88dd46311534c6fd1a25ec9c5c1da6d55ded.tar.bz2 android_system_bt-311e88dd46311534c6fd1a25ec9c5c1da6d55ded.zip |
Add ability to preserve existing snoop log
Currently a stack restart or device reboot will overwrite existing snoop
logs when the stack restarts. This patch adds a new configuration file
parameter "BtSnoopSaveLog" that, if enabled, will cause an existing
snoop log to be renamed to "<snoop_file_name>.last" before a new snoop
log is created.
This will allow for easier debugging of crashes that involve a reboot or
stack restart.
Change-Id: I4f56204d31a6bf2e96058938e8616eb6dee7360b
Diffstat (limited to 'main/bte_main.c')
-rwxr-xr-x | main/bte_main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/main/bte_main.c b/main/bte_main.c index f1c6897ca..75cc4402f 100755 --- a/main/bte_main.c +++ b/main/bte_main.c @@ -82,6 +82,7 @@ typedef struct ******************************************************************************/ BOOLEAN hci_logging_enabled = FALSE; /* by default, turn hci log off */ BOOLEAN hci_logging_config = FALSE; /* configured from bluetooth framework */ +BOOLEAN hci_save_log = FALSE; /* save a copy of the log before starting again */ char hci_logfile[256] = HCI_LOGGING_FILENAME; /******************************************************************************* @@ -266,7 +267,7 @@ void bte_main_config_hci_logging(BOOLEAN enable, BOOLEAN bt_disabled) return; } - bt_hc_if->logging(new ? BT_HC_LOGGING_ON : BT_HC_LOGGING_OFF, hci_logfile); + bt_hc_if->logging(new ? BT_HC_LOGGING_ON : BT_HC_LOGGING_OFF, hci_logfile, hci_save_log); } /****************************************************************************** @@ -292,7 +293,7 @@ static void bte_hci_enable(void) assert(result == BT_HC_STATUS_SUCCESS); if (hci_logging_enabled == TRUE || hci_logging_config == TRUE) - bt_hc_if->logging(BT_HC_LOGGING_ON, hci_logfile); + bt_hc_if->logging(BT_HC_LOGGING_ON, hci_logfile, hci_save_log); #if (defined (BT_CLEAN_TURN_ON_DISABLED) && BT_CLEAN_TURN_ON_DISABLED == TRUE) APPL_TRACE_DEBUG("%s Not Turninig Off the BT before Turninig ON", __FUNCTION__); @@ -338,7 +339,7 @@ static void bte_hci_disable(void) pthread_mutex_lock(&cleanup_lock); if (hci_logging_enabled == TRUE || hci_logging_config == TRUE) - bt_hc_if->logging(BT_HC_LOGGING_OFF, hci_logfile); + bt_hc_if->logging(BT_HC_LOGGING_OFF, hci_logfile, hci_save_log); bt_hc_if->cleanup(); pthread_mutex_unlock(&cleanup_lock); |