Skip to content

Commit

Permalink
Merge pull request Samsung#1031 from junmin-kim/arm_assert
Browse files Browse the repository at this point in the history
Remove unnessary CONFIG_PRINT_TASKNAME
  • Loading branch information
sunghan-chang authored Nov 29, 2017
2 parents eef71b4 + 907e0ca commit fb828a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 31 deletions.
17 changes: 2 additions & 15 deletions os/arch/arm/src/armv7-m/up_assert.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,6 @@
#undef CONFIG_ARCH_USBDUMP
#endif

/* The following is just intended to keep some ugliness out of the mainline
* code. We are going to print the task name if:
*
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
*/

#undef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG) || defined(CONFIG_ARCH_STACKDUMP))
#define CONFIG_PRINT_TASKNAME 1
#endif

/****************************************************************************
* Private Data
****************************************************************************/
Expand Down Expand Up @@ -381,13 +368,13 @@ void dump_all_stack(void)

void up_assert(const uint8_t *filename, int lineno)
{
#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
struct tcb_s *rtcb = this_task();
#endif

board_led_on(LED_ASSERTION);

#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
lldbg("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name);
#else
lldbg("Assertion failed at file:%s line: %d\n", filename, lineno);
Expand Down
19 changes: 3 additions & 16 deletions os/arch/arm/src/armv7-r/arm_assert.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,6 @@
#undef CONFIG_ARCH_USBDUMP
#endif

/* The following is just intended to keep some ugliness out of the mainline
* code. We are going to print the task name if:
*
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
*/

#undef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG) || defined(CONFIG_ARCH_STACKDUMP))
#define CONFIG_PRINT_TASKNAME 1
#endif

#define FRAME_POINTER_ADDR __builtin_frame_address(0)

/* Flag used to detect the whether upassert called or not */
Expand Down Expand Up @@ -341,7 +328,7 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg)
{
/* Dump interesting properties of this task */

#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
lldbg("%s: PID=%d Stack Used=%lu of %lu\n", tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb), (unsigned long)tcb->adj_stack_size);
#else
lldbg("PID: %d Stack Used=%lu of %lu\n", tcb->pid, (unsigned long)up_check_tcbstack(tcb), (unsigned long)tcb->adj_stack_size);
Expand Down Expand Up @@ -778,12 +765,12 @@ static void _up_assert(int errorcode)

void up_assert(const uint8_t *filename, int lineno)
{
#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
struct tcb_s *rtcb = this_task();
#endif
board_autoled_on(LED_ASSERTION);

#ifdef CONFIG_PRINT_TASKNAME
#if CONFIG_TASK_NAME_SIZE > 0
lldbg("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name);
#else
lldbg("Assertion failed at file:%s line: %d\n", filename, lineno);
Expand Down

0 comments on commit fb828a5

Please sign in to comment.