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

Commit 83951772 authored by Sharvil Nanavati's avatar Sharvil Nanavati Committed by Andre Eisenbach
Browse files

Add platform-independent logging macros to OSI.

These macros should replace ALOG* and the various trace macros
used throughout bluedroid. This change eliminates all uses of the
ALOG* macros in favor of the new ones.
parent 221a1b42
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
 *  limitations under the License.
 *
 ******************************************************************************/
#include <cutils/log.h>

#include "allocator.h"
#include "gki_int.h"
+2 −2
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@
 ******************************************************************************/

#include <assert.h>
#include <utils/Log.h>
#include "gki_int.h"
#include "osi/include/log.h"

#define GKI_NO_NEW_TMRS_STARTED (0x7fffffffL)   /* Largest signed positive timer count */

@@ -235,7 +235,7 @@ void GKI_timer_update (INT32 ticks_since_last_update)
    {
        // When using alarms from AlarmService we should
        // always have work to be done here.
        ALOGE("%s no work to be done when expected work", __func__);
        LOG_ERROR("%s no work to be done when expected work", __func__);
        gki_cb.com.timer_nesting = 0;
        return;
    }
+8 −8
Original line number Diff line number Diff line
@@ -32,13 +32,13 @@
#include <hardware/bluetooth.h>
#include <sys/prctl.h>
#include <sys/times.h>
#include <utils/Log.h>

#include "alarm.h"
#include "bt_utils.h"
#include "gki_int.h"
#include "module.h"
#include "osi.h"
#include "osi/include/log.h"

/*****************************************************************************
**  Constants & Macros
@@ -88,7 +88,7 @@ void alarm_service_reschedule() {
    if (alarm_ticks > 0)
        alarm_set(alarm_timer, GKI_TICKS_TO_MS(alarm_ticks), bt_alarm_cb, NULL);
    else
        ALOGV("%s no more alarms.", __func__);
        LOG_VERBOSE("%s no more alarms.", __func__);
}

static future_t *init(void)
@@ -395,20 +395,20 @@ void GKI_disable (void)

void GKI_exception(UINT16 code, char *msg)
{
    ALOGE( "GKI_exception(): Task State Table");
    LOG_ERROR( "GKI_exception(): Task State Table");

    for (int task_id = 0; task_id < GKI_MAX_TASKS; task_id++)
    {
        ALOGE( "TASK ID [%d] task name [%s] state [%d]",
        LOG_ERROR( "TASK ID [%d] task name [%s] state [%d]",
                         task_id,
                         gki_cb.com.task_name[task_id],
                         gki_cb.com.task_state[task_id]);
    }

    ALOGE("GKI_exception %d %s", code, msg);
    ALOGE( "********************************************************************");
    ALOGE( "* GKI_exception(): %d %s", code, msg);
    ALOGE( "********************************************************************");
    LOG_ERROR("GKI_exception %d %s", code, msg);
    LOG_ERROR( "********************************************************************");
    LOG_ERROR( "* GKI_exception(): %d %s", code, msg);
    LOG_ERROR( "********************************************************************");

    GKI_TRACE("GKI_exception %d %s done", code, msg);
}
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ LOCAL_SRC_FILES := \

LOCAL_C_INCLUDES += \
	. \
	$(LOCAL_PATH)/../ \
	$(LOCAL_PATH)/../utils/include

LOCAL_CFLAGS += -std=c99 $(bdroid_CFLAGS)
+5 −6
Original line number Diff line number Diff line
@@ -47,8 +47,7 @@
#include "bt_utils.h"

#define LOG_TAG "audio_a2dp_hw"
/* #define LOG_NDEBUG 0 */
#include <log/log.h>
#include "osi/include/log.h"

/*****************************************************************************
**  Constants & Macros
@@ -59,10 +58,10 @@

#define CASE_RETURN_STR(const) case const: return #const;

#define FNLOG()             ALOGV("%s", __FUNCTION__);
#define DEBUG(fmt, ...)     ALOGV("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
#define INFO(fmt, ...)      ALOGI("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
#define ERROR(fmt, ...)     ALOGE("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
#define FNLOG()             LOG_VERBOSE("%s", __FUNCTION__);
#define DEBUG(fmt, ...)     LOG_VERBOSE("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
#define INFO(fmt, ...)      LOG_INFO("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
#define ERROR(fmt, ...)     LOG_ERROR("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)

#define ASSERTC(cond, msg, val) if (!(cond)) {ERROR("### ASSERT : %s line %d %s (%d) ###", __FILE__, __LINE__, msg, val);}

Loading