[LOG] Remove unnecessary logs and fix some log typos
authorDongju Chae <dongju.chae@samsung.com>
Tue, 26 Nov 2019 12:53:23 +0000 (21:53 +0900)
committer함명주/On-Device Lab(SR)/Principal Engineer/삼성전자 <myungjoo.ham@samsung.com>
Wed, 27 Nov 2019 09:29:49 +0000 (18:29 +0900)
This commit removes unnecessary logs and fixes some log typos.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
src/core/ne-host-input-service.c
src/core/ne-mem.c

index 2782e55..47f26a2 100644 (file)
@@ -29,7 +29,7 @@
 
 /** Enables debug level logs for NPU hardware */
 #ifndef DEBUG
-#define DEBUG 1
+#define DEBUG 0
 #endif
 
 /** Tag for logging */
@@ -202,7 +202,7 @@ static void* loopHostService (void *data)
         npriv->opmode == NPUINPUT_HOST) {
       pthread_cond_wait (&npriv->proc_thread.cond, &npriv->proc_thread.mutex);
       if (npriv->proc_thread.state == HALT_REQUESTED) {
-        loginfo (TAG, "Service halted with HALT_NOW");
+        loginfo (TAG, "Service halted with HALT_NOW\n");
         goto exit;
       }
     }
@@ -211,7 +211,7 @@ static void* loopHostService (void *data)
     status = npu_check_compute_ready(npriv->fd);
     if (status == -EBUSY && npriv->opmode == NPUINPUT_HOST) {
       /** TODO: Later change to not-error and add wait for ready here */
-      logerr (TAG, "Device busy by other application??");
+      logerr (TAG, "Device busy by other application??\n");
       npriv->proc_thread.state = ERROR;
       goto exit;
     } else if (status < 0) {
@@ -225,12 +225,12 @@ static void* loopHostService (void *data)
       /** use the information from npriv->proc_thread */
       status = buffer_get_hwmem(npriv->proc_thread.buffer, &hwmem_ptr);
       if (status < 0) {
-        logerr (TAG, "Getting hwmem failed, errno: \n", status);
+        logerr (TAG, "Getting hwmem failed, errno: %d\n", status);
         npriv->proc_thread.state = ERROR;
         goto exit;
       }
       if ((status = hwmem_get_offset(hwmem_ptr, &hwmem_offset)) < 0) {
-        logerr (TAG, "Getting hwmem failed, errno: \n", status);
+        logerr (TAG, "Getting hwmem offset failed, errno: %d\n", status);
         npriv->proc_thread.state = ERROR;
         goto exit;
       }
@@ -441,7 +441,7 @@ static n40_status getStatusHost (inputservice *me)
 {
   int status;
   n40_status nstatus;
-#ifdef DEBUG
+#if DEBUG == 1
   struct srnpu_status_arg * npu_status;
 #endif
   host_inservice_priv *npriv;
@@ -449,7 +449,7 @@ static n40_status getStatusHost (inputservice *me)
   npriv = HOST_PRIV (me);
   assert (npriv);
 
-#ifdef DEBUG
+#if DEBUG == 1
   npu_status = npu_get_status (npriv->fd);
   if (npu_status != NULL) {
     loginfo(TAG, "CP_INFO: %x\n", npu_status->cp_info);
index f8166ef..7986b51 100644 (file)
@@ -17,7 +17,6 @@
 #include <GEMdrvAPI.h>
 #include <TLBdrvAPI.h>
 
-#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
@@ -1728,8 +1727,6 @@ mem_reset_buffer (buffer *buffer)
 
   MEM_LOCK();
 
-  fprintf (stderr, "buffer reset %d->0, ref_count %d\n", priv->state, priv->ref_count);
-
   priv->state = BUFFER_STATE_EMPTY;
   priv->ref_count = 0;