Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2cfa10c5 authored by Sharvil Nanavati's avatar Sharvil Nanavati
Browse files

Start cleaning up log macros.

Change-Id: I228fef0198caeb47618a07c4c46526f611933e07
parent 4c07f761
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -839,7 +839,6 @@ void GKI_run (void * p_task_id)
             * e.g. power saving you may want to provide more ticks
             */
            GKI_timer_update( 1 );
            /* BT_TRACE_2( TRACE_LAYER_HCI, TRACE_TYPE_DEBUG, "update: tv_sec: %d, tv_nsec: %d", delay.tv_sec, delay.tv_nsec ); */
        } while ( GKI_TIMER_TICK_RUN_COND == *p_run_cond );

        /* currently on reason to exit above loop is no_timer_suspend == GKI_TIMER_TICK_STOP_COND
+1801 −1839

File changed.

Preview size limit exceeded, changes collapsed.

+3 −121
Original line number Diff line number Diff line
@@ -206,13 +206,13 @@ const char * const bt_layer_tags[] = {
//#define DBG_TRACE

#if defined( DBG_TRACE )
#define DBG_TRACE_API0( m ) BT_TRACE_0( TRACE_LAYER_HCI, TRACE_TYPE_API, m )
#define DBG_TRACE_WARNING2( m, p0, p1 ) BT_TRACE_2( TRACE_LAYER_BTM, (TRACE_ORG_APPL|TRACE_TYPE_WARNING), m, p0, p1 )
#define DBG_TRACE_API0( m ) BT_TRACE( TRACE_LAYER_HCI, TRACE_TYPE_API, m )
#define DBG_TRACE_WARNING2( m, p0, p1 ) BT_TRACE( TRACE_LAYER_BTM, (TRACE_ORG_APPL|TRACE_TYPE_WARNING), m, p0, p1 )
#else
#define DBG_TRACE_API0( m )
#define DBG_TRACE_WARNING2( m, p0, p1 )
#endif
#define DBG_TRACE_DEBUG2( m, p0, p1 ) BT_TRACE_2( TRACE_LAYER_BTM, (TRACE_ORG_APPL|TRACE_TYPE_DEBUG), m, p0, p1 )
#define DBG_TRACE_DEBUG2( m, p0, p1 ) BT_TRACE( TRACE_LAYER_BTM, (TRACE_ORG_APPL|TRACE_TYPE_DEBUG), m, p0, p1 )

void
LogMsg(UINT32 trace_set_mask, const char *fmt_str, ...)
@@ -526,121 +526,3 @@ BT_API void BTE_InitTraceLevels( void )
    }
#endif
}


/********************************************************************************
 **
 **    Function Name:   LogMsg_0
 **
 **    Purpose:  Encodes a trace message that has no parameter arguments
 **
 **    Input Parameters:  trace_set_mask: tester trace type.
 **                       fmt_str: displayable string.
 **    Returns:
 **                      Nothing.
 **
 *********************************************************************************/
void LogMsg_0(UINT32 trace_set_mask, const char *fmt_str) {
    LogMsg(trace_set_mask, fmt_str);
}

/********************************************************************************
 **
 **    Function Name:   LogMsg_1
 **
 **    Purpose:  Encodes a trace message that has one parameter argument
 **
 **    Input Parameters:  trace_set_mask: tester trace type.
 **                       fmt_str: displayable string.
 **    Returns:
 **                      Nothing.
 **
 *********************************************************************************/
void LogMsg_1(UINT32 trace_set_mask, const char *fmt_str, UINT32 p1) {

    LogMsg(trace_set_mask, fmt_str, p1);
}

/********************************************************************************
 **
 **    Function Name:   LogMsg_2
 **
 **    Purpose:  Encodes a trace message that has two parameter arguments
 **
 **    Input Parameters:  trace_set_mask: tester trace type.
 **                       fmt_str: displayable string.
 **    Returns:
 **                      Nothing.
 **
 *********************************************************************************/
void LogMsg_2(UINT32 trace_set_mask, const char *fmt_str, UINT32 p1, UINT32 p2) {
    LogMsg(trace_set_mask, fmt_str, p1, p2);
}

/********************************************************************************
 **
 **    Function Name:   LogMsg_3
 **
 **    Purpose:  Encodes a trace message that has three parameter arguments
 **
 **    Input Parameters:  trace_set_mask: tester trace type.
 **                       fmt_str: displayable string.
 **    Returns:
 **                      Nothing.
 **
 *********************************************************************************/
void LogMsg_3(UINT32 trace_set_mask, const char *fmt_str, UINT32 p1, UINT32 p2,
        UINT32 p3) {
    LogMsg(trace_set_mask, fmt_str, p1, p2, p3);
}

/********************************************************************************
 **
 **    Function Name:   LogMsg_4
 **
 **    Purpose:  Encodes a trace message that has four parameter arguments
 **
 **    Input Parameters:  trace_set_mask: tester trace type.
 **                       fmt_str: displayable string.
 **    Returns:
 **                      Nothing.
 **
 *********************************************************************************/
void LogMsg_4(UINT32 trace_set_mask, const char *fmt_str, UINT32 p1, UINT32 p2,
        UINT32 p3, UINT32 p4) {
    LogMsg(trace_set_mask, fmt_str, p1, p2, p3, p4);
}

/********************************************************************************
 **
 **    Function Name:   LogMsg_5
 **
 **    Purpose:  Encodes a trace message that has five parameter arguments
 **
 **    Input Parameters:  trace_set_mask: tester trace type.
 **                       fmt_str: displayable string.
 **    Returns:
 **                      Nothing.
 **
 *********************************************************************************/
void LogMsg_5(UINT32 trace_set_mask, const char *fmt_str, UINT32 p1, UINT32 p2,
        UINT32 p3, UINT32 p4, UINT32 p5) {
    LogMsg(trace_set_mask, fmt_str, p1, p2, p3, p4, p5);
}

/********************************************************************************
 **
 **    Function Name:   LogMsg_6
 **
 **    Purpose:  Encodes a trace message that has six parameter arguments
 **
 **    Input Parameters:  trace_set_mask: tester trace type.
 **                       fmt_str: displayable string.
 **    Returns:
 **                      Nothing.
 **
 *********************************************************************************/
void LogMsg_6(UINT32 trace_set_mask, const char *fmt_str, UINT32 p1, UINT32 p2,
        UINT32 p3, UINT32 p4, UINT32 p5, UINT32 p6) {
    LogMsg(trace_set_mask, fmt_str, p1, p2, p3, p4, p5, p6);
}
+11 −21
Original line number Diff line number Diff line
@@ -192,11 +192,6 @@ static void btu_hcif_store_cmd (UINT8 controller_id, BT_HDR *p_buf)
#endif
       )
    {
#if 0
        BT_TRACE_2 (TRACE_LAYER_HCI, TRACE_TYPE_DEBUG,
                    "Storing VSC callback opcode=0x%04x, Callback function=0x%07x",
                    opcode, *(UINT32 *)(p_buf + 1));
#endif
        memcpy ((UINT8 *)(p_cmd + 1), (UINT8 *)(p_buf + 1), sizeof(void *));
    }

@@ -405,7 +400,7 @@ void btu_hcif_process_event (UINT8 controller_id, BT_HDR *p_msg)
        case HCI_BLE_EVENT:
            STREAM_TO_UINT8  (ble_sub_code, p);

            BT_TRACE_2 (TRACE_LAYER_HCI, TRACE_TYPE_EVENT, "BLE HCI(id=%d) event = 0x%02x)",
            BT_TRACE(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, "BLE HCI(id=%d) event = 0x%02x)",
                        hci_evt_code,  ble_sub_code);

            switch (ble_sub_code)
@@ -508,7 +503,7 @@ void btu_hcif_send_cmd (UINT8 controller_id, BT_HDR *p_buf)
            else
            {
                /* Unknown controller */
                BT_TRACE_1 (TRACE_LAYER_HCI, TRACE_TYPE_WARNING, "BTU HCI(ctrl id=%d) controller ID not recognized", controller_id);
                BT_TRACE(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, "BTU HCI(ctrl id=%d) controller ID not recognized", controller_id);
                GKI_freebuf(p_buf);;
            }

@@ -1518,7 +1513,7 @@ static void btu_hcif_command_status_evt (UINT8 controller_id, UINT8 *p)
    }
    else
    {
        BT_TRACE_1 (TRACE_LAYER_HCI, TRACE_TYPE_WARNING,
        BT_TRACE(TRACE_LAYER_HCI, TRACE_TYPE_WARNING,
                    "No command in queue matching opcode %d", opcode);
    }

@@ -1547,7 +1542,7 @@ void btu_hcif_cmd_timeout (UINT8 controller_id)
#if (defined(BTU_CMD_CMPL_TOUT_DOUBLE_CHECK) && BTU_CMD_CMPL_TOUT_DOUBLE_CHECK == TRUE)
    if (!(p_hci_cmd_cb->checked_hcisu))
    {
        BT_TRACE_1 (TRACE_LAYER_HCI, TRACE_TYPE_WARNING, "BTU HCI(id=%d) command timeout - double check HCISU", controller_id);
        BT_TRACE(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, "BTU HCI(id=%d) command timeout - double check HCISU", controller_id);

        /* trigger HCISU to read any pending data in transport buffer */
        GKI_send_event(HCISU_TASK, HCISU_EVT_MASK);
@@ -1569,7 +1564,7 @@ void btu_hcif_cmd_timeout (UINT8 controller_id)
    /* get queued command */
    if ((p_cmd = (BT_HDR *) GKI_dequeue (&(p_hci_cmd_cb->cmd_cmpl_q))) == NULL)
    {
        BT_TRACE_0 (TRACE_LAYER_HCI, TRACE_TYPE_WARNING, "Cmd timeout; no cmd in queue");
        BT_TRACE(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, "Cmd timeout; no cmd in queue");
        return;
    }

@@ -1592,7 +1587,7 @@ void btu_hcif_cmd_timeout (UINT8 controller_id)
    if (controller_id == NFC_CONTROLLER_ID)
    {
        //TODO call nfc_ncif_cmd_timeout
        BT_TRACE_2 (TRACE_LAYER_HCI, TRACE_TYPE_WARNING, "BTU NCI command timeout - header 0x%02x%02x", p[0], p[1]);
        BT_TRACE(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, "BTU NCI command timeout - header 0x%02x%02x", p[0], p[1]);
        return;
    }
#endif
@@ -1608,7 +1603,7 @@ void btu_hcif_cmd_timeout (UINT8 controller_id)
    ALOGE("#");
    ALOGE("######################################################################");
#else
    BT_TRACE_2 (TRACE_LAYER_HCI, TRACE_TYPE_WARNING, "BTU HCI(id=%d) command timeout. opcode=0x%x", controller_id, opcode);
    BT_TRACE(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, "BTU HCI(id=%d) command timeout. opcode=0x%x", controller_id, opcode);
#endif
// btla-specific ++

@@ -1648,11 +1643,6 @@ void btu_hcif_cmd_timeout (UINT8 controller_id)
               )
            {
                p_cplt_cback = *((void **)(p_cmd + 1));
#if 0
                BT_TRACE_2 (TRACE_LAYER_HCI, TRACE_TYPE_DEBUG,
                            "Restoring VSC callback for opcode=0x%04x, Callback function=0x%07x",
                            opcode, (UINT32)p_cplt_cback);
#endif
            }

            /* fake a command complete; first create a fake event */
@@ -1669,7 +1659,7 @@ void btu_hcif_cmd_timeout (UINT8 controller_id)
     times, Bluetooth process will be killed and restarted */
    if (num_hci_cmds_timed_out >= BTM_MAX_HCI_CMD_TOUT_BEFORE_RESTART)
    {
        BT_TRACE_1(TRACE_LAYER_HCI, TRACE_TYPE_ERROR,
        BT_TRACE(TRACE_LAYER_HCI, TRACE_TYPE_ERROR,
                  "Num consecutive HCI Cmd tout =%d Restarting BT process",num_hci_cmds_timed_out);

        usleep(10000); /* 10 milliseconds */
@@ -1678,7 +1668,7 @@ void btu_hcif_cmd_timeout (UINT8 controller_id)
    }
    else
    {
        BT_TRACE_1 (TRACE_LAYER_HCI, TRACE_TYPE_WARNING, "HCI Cmd timeout counter %d",
        BT_TRACE(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, "HCI Cmd timeout counter %d",
                    num_hci_cmds_timed_out);

        /* If anyone wants device status notifications, give him one */
@@ -1699,7 +1689,7 @@ void btu_hcif_cmd_timeout (UINT8 controller_id)
*******************************************************************************/
static void btu_hcif_hardware_error_evt (UINT8 *p)
{
    BT_TRACE_1 (TRACE_LAYER_HCI, TRACE_TYPE_ERROR, "Ctlr H/w error event - code:0x%x", *p);
    BT_TRACE(TRACE_LAYER_HCI, TRACE_TYPE_ERROR, "Ctlr H/w error event - code:0x%x", *p);

    /* If anyone wants device status notifications, give him one. */
    btm_report_device_status (BTM_DEV_STATUS_DOWN);
@@ -2268,7 +2258,7 @@ static void btu_hcif_encryption_key_refresh_cmpl_evt (UINT8 *p)

static void btu_ble_process_adv_pkt (UINT8 *p)
{
    BT_TRACE_0 (TRACE_LAYER_HCI, TRACE_TYPE_EVENT, "btu_ble_process_adv_pkt");
    BT_TRACE(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, "btu_ble_process_adv_pkt");

    btm_ble_process_adv_pkt(p);
}
+1 −1
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ UINT16 BTU_BleAclPktSize(void)
*******************************************************************************/
void btu_uipc_rx_cback(BT_HDR *p_msg)
{
    BT_TRACE_3 (TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, "btu_uipc_rx_cback event 0x%x, len %d, offset %d",
    BT_TRACE(TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, "btu_uipc_rx_cback event 0x%x, len %d, offset %d",
		p_msg->event, p_msg->len, p_msg->offset);
    GKI_send_msg(BTU_TASK, BTU_HCI_RCV_MBOX, p_msg);

Loading