From a16f15fd5fdc47d9ddb4270ceff098054aeeba0f Mon Sep 17 00:00:00 2001 From: Ahreum Jeong Date: Wed, 30 Aug 2017 16:24:54 +0900 Subject: [PATCH] Change t-trace API names for unique id from trace_begin/end_u to trace_begin/end_uid to make it clear. 'u' means unique ID for distinguishing events. --- .../testcase/le_tc/ttrace/ttrace_tc_main.c | 24 +++++++++++----------- apps/examples/ttrace/ttrace_main.c | 12 +++++------ lib/libc/libc.csv | 4 ++-- lib/libc/ttrace/lib_ttrace.c | 10 ++++----- os/include/tinyara/ttrace.h | 8 ++++---- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/apps/examples/testcase/le_tc/ttrace/ttrace_tc_main.c b/apps/examples/testcase/le_tc/ttrace/ttrace_tc_main.c index 59ca6d1..4fe4dc2 100644 --- a/apps/examples/testcase/le_tc/ttrace/ttrace_tc_main.c +++ b/apps/examples/testcase/le_tc/ttrace/ttrace_tc_main.c @@ -59,20 +59,20 @@ static void tc_libc_trace_begin(void) } /** -* @testcase tc_libc_trace_begin_u +* @testcase tc_libc_trace_begin_uid * @brief Record Tracepoint's unique id and begin time * @scenario Generates a dummy Tracepoint -* @apicovered trace_begin_u +* @apicovered trace_begin_uid * @precondition NA * @postcondition NA */ -static void tc_libc_trace_begin_u(void) +static void tc_libc_trace_begin_uid(void) { int ret; const int unique_id = 1; - ret = trace_begin_u(TTRACE_TAG_APPS, unique_id); - TC_ASSERT_GEQ("trace_begin_u", ret, 0) + ret = trace_begin_uid(TTRACE_TAG_APPS, unique_id); + TC_ASSERT_GEQ("trace_begin_uid", ret, 0) TC_SUCCESS_RESULT(); } @@ -94,19 +94,19 @@ static void tc_libc_trace_end(void) } /** -* @testcase tc_libc_trace_end_u +* @testcase tc_libc_trace_end_uid * @brief Record Tracepoint's end time * @scenario Generates a dummy Tracepoint -* @apicovered trace_end_u +* @apicovered trace_end_uid * @precondition NA * @postcondition NA */ -static void tc_libc_trace_end_u(void) +static void tc_libc_trace_end_uid(void) { int ret; - ret = trace_end_u(TTRACE_TAG_APPS); - TC_ASSERT_GEQ("trace_end_u", ret, 0) + ret = trace_end_uid(TTRACE_TAG_APPS); + TC_ASSERT_GEQ("trace_end_uid", ret, 0) TC_SUCCESS_RESULT(); } @@ -144,9 +144,9 @@ static int ttrace_tc_launcher(int argc, char **args) total_pass = 0; total_fail = 0; tc_libc_trace_begin(); - tc_libc_trace_begin_u(); + tc_libc_trace_begin_uid(); tc_libc_trace_end(); - tc_libc_trace_end_u(); + tc_libc_trace_end_uid(); tc_libc_trace_sched(); printf("#########################################\n"); printf(" T-trace TC Result \n"); diff --git a/apps/examples/ttrace/ttrace_main.c b/apps/examples/ttrace/ttrace_main.c index f2502c6..8606650 100644 --- a/apps/examples/ttrace/ttrace_main.c +++ b/apps/examples/ttrace/ttrace_main.c @@ -147,17 +147,17 @@ int ttrace_main(int argc, char *argv[]) #endif { while (1) { - trace_begin_u(TTRACE_TAG_APPS, 1); - trace_begin_u(TTRACE_TAG_LIBS, 2); - trace_begin_u(TTRACE_TAG_IPC, 5); + trace_begin_uid(TTRACE_TAG_APPS, 1); + trace_begin_uid(TTRACE_TAG_LIBS, 2); + trace_begin_uid(TTRACE_TAG_IPC, 5); outer_apps_func(); outer_libs_func(); outer_lock_func(); - trace_end_u(TTRACE_TAG_IPC); - trace_end_u(TTRACE_TAG_LIBS); - trace_end_u(TTRACE_TAG_APPS); + trace_end_uid(TTRACE_TAG_IPC); + trace_end_uid(TTRACE_TAG_LIBS); + trace_end_uid(TTRACE_TAG_APPS); } return 0; } diff --git a/lib/libc/libc.csv b/lib/libc/libc.csv index b16a0ae..21c8079 100644 --- a/lib/libc/libc.csv +++ b/lib/libc/libc.csv @@ -175,9 +175,9 @@ "time", "time.h", "", "time_t", "time_t *" "trace_sched", "ttrace.h", "", "int", "struct tcb_s", "struct tcb_s" "trace_begin", "ttrace.h", "", "int", "int", "char *str", "..." -"trace_begin_u", "ttrace.h", "", "int", "int", "int8_t" +"trace_begin_uid", "ttrace.h", "", "int", "int", "int8_t" "trace_end", "ttrace.h", "", "int", "int" -"trace_end_u", "ttrace.h", "", "int", "int" +"trace_end_uid", "ttrace.h", "", "int", "int" "ub16divub16", "fixedmath.h", "", "ub16_t", "ub16_t", "ub16_t" "ub16mulub16", "fixedmath.h", "", "ub16_t", "ub16_t", "ub16_t" "ub16sqr", "fixedmath.h", "", "ub16_t", "ub16_t" diff --git a/lib/libc/ttrace/lib_ttrace.c b/lib/libc/ttrace/lib_ttrace.c index 2fc85e6..e093ea3 100644 --- a/lib/libc/ttrace/lib_ttrace.c +++ b/lib/libc/ttrace/lib_ttrace.c @@ -209,13 +209,13 @@ static int create_packet(struct trace_packet *packet, char type, char *str, va_l return ret; } -static int create_packet_u(struct trace_packet *packet, char type, int8_t uid) +static int create_packet_uid(struct trace_packet *packet, char type, int8_t uniqueid) { int ret = 0; gettimeofday(&(packet->ts), NULL); packet->event_type = type; packet->pid = getpid(); - packet->codelen = TTRACE_CODE_UNIQUE | uid; + packet->codelen = TTRACE_CODE_UNIQUE | uniqueid; return ret; } @@ -283,7 +283,7 @@ int trace_begin(int tag, char *str, ...) return ret; } -int trace_begin_u(int tag, int8_t uid) +int trace_begin_uid(int tag, int8_t uniqueid) { int ret = TTRACE_VALID; struct trace_packet packet; @@ -292,7 +292,7 @@ int trace_begin_u(int tag, int8_t uid) return TTRACE_INVALID; } - ret = create_packet_u(&packet, TTRACE_EVENT_TYPE_BEGIN, uid); + ret = create_packet_uid(&packet, TTRACE_EVENT_TYPE_BEGIN, uniqueid); if (ret == TTRACE_INVALID) { assert(0); } @@ -339,7 +339,7 @@ int trace_end(int tag) return ret; } -int trace_end_u(int tag) +int trace_end_uid(int tag) { return trace_end(tag); } diff --git a/os/include/tinyara/ttrace.h b/os/include/tinyara/ttrace.h index 64fbe24..8aeb8f4 100644 --- a/os/include/tinyara/ttrace.h +++ b/os/include/tinyara/ttrace.h @@ -128,7 +128,7 @@ int trace_begin(int tag, char *str, ...); * @return On success, TTRACE_VALID is returned. On failure, TTRACE_INVALID is returned and errno is set appropriately. * @since Tizen RT vX.X */ -int trace_begin_u(int tag, int8_t uid); +int trace_begin_uid(int tag, int8_t uniqueid); /** * @ingroup TTRACE_LIBC @@ -146,7 +146,7 @@ int trace_end(int tag); * @return On success, TTRACE_VALID is returned. On failure, TTRACE_INVALID is returned and errno is set appropriately. * @since Tizen RT vX.X */ -int trace_end_u(int tag); +int trace_end_uid(int tag); /** * @ingroup TTRACE_LIBC @@ -159,9 +159,9 @@ int trace_end_u(int tag); int trace_sched(struct tcb_s *prev, struct tcb_s *next); #else #define trace_begin(a, b, ...) -#define trace_begin_u(a, b) +#define trace_begin_uid(a, b) #define trace_end(a) -#define trace_end_u(a) +#define trace_end_uid(a) #define trace_sched(a, b) #if defined(__cplusplus) -- 2.7.4