Fix build errors for TTRACE_DEBUG 61/289061/2
authorSung-hun Kim <sfoon.kim@samsung.com>
Mon, 27 Feb 2023 10:25:23 +0000 (19:25 +0900)
committerSung-hun Kim <sfoon.kim@samsung.com>
Tue, 28 Feb 2023 07:55:45 +0000 (16:55 +0900)
Due to the formatting error, ttrace package cannot be built
if TTRACE_DEBUG is defined. This patch fixes this errors by
applying proper formats.

Change-Id: If949de75f3c3cf436a76749770f381651b40a9a9
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
src/ttrace.c

index 361962de0aab23a790518cd1f09975117f1f3798..426d2723112174e84f89b0ef0d9e738052270bb0 100755 (executable)
@@ -114,7 +114,7 @@ static uint64_t traceInit()
 /* LCOV_EXCL_STOP */
                }
        }
-       TTRACE_LOG("traceInit:: cur_enabled_tag >> %u", *cur_enabled_tag);
+       TTRACE_LOG("traceInit:: cur_enabled_tag >> %" PRIu64, *cur_enabled_tag);
 
        return *cur_enabled_tag;
 }
@@ -156,7 +156,7 @@ void traceBegin(uint64_t tag, const char *name, ...)
                int len = MAX_HEAD_LEN, ret = 0;
                va_list ap;
 
-               TTRACE_LOG("traceBegin:: write >> tag: %u tag_bit: %u", tag, *cur_enabled_tag);
+               TTRACE_LOG("traceBegin:: write >> tag: %" PRIu64 " tag_bit: %" PRIu64, tag, *cur_enabled_tag);
 
                va_start(ap, name);
                snprintf(buf, MAX_LEN, "B|%5d|", getpid());
@@ -176,7 +176,7 @@ void traceBegin(uint64_t tag, const char *name, ...)
 /* LCOV_EXCL_STOP */
        }
        else
-               TTRACE_LOG("traceBegin:: disabled tag >> tag: %u tag_bit: %u", tag, *cur_enabled_tag);
+               TTRACE_LOG("traceBegin:: disabled tag >> tag: %" PRIu64 " tag_bit: %" PRIu64, tag, *cur_enabled_tag);
 }
 
 void traceEnd(uint64_t tag)
@@ -185,7 +185,7 @@ void traceEnd(uint64_t tag)
                int ret = 0;
                int len = 1;
                char end = 'E';
-               TTRACE_LOG("traceEnd:: write>> tag: %u tag_bit: %u", tag, *cur_enabled_tag);
+               TTRACE_LOG("traceEnd:: write>> tag: %" PRIu64 " tag_bit: %" PRIu64, tag, *cur_enabled_tag);
 
                if (check_params(g_trace_handle_fd, &end, len, __func__) < 0)
                        return;
@@ -196,7 +196,7 @@ void traceEnd(uint64_t tag)
                                        len, ret, errno);
        }
        else
-               TTRACE_LOG("traceEnd:: disabled tag >> tag: %u tag_bit: %u", tag, *cur_enabled_tag);
+               TTRACE_LOG("traceEnd:: disabled tag >> tag: %" PRIu64 " tag_bit: %" PRIu64, tag, *cur_enabled_tag);
 }
 
 /*
@@ -213,7 +213,7 @@ void traceAsyncBegin(uint64_t tag, int32_t cookie, const char *name, ...)
                int len = MAX_HEAD_LEN, ret = 0;
                va_list ap;
 
-               TTRACE_LOG("traceAsyncBegin:: write >> tag: %u tag_bit: %u cookie: %d", tag, *cur_enabled_tag, cookie);
+               TTRACE_LOG("traceAsyncBegin:: write >> tag: %" PRIu64 " tag_bit: %" PRIu64 " cookie: %d", tag, *cur_enabled_tag, cookie);
 
                va_start(ap, name);
                snprintf(buf, MAX_LEN, "S|%5d|", getpid());
@@ -237,7 +237,7 @@ void traceAsyncBegin(uint64_t tag, int32_t cookie, const char *name, ...)
                                        len, ret, errno);
        }
        else
-               TTRACE_LOG("traceAsyncBegin:: disabled tag >> tag: %u tag_bit: %u", tag, *cur_enabled_tag);
+               TTRACE_LOG("traceAsyncBegin:: disabled tag >> tag: %" PRIu64 "tag_bit: %" PRIu64, tag, *cur_enabled_tag);
 }
 
 void traceAsyncEnd(uint64_t tag, int32_t cookie, const char *name, ...)
@@ -247,7 +247,7 @@ void traceAsyncEnd(uint64_t tag, int32_t cookie, const char *name, ...)
                int len = MAX_HEAD_LEN, ret = 0;
                va_list ap;
 
-               TTRACE_LOG("traceAsyncEnd:: write>> tag: %u tag_bit: %u", tag, *cur_enabled_tag);
+               TTRACE_LOG("traceAsyncEnd:: write>> tag: %" PRIu64 " tag_bit: %" PRIu64, tag, *cur_enabled_tag);
                va_start(ap, name);
                snprintf(buf, MAX_LEN, "F|%5d|", getpid());
                len += vsnprintf(buf + MAX_HEAD_LEN, POS_LABEL_ST, name, ap);
@@ -270,7 +270,7 @@ void traceAsyncEnd(uint64_t tag, int32_t cookie, const char *name, ...)
                                        len, ret, errno);
        }
        else
-               TTRACE_LOG("traceAsyncEnd:: disabled tag >> tag: %u tag_bit: %u", tag, *cur_enabled_tag);
+               TTRACE_LOG("traceAsyncEnd:: disabled tag >> tag: %" PRIu64 " tag_bit: %" PRIu64, tag, *cur_enabled_tag);
 }
 
 /*
@@ -286,7 +286,7 @@ void traceMark(uint64_t tag, const char *name, ...)
                int len = MAX_HEAD_LEN, ret = 0;
                va_list ap;
 
-               TTRACE_LOG("traceMark:: write >> tag: %u tag_bit: %u", tag, *cur_enabled_tag);
+               TTRACE_LOG("traceMark:: write >> tag: %" PRIu64 " tag_bit: %" PRIu64, tag, *cur_enabled_tag);
                va_start(ap, name);
                snprintf(buf, MAX_LEN, "B|%5d|", getpid());
                len += vsnprintf(buf + MAX_HEAD_LEN, POS_LABEL_ST, name, ap);
@@ -311,7 +311,7 @@ void traceMark(uint64_t tag, const char *name, ...)
                                        len, ret, errno);
        }
        else
-               TTRACE_LOG("traceMark:: disabled tag >> tag: %u tag_bit: %u", tag, *cur_enabled_tag);
+               TTRACE_LOG("traceMark:: disabled tag >> tag: %" PRIu64 " tag_bit: %" PRIu64, tag, *cur_enabled_tag);
 }
 
 /* LCOV_EXCL_STOP */