-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issues in TRAP #6639
Fix issues in TRAP #6639
Conversation
This patch adds support to TRAP tool to parse the log with new type of timestamp i.e. [Date Time] Timestamp Format: [2025-01-17 17:03:01] =========================================================== [2025-01-17 17:03:01] Assertion details [2025-01-17 17:03:01] =========================================================== [2025-01-17 17:03:01] print_assert_detail: Assertion failed CPU0 at file: hello_main.c line 70 task: hello pid: 20 [2025-01-17 17:03:01] print_assert_detail: Assert location (PC) : 0x0e16e497 [2025-01-17 17:03:01] check_assert_location: Code asserted in normal thread! Signed-off-by: neel-samsung <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
format logs function bug fixes in the trap tool , this change is good to merge.
tools/trap/cli/utils.py
Outdated
fname = subprocess.getoutput("arm-none-eabi-addr2line -e " + bin_path + app_name[is_app_symbol - 1] + "_dbg " + hex(search_addr)) | ||
if ":?" in fname: | ||
print('Symbol not found for address: {0}'.format(hex(search_addr))) | ||
return | ||
else: | ||
print("{:8}\t {:8}\t {} binary {:20} {}".format(hex(stack_addr), hex(search_addr), app_name[is_app_symbol - 1], sname, fname)) | ||
else: | ||
pos = (ksymbol_lookup_table[mid - 1][1]).find('\t') | ||
sname = (ksymbol_lookup_table[mid - 1][1])[:pos] | ||
sname = (ksymbol_lookup_table[mid - 1][1])[:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this cause issue if symbol name is too long?
For example, some c++ symbol names are very long like below:
0ebcf050 t _ZZN2ui7content20SharedPreferenceImpl16enqueueDiskWriteESt10shared_ptrINS1_18MemoryCommitResultEES2_INS_4osal8RunnableEEEN19WriteToDiskRunnable3runEv
0ebce276 t _ZZN2ui7content20SharedPreferenceImpl16enqueueDiskWriteESt10shared_ptrINS1_18MemoryCommitResultEES2_INS_4osal8RunnableEEEN19WriteToDiskRunnableD0Ev
0ebce250 t _ZZN2ui7content20SharedPreferenceImpl16enqueueDiskWriteESt10shared_ptrINS1_18MemoryCommitResultEES2_INS_4osal8RunnableEEEN19WriteToDiskRunnableD1Ev
0ebce250 t _ZZN2ui7content20SharedPreferenceImpl16enqueueDiskWriteESt10shared_ptrINS1_18MemoryCommitResultEES2_INS_4osal8RunnableEEEN19WriteToDiskRunnableD2Ev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its better to put some restriction on the column width for printing the symbol name.
- This patch fixes the issue of missing letters of symbol name while printing the assert log. - Earlier, we were not printing symbol when addr2line was not avaliable but now, we print symbol name irrespective of addr2line output. - As c++ symbol length are very big, so, we print it in specific format [first 20 chars ... last 20 chars]. Before: Stack_address Symbol_address Symbol_location Symbol_name File_name User stack Symbol not found for address: 0xe16f049 Symbol not found for address: 0xe17f490 Symbol not found for address: 0xe16e9a9 Symbol not found for address: 0xe16e9df Symbol not found for address: 0xe16eb37 0x6028bbd4 0xe16e491 common binary hello_main /root/tizenrt/apps/examples/hello/hello_main.c:70 0x6028bbe0 0xe16e4ad common binary helloxx_main /root/tizenrt/apps/examples/helloxx/helloxx_main.cxx:152 0x6028bbe8 0xe169a19 common binary task_startup /root/tizenrt/lib/libc/sched/task_startup.c:123 (discriminator 3) 0x6028bbf0 0xe019ba9 kernel binary task_star /root/tizenrt/os/kernel/task/task_start.c:162 After: Stack_address Symbol_address Symbol location Symbol_name File_name User stack 0x6028bbb4 0xe16f049 common binary __cxxabiv1::__class_...~__class_type_info() File not found 0x6028bbb8 0xe17f490 common binary typeinfo for unsigned __int128 const* File not found 0x6028bbc0 0xe16e9a9 common binary __cxa_free_dependent_exception File not found 0x6028bbc8 0xe16e9df common binary _GLOBAL__sub_I__ZN9__gnu_cxx9__freeresEv File not found 0x6028bbd0 0xe16eb37 common binary __cxa_init_primary_exception File not found 0x6028bbd4 0xe16e491 common binary hello_main /root/tizenrt/apps/examples/hello/hello_main.c:70 0x6028bbe0 0xe16e4ad common binary helloxx_main /root/tizenrt/apps/examples/helloxx/helloxx_main.cxx:152 0x6028bbe8 0xe169a19 common binary task_startup /root/tizenrt/lib/libc/sched/task_startup.c:123 (discriminator 3) 0x6028bbf0 0xe019ba9 kernel binary task_start /root/tizenrt/os/kernel/task/task_start.c:162 Signed-off-by: neel-samsung <[email protected]>
c171d46
to
30b7576
Compare
@kishore-sn @r-prabu If this is review done, let's merge. |
No description provided.