summaryrefslogtreecommitdiffstats
path: root/hci
diff options
context:
space:
mode:
authorGanesha Batta <ganeshg@broadcom.com>2012-10-07 21:03:53 +0530
committerMatthew Xie <mattx@google.com>2012-10-08 18:01:26 -0700
commitc25367bb432d5e310c9ded312643a986e09b35de (patch)
treeb6dfeb851998a0f093d8c7f515ad45692be443f2 /hci
parent7057609dc1f29198b1272b9f0e3fca851573bd4e (diff)
downloadexternal_bluetooth_bluedroid-c25367bb432d5e310c9ded312643a986e09b35de.zip
external_bluetooth_bluedroid-c25367bb432d5e310c9ded312643a986e09b35de.tar.gz
external_bluetooth_bluedroid-c25367bb432d5e310c9ded312643a986e09b35de.tar.bz2
Disable btsnoop external parser for production
This port allows real time parsing of the btsnoop traces using an external tool. Disabled this by default for production. bug 7298743 Change-Id: I595e3e9fede532dbf1bd1383d9babe7c44503af1
Diffstat (limited to 'hci')
-rw-r--r--hci/include/bt_hci_bdroid.h5
-rwxr-xr-x[-rw-r--r--]hci/src/btsnoop.c8
2 files changed, 12 insertions, 1 deletions
diff --git a/hci/include/bt_hci_bdroid.h b/hci/include/bt_hci_bdroid.h
index 84a407b..5681e85 100644
--- a/hci/include/bt_hci_bdroid.h
+++ b/hci/include/bt_hci_bdroid.h
@@ -70,6 +70,11 @@
#define BTSNOOPDISP_INCLUDED TRUE
#endif
+/* Disable external parser for production */
+#ifndef BTSNOOP_EXT_PARSER_INCLUDED
+#define BTSNOOP_EXT_PARSER_INCLUDED FALSE
+#endif
+
/* Host/Controller lib internal event ID */
#define HC_EVENT_PRELOAD 0x0001
#define HC_EVENT_POSTLOAD 0x0002
diff --git a/hci/src/btsnoop.c b/hci/src/btsnoop.c
index cf22dd9..4807df8 100644..100755
--- a/hci/src/btsnoop.c
+++ b/hci/src/btsnoop.c
@@ -447,7 +447,7 @@ static int ext_parser_fd = -1;
static void ext_parser_detached(void);
-int ext_parser_accept(int port)
+static int ext_parser_accept(int port)
{
socklen_t clilen;
struct sockaddr_in cliaddr, servaddr;
@@ -582,12 +582,14 @@ void btsnoop_stop_listener(void)
void btsnoop_init(void)
{
+#if defined(BTSNOOP_EXT_PARSER_INCLUDED) && (BTSNOOP_EXT_PARSER_INCLUDED == TRUE)
ALOGD("btsnoop_init");
/* always setup ext listener port */
if (pthread_create(&thread_id, NULL,
(void*)ext_parser_thread,NULL)!=0)
perror("pthread_create");
+#endif
}
void btsnoop_open(char *p_path)
@@ -608,10 +610,12 @@ void btsnoop_close(void)
void btsnoop_cleanup (void)
{
+#if defined(BTSNOOP_EXT_PARSER_INCLUDED) && (BTSNOOP_EXT_PARSER_INCLUDED == TRUE)
ALOGD("btsnoop_cleanup");
pthread_kill(thread_id, SIGUSR2);
pthread_join(thread_id, NULL);
ext_parser_detached();
+#endif
}
@@ -627,6 +631,7 @@ void btsnoop_capture(HC_BT_HDR *p_buf, uint8_t is_rcvd)
SNOOPDBG("btsnoop_capture: fd = %d, type %x, rcvd %d, ext %d", \
hci_btsnoop_fd, p_buf->event, is_rcvd, ext_parser_fd);
+#if defined(BTSNOOP_EXT_PARSER_INCLUDED) && (BTSNOOP_EXT_PARSER_INCLUDED == TRUE)
if (ext_parser_fd > 0)
{
uint8_t tmp = *p;
@@ -656,6 +661,7 @@ void btsnoop_capture(HC_BT_HDR *p_buf, uint8_t is_rcvd)
*(++p) = tmp;
return;
}
+#endif
#if defined(BTSNOOPDISP_INCLUDED) && (BTSNOOPDISP_INCLUDED == TRUE)
if (hci_btsnoop_fd == -1)