[Non ACR] Minimizing logs & source alignment 11/231211/4
authorAbhishek Vijay <abhishek.v@samsung.com>
Mon, 20 Apr 2020 07:11:34 +0000 (12:41 +0530)
committerRandeep Singh <randeep.s@samsung.com>
Mon, 20 Apr 2020 07:43:14 +0000 (07:43 +0000)
Change-Id: I8b1e1d46ed6189915bbb260d314b2db12833bb2f
Signed-off-by: Abhishek Vijay <abhishek.v@samsung.com>
include/bm_dbg.h
src/bm_config_parser.c
src/bm_plugin_manager.c

index d7d1f9e..a749b9c 100644 (file)
@@ -53,9 +53,13 @@ extern "C"
 
 #define BM_SLOGE(fmt, arg...) SECURE_LOGE(": " fmt "\n", ##arg);
 
+#if 0
 #define ENTER dlog_print(DLOG_DEBUG, LOG_TAG, "%s : %s(%d) >>>>>>>> CALLED", rindex(__FILE__, '/') + 1, __func__, __LINE__)
-
 #define EXIT  dlog_print(DLOG_DEBUG, LOG_TAG, "%s : %s(%d) <<<<<<<< ENDED", rindex(__FILE__, '/') + 1, __func__, __LINE__)
+#else
+#define ENTER
+#define EXIT
+#endif
 
 #ifdef __cplusplus
 }
index bbc9f75..9641bc6 100644 (file)
@@ -56,7 +56,7 @@ static char* bm_read_content_from_file(const char *file_name)
                goto END;
        }
 
-       _INFO("read [%zd] bytes from [%s]", len, file_name);
+       _DBG("read [%zd] bytes from [%s]", len, file_name);
 
        EXIT;
        return (char *)contents;
@@ -65,7 +65,7 @@ END:
 }
 
 int bm_get_wifi_power_params(double *rssi_l0, double *rssi_l1, double *rssi_l2, double *rssi_l3,
-                                       double *rssi_l4, double *scan, double *idle, double *rx, double *tx)
+                               double *rssi_l4, double *scan, double *idle, double *rx, double *tx)
 {
        ENTER;
 
@@ -158,7 +158,8 @@ END:
        return ret;
 }
 
-int bm_get_blutooth_power_params(double *idle, double *scan, double *connected, double *rx, double *tx)
+int bm_get_blutooth_power_params(double *idle, double *scan, double *connected,
+                                                               double *rx, double *tx)
 {
        ENTER;
 
@@ -225,9 +226,9 @@ END:
        return ret;
 }
 
-int bm_get_device_network_power_params(double *signal_strength0, double *signal_strength1, double *signal_strength2,
-                                       double *signal_strength3, double *signal_strength4, double *signal_strength5,
-                                       double *signal_strength6, double *rx, double *tx)
+int bm_get_device_network_power_params(double *signal_strength0, double *signal_strength1,
+                       double *signal_strength2, double *signal_strength3, double *signal_strength4,
+                       double *signal_strength5, double *signal_strength6, double *rx, double *tx)
 {
        ENTER;
 
@@ -305,10 +306,10 @@ int bm_get_device_network_power_params(double *signal_strength0, double *signal_
                goto END;
        *tx = json_object_get_double(jdouble);
 
-       _DBG("device-network power params - signal_strength0[%lf], signal_strength1[%lf], signal_strength2[%lf], \
-               signal_strength3[%lf], signal_strength4[%lf], signal_strength5[%lf], signal_strength6[%lf], rx[%lf], \
-               tx[%lf]", *signal_strength0, *signal_strength1, *signal_strength2, *signal_strength3, \
-               *signal_strength4, *signal_strength5, *signal_strength6, *rx, *tx);
+       _DBG("device-network params - signal_strength [%lf, %lf, %lf, %lf, %lf, %lf, %lf], \
+               rx[%lf], tx[%lf]", *signal_strength0, *signal_strength1, *signal_strength2,
+               *signal_strength3, *signal_strength4, *signal_strength5, *signal_strength6,
+               *rx, *tx);
 
        ret = BATTERY_MONITOR_ERROR_NONE;
 END:
@@ -363,7 +364,7 @@ int bm_get_display_power_params(double *high, double *medium, double *low)
        *low = json_object_get_double(jdouble);
 
        _DBG("display power params - high[%lf], medium[%lf], low[%lf]",
-                       *high, *medium, *low);
+                                               *high, *medium, *low);
 
        ret = BATTERY_MONITOR_ERROR_NONE;
 END:
@@ -551,7 +552,8 @@ END:
        return ret;
 }
 
-int bm_get_job_scheduler_params(int *data_collection_period, int *data_collection_try_period, int *data_collection_accept_count, int *delete_db_period)
+int bm_get_job_scheduler_params(int *data_collection_period, int *data_collection_try_period,
+                                       int *data_collection_accept_count, int *delete_db_period)
 {
        ENTER;
 
@@ -598,7 +600,9 @@ int bm_get_job_scheduler_params(int *data_collection_period, int *data_collectio
                goto END;
        *delete_db_period = json_object_get_int(jint);
 
-       _DBG("job scheduler params - data_collection_period[%d], data_collection_try_period[%d], data_collection_accept_count[%d], delete_db_period[%d]", *data_collection_period, *data_collection_try_period, *data_collection_accept_count, *delete_db_period);
+       _DBG("job scheduler params - data_collection_period[%d], data_collection_try_period[%d], \
+               data_collection_accept_count[%d], delete_db_period[%d]", *data_collection_period,
+               *data_collection_try_period, *data_collection_accept_count, *delete_db_period);
 
        ret = BATTERY_MONITOR_ERROR_NONE;
 END:
@@ -610,7 +614,8 @@ END:
        return ret;
 }
 
-int bm_get_cpu_usage_checker_params(int *timeout, double *initial_threshold, double *minimum_threshold, double *threshold_reduction)
+int bm_get_cpu_usage_checker_params(int *timeout, double *initial_threshold,
+                                       double *minimum_threshold, double *threshold_reduction)
 {
        ENTER;
 
@@ -657,7 +662,9 @@ int bm_get_cpu_usage_checker_params(int *timeout, double *initial_threshold, dou
                goto END;
        *threshold_reduction = json_object_get_double(jdouble);
 
-       _DBG("data collection params - timeout[%d], initial_threshold[%lf], minimum_threshold[%lf], threshold_reduction[%lf]", *timeout, *initial_threshold, *minimum_threshold, *threshold_reduction);
+       _DBG("data collection params - timeout[%d], initial_threshold[%lf], \
+               minimum_threshold[%lf], threshold_reduction[%lf]", *timeout, *initial_threshold,
+               *minimum_threshold, *threshold_reduction);
 
        ret = BATTERY_MONITOR_ERROR_NONE;
 END:
index e047f2b..337ef4b 100644 (file)
@@ -35,10 +35,8 @@ const bm_callbacks_st gps_cb;
 const bm_callbacks_st hrm_cb;
 #endif
 
-void bm_populate_callbacks(void)
+inline void bm_populate_callbacks(void)
 {
-       ENTER;
-
        bm_receiver_callbacks[BM_DATA_TYPE_BLE] = &ble_cb;
        bm_receiver_callbacks[BM_DATA_TYPE_WIFI] = &wifi_cb;
        bm_receiver_callbacks[BM_DATA_TYPE_CPU] = &cpu_cb;
@@ -49,7 +47,6 @@ void bm_populate_callbacks(void)
        bm_receiver_callbacks[BM_DATA_TYPE_HRM_SENSOR] = &hrm_cb;
 #endif /* DISABLE_FEATURE_DATA_FROM_GPS_HRM_PLUGIN */
 
-       EXIT;
        return;
 }
 
@@ -111,8 +108,6 @@ static int bm_init_loaded_plugins()
        bm_plugin_info_h *bm_plugin = NULL;
        const bm_callbacks_st *bm_cb = NULL;
 
-       _INFO("populate callbacks");
-
        bm_populate_callbacks();
 #ifdef DISABLE_FEATURE_DATA_FROM_GPS_HRM_PLUGIN
        for (id = BM_PLUGIN_ID_BLE; id < BM_PLUGIN_ID_MAX; ++id) {