debugch: modify the emulator log print format. 54/30554/1
authorSooyoung Ha <yoosah.ha@samsung.com>
Thu, 20 Nov 2014 07:02:54 +0000 (16:02 +0900)
committerSooyoung Ha <yoosah.ha@samsung.com>
Thu, 20 Nov 2014 07:02:54 +0000 (16:02 +0900)
log shows the time resolution to milliseconds
fix the debug class output name length to 4 characters
limit the debug channel name length to 10 characters
remove the useless prefix of debug channel name

Change-Id: I82ffaa15d834fde005bf7859fd3b41545a2438e9
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
35 files changed:
hw/9pfs/virtio-9p-local-maru.c
hw/9pfs/virtio-9p-maru.c
tizen/src/display/maru_finger.c
tizen/src/display/maru_sdl.c
tizen/src/display/maru_sdl_processing.c
tizen/src/display/maru_shm.c
tizen/src/ecs/ecs_eventcast.c
tizen/src/eventcast/common.c
tizen/src/eventcast/encode_fb.c
tizen/src/eventcast/sensor.c
tizen/src/eventcast/touch.c
tizen/src/hw/maru_pm.c
tizen/src/hw/pci/maru_brightness.c
tizen/src/hw/pci/maru_camera_common_pci.c
tizen/src/hw/pci/maru_camera_darwin_converter.c
tizen/src/hw/pci/maru_camera_darwin_pci.m
tizen/src/hw/pci/maru_camera_linux_pci.c
tizen/src/hw/pci/maru_camera_win32_pci.c
tizen/src/hw/usb/maru_usb_touchscreen.c
tizen/src/hw/virtio/maru_virtio_esm.c
tizen/src/hw/virtio/maru_virtio_evdi.c
tizen/src/hw/virtio/maru_virtio_jack.c
tizen/src/hw/virtio/maru_virtio_keyboard.c
tizen/src/hw/virtio/maru_virtio_nfc.c
tizen/src/hw/virtio/maru_virtio_power.c
tizen/src/hw/virtio/maru_virtio_sensor.c
tizen/src/hw/virtio/maru_virtio_touchscreen.c
tizen/src/hw/virtio/maru_virtio_vmodem.c
tizen/src/skin/maruskin_client.c
tizen/src/skin/maruskin_keymap.c
tizen/src/skin/maruskin_operation.c
tizen/src/skin/maruskin_server.c
tizen/src/util/new_debug_ch.c
tizen/src/util/new_debug_ch.h
tizen/src/util/osutil.h

index 21406a0..2147fd2 100644 (file)
@@ -50,7 +50,7 @@
 #endif
 
 #include "tizen/src/util/new_debug_ch.h"
-DECLARE_DEBUG_CHANNEL(9p_local);
+DECLARE_DEBUG_CHANNEL(9pfs_local);
 
 #ifndef XFS_SUPER_MAGIC
 #define XFS_SUPER_MAGIC  0x58465342
index 9556dbd..0811794 100644 (file)
@@ -57,7 +57,7 @@ extern uint64_t hostBytesPerSector;
 #endif
 
 #include "../../tizen/src/debug_ch.h"
-MULTI_DEBUG_CHANNEL(tizen, qemu_9p_test);
+MULTI_DEBUG_CHANNEL(tizen, 9pfs);
 
 int open_fd_hw;
 int total_open_fd;
index de365e8..e628b5d 100644 (file)
@@ -36,7 +36,7 @@
 #include "hw/virtio/maru_virtio_touchscreen.h"
 #include "debug_ch.h"
 
-MULTI_DEBUG_CHANNEL(qemu, maru_finger);
+MULTI_DEBUG_CHANNEL(qemu, finger);
 
 
 /* ===== Reference: http://content.gpwiki.org/index.php/SDL:Tutorials:Drawing_and_Filling_Circles ===== */
index 43aea68..adad35e 100644 (file)
@@ -45,7 +45,7 @@
 #include <SDL_syswm.h>
 #endif
 
-MULTI_DEBUG_CHANNEL(tizen, maru_sdl);
+MULTI_DEBUG_CHANNEL(tizen, sdl);
 
 static DisplayChangeListener *dcl;
 
index 174198e..dbe2a15 100644 (file)
@@ -33,7 +33,7 @@
 #include "hw/pci/maru_brightness.h"
 #include "debug_ch.h"
 
-MULTI_DEBUG_CHANNEL(tizen, sdl_processing);
+MULTI_DEBUG_CHANNEL(tizen, sdl_op);
 
 
 /* Image processing functions using the pixman library */
index 12674d7..226e888 100644 (file)
@@ -42,7 +42,7 @@
 
 #include "eventcast/encode_fb.h"
 
-MULTI_DEBUG_CHANNEL(tizen, maru_shm);
+MULTI_DEBUG_CHANNEL(tizen, shm);
 
 static DisplayChangeListener *dcl;
 
index a2792cb..45261b9 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "util/new_debug_ch.h"
 
-DECLARE_DEBUG_CHANNEL(ecs_eventcast);
+DECLARE_DEBUG_CHANNEL(ecs);
 
 #define MSG_BUF_SIZE  255
 #define MSG_LEN_SIZE    4
index f7c1538..0a8fb35 100644 (file)
@@ -50,7 +50,7 @@
 
 #include "util/new_debug_ch.h"
 
-DECLARE_DEBUG_CHANNEL(app_eventcast);
+DECLARE_DEBUG_CHANNEL(eventcast);
 
 #define EVENTCAST_MSG_HANDSHAKE_KEY     100
 #define MSG_BUF_SIZE    255
index 1f5bf5c..48d457d 100644 (file)
@@ -45,7 +45,7 @@
 
 #include "util/new_debug_ch.h"
 
-DECLARE_DEBUG_CHANNEL(app_eventcast);
+DECLARE_DEBUG_CHANNEL(eventcast);
 
 #if !defined(CONFIG_SDL) && !defined(CONFIG_USE_SHM)
 bool maru_extract_framebuffer(void *buffer)
index 952c218..8ceaafc 100644 (file)
@@ -50,7 +50,7 @@
 
 #include "util/new_debug_ch.h"
 
-DECLARE_DEBUG_CHANNEL(app_eventcast);
+DECLARE_DEBUG_CHANNEL(eventcast);
 
 typedef struct sensor_state {
     bool is_sensor_event;
index f0be2b4..5d2ae70 100644 (file)
@@ -37,7 +37,7 @@
 #include "ecs/ecs_eventcast.h"
 #include "util/new_debug_ch.h"
 
-DECLARE_DEBUG_CHANNEL(app_eventcast);
+DECLARE_DEBUG_CHANNEL(eventcast);
 
 static int touch_device_status;
 static bool send_display_image_data(void);
index c983364..2fcf610 100644 (file)
@@ -34,7 +34,7 @@
 #include "util/sdb.h"
 
 /* define debug channel */
-MULTI_DEBUG_CHANNEL(tizen, maru_pm);
+MULTI_DEBUG_CHANNEL(tizen, power_mgr);
 
 ACPIREGS *maru_pm_ar;
 acpi_update_sci_fn maru_pm_update_sci;
index 7cc309f..a6eb9a2 100644 (file)
@@ -39,7 +39,7 @@
 #include "skin/maruskin_server.h"
 #include "debug_ch.h"
 
-MULTI_DEBUG_CHANNEL(tizen, maru-brightness);
+MULTI_DEBUG_CHANNEL(tizen, brightness);
 
 #define QEMU_DEV_NAME           "maru-brightness"
 
index 694dea4..882d833 100644 (file)
@@ -43,7 +43,7 @@
 #include "hw/maru_device_ids.h"
 #include "debug_ch.h"
 
-MULTI_DEBUG_CHANNEL(tizen, maru-camera);
+MULTI_DEBUG_CHANNEL(tizen, camera);
 
 #define MARU_PCI_CAMERA_DEVICE_NAME     "maru-camera"
 
index 24c560f..3f9cec5 100644 (file)
@@ -32,7 +32,7 @@
 #include "maru_camera_darwin.h"
 #include "debug_ch.h"
 
-MULTI_DEBUG_CHANNEL(tizen, camera_darwin);
+MULTI_DEBUG_CHANNEL(tizen, camera);
 
 static void UYVYToYUV420(unsigned char *bufsrc, unsigned char *bufdest,
                          int width, int height);
index 46df90c..b470da3 100644 (file)
@@ -38,7 +38,7 @@
 #include "maru_camera_darwin.h"
 #include "debug_ch.h"
 
-MULTI_DEBUG_CHANNEL(tizen, maru-camera);
+MULTI_DEBUG_CHANNEL(tizen, camera);
 
 #define MARUCAM_THREAD_NAME    "marucam_worker_thread"
 
index 751e467..406478b 100644 (file)
@@ -41,7 +41,7 @@
 #include <libv4l2.h>
 #include <libv4lconvert.h>
 
-MULTI_DEBUG_CHANNEL(tizen, maru-camera);
+MULTI_DEBUG_CHANNEL(tizen, camera);
 
 #define MARUCAM_THREAD_NAME    "marucam_worker_thread"
 
index 719006f..550bbce 100644 (file)
@@ -39,7 +39,7 @@
 #include "mmsystem.h"    /* for MAKEFOURCC macro */
 #include "maru_camera_win32_interface.h"
 
-MULTI_DEBUG_CHANNEL(tizen, maru-camera);
+MULTI_DEBUG_CHANNEL(tizen, camera);
 
 /*
  * COM Interface implementations
index 3f1b7e8..6ed8703 100644 (file)
@@ -32,7 +32,7 @@
 #include "maru_usb_touchscreen.h"
 #include "debug_ch.h"
 
-MULTI_DEBUG_CHANNEL(qemu, usb_touchscreen);
+MULTI_DEBUG_CHANNEL(qemu, usb_tsp);
 
 
 #define MAX_TOUCH_EVENT_CNT 128
index 455c33b..03b863d 100644 (file)
@@ -32,7 +32,7 @@
 #include "emul_state.h"
 #include "debug_ch.h"
 
-MULTI_DEBUG_CHANNEL(qemu, virtio-esm);
+MULTI_DEBUG_CHANNEL(qemu, esm);
 
 
 #define SYSTEM_MODE_LAYER 1
index d3ff432..7e7a417 100644 (file)
@@ -33,7 +33,7 @@
 #include "debug_ch.h"
 #include "ecs/ecs.h"
 
-MULTI_DEBUG_CHANNEL(qemu, virtio-evdi);
+MULTI_DEBUG_CHANNEL(qemu, evdi);
 
 #define EVDI_DEVICE_NAME "virtio-evdi"
 
index a30e004..eb7139a 100644 (file)
@@ -36,7 +36,7 @@
 
 #include "maru_virtio_jack.h"
 
-MULTI_DEBUG_CHANNEL(qemu, virtio-jack);
+MULTI_DEBUG_CHANNEL(qemu, jack);
 
 #define JACK_DEVICE_NAME  "jack"
 #define _MAX_BUF          1024
index 7132d51..745934b 100644 (file)
@@ -33,7 +33,7 @@
 #include "debug_ch.h"
 
 
-MULTI_DEBUG_CHANNEL(qemu, virtio-kbd);
+MULTI_DEBUG_CHANNEL(qemu, keyboard);
 
 VirtIOKeyboard *vkbd;
 VirtQueueElement elem;
index df589f0..e7a68b7 100644 (file)
@@ -33,7 +33,7 @@
 #include "debug_ch.h"
 #include "ecs/ecs.h"
 
-MULTI_DEBUG_CHANNEL(qemu, virtio-nfc);
+MULTI_DEBUG_CHANNEL(qemu, nfc);
 
 #define NFC_DEVICE_NAME "virtio-nfc"
 
index c275fdd..38dd4fd 100644 (file)
@@ -36,7 +36,7 @@
 
 #include "maru_virtio_power.h"
 
-MULTI_DEBUG_CHANNEL(qemu, virtio-power);
+MULTI_DEBUG_CHANNEL(qemu, power);
 
 #define POWER_DEVICE_NAME  "power_supply"
 #define _MAX_BUF           1024
index 6efedac..09b2100 100644 (file)
@@ -34,7 +34,7 @@
 #include "debug_ch.h"
 #include "ecs/ecs.h"
 
-MULTI_DEBUG_CHANNEL(qemu, virtio-sensor);
+MULTI_DEBUG_CHANNEL(qemu, sensor);
 
 #define SENSOR_DEVICE_NAME  "sensor"
 #define _MAX_BUF            1024
index 4e60b8b..85b5960 100644 (file)
@@ -33,7 +33,7 @@
 #include "emul_state.h"
 #include "debug_ch.h"
 
-MULTI_DEBUG_CHANNEL(qemu, touchscreen);
+MULTI_DEBUG_CHANNEL(qemu, tsp);
 
 
 #define DEVICE_NAME "virtio-touchscreen"
index 6206cd4..3e6bb10 100644 (file)
@@ -34,7 +34,7 @@
 #include "util/new_debug_ch.h"
 #include "ecs/ecs.h"
 
-DECLARE_DEBUG_CHANNEL(virtio-vmodem);
+DECLARE_DEBUG_CHANNEL(vmodem);
 
 #define VMODEM_DEVICE_NAME "virtio-vmodem"
 
index e6a97dc..da8f8af 100644 (file)
@@ -48,7 +48,7 @@
 #include "util/maru_err_table.h"
 #endif
 
-MULTI_DEBUG_CHANNEL(qemu, skin_client);
+MULTI_DEBUG_CHANNEL(qemu, skinclient);
 
 
 #define SKIN_SERVER_READY_TIME 3 /* second */
index 0dbdc65..3a15284 100644 (file)
@@ -31,7 +31,7 @@
 #include "emul_state.h"
 #include "debug_ch.h"
 
-MULTI_DEBUG_CHANNEL(qemu, skin_keymap);
+MULTI_DEBUG_CHANNEL(qemu, skinkeymap);
 
 #ifdef KEYMAP_DEBUG
 static void trace_binary(int decimal)
index f2611ec..6facb3b 100644 (file)
@@ -57,7 +57,7 @@
 #include "target-i386/hax-i386.h"
 #endif
 
-MULTI_DEBUG_CHANNEL(qemu, skin_operation);
+MULTI_DEBUG_CHANNEL(qemu, skin_op);
 
 
 #define RESUME_KEY_SEND_INTERVAL 500 /* milli-seconds */
index 5899b11..fcc7b8d 100644 (file)
@@ -57,7 +57,7 @@
 
 #include "debug_ch.h"
 
-MULTI_DEBUG_CHANNEL(qemu, skin_server);
+MULTI_DEBUG_CHANNEL(qemu, skinserver);
 
 
 #define MAX_REQ_ID 0x7fffffff
index cddb692..8537ee3 100644 (file)
@@ -41,7 +41,7 @@ static char debugchfile[MAX_FILE_LEN] = {0, };
 static int fd = STDOUT_FILENO;
 
 static const char * const debug_classes[] =
-        {"SEVERE", "WARNING", "INFO", "CONFIG", "FINE", "TRACE"};
+        {"SEVR", "WARN", "INFO", "CONF", "FINE", "TRCE"};
 
 #define MAX_DEBUG_OPTIONS 256
 
@@ -294,10 +294,12 @@ int dbg_log(enum _debug_class cls, struct _debug_channel *channel,
 
     if (!(_dbg_get_channel_flags(channel) & (1 << cls))) {
         return -1;
+    } else {
+        channel->name[MAX_NAME_LEN] = '\0';
     }
 
     ret += get_timeofday(buf_msg, sizeof(buf_msg));
-    ret += g_snprintf(buf_msg + ret, sizeof(buf_msg) - ret, "(%5d) [%s:%s] ",
+    ret += g_snprintf(buf_msg + ret, sizeof(buf_msg) - ret, "(%5d) [%4s:%10s] ",
                 qemu_get_thread_id(), debug_classes[cls], channel->name);
 
     va_start(valist, format);
index 6a0de05..6be8fb2 100644 (file)
@@ -35,7 +35,7 @@
 
 #include <sys/types.h>
 
-#define MAX_NAME_LEN    15
+#define MAX_NAME_LEN    10
 // #define NO_DEBUG
 
 #ifdef __cplusplus
index e0edb0b..75982d4 100644 (file)
@@ -120,7 +120,7 @@ static inline int get_timeofday(char *buf, size_t size)
     ptm = localtime(&ti);
     ret = strftime(buf, size, "%H:%M:%S", ptm);
 
-    return ret + g_snprintf(buf + ret, size - ret, ".%06ld", (long)tv.tv_usec);
+    return ret + g_snprintf(buf + ret, size - ret, ".%03ld", (long)tv.tv_usec/1000);
 }
 
 int get_number_of_processors(void);