| #
9a731fc2 |
| 21-Sep-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: be more specific when matching stack addresses
Use a more specific regular expression for call stack addresses so that the script will not attempt to resolve any hexadecimal nu
scripts/symbolize.py: be more specific when matching stack addresses
Use a more specific regular expression for call stack addresses so that the script will not attempt to resolve any hexadecimal number encountered in the middle of a message.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
f9089765 |
| 02-Oct-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: add help text
Document how the binutils tools (addr2line etc.) are found.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wikla
scripts/symbolize.py: add help text
Document how the binutils tools (addr2line etc.) are found.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
8a6d4a8b |
| 01-Oct-2018 |
Etienne Carriere <etienne.carriere@linaro.org> |
symbolize: use CROSS_COMPILE directive if available
Get CROSS_COMPILE prefix directive if defined in the environment. If CROSS_COMPILE is not defined, default to aarch64-linux-gnu- or arm-linux-gnue
symbolize: use CROSS_COMPILE directive if available
Get CROSS_COMPILE prefix directive if defined in the environment. If CROSS_COMPILE is not defined, default to aarch64-linux-gnu- or arm-linux-gnueabihf- as done prior this change according to the architecture read from the ELF file.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
1cbf777b |
| 07-Sep-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: improve error message when a command is not found
It is a common mistake to invoke symbolize.py while not having the proper toolchain is one's $PATH. The script then exits with
scripts/symbolize.py: improve error message when a command is not found
It is a common mistake to invoke symbolize.py while not having the proper toolchain is one's $PATH. The script then exits with a stack dump that is unhelpful to users. Improve the situation by showing an explicit "command not found" message and the name of the command.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| #
1d8c2a48 |
| 07-Sep-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: code cleanup
Fix pep8 errors.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
|
| #
1e6f2ea0 |
| 27-Jun-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: remove spurious output '(out/arm/core/tee.elf)'
When a TA dump is processed, there is a list of ELF files just before the call stack. However, when analyzing a TEE core dump, t
scripts/symbolize.py: remove spurious output '(out/arm/core/tee.elf)'
When a TA dump is processed, there is a list of ELF files just before the call stack. However, when analyzing a TEE core dump, there is no such list. Make sure this situation is properly handled to avoid displaying a spurious message. This means fixing incorrect indentation in a conditional.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
b4815427 |
| 20-Jun-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: ignore undefined symbols
With the introduction of dynamically linked TAs, symbolize.py may encounter undefined (external) symbols when it parses the output of the nm command lo
scripts/symbolize.py: ignore undefined symbols
With the introduction of dynamically linked TAs, symbolize.py may encounter undefined (external) symbols when it parses the output of the nm command looking for a symbol's address. The current code is not prepared for that and will raise an exception. Fix the issue by ignoring lines that have an unexpected format.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
095567e5 |
| 29-May-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: print path of ELF files
Show which file corresponds to each ELF binary in a TA. Symbolic links are followed, so that dynamic libraries are likely shown with their user-friendly
scripts/symbolize.py: print path of ELF files
Show which file corresponds to each ELF binary in a TA. Symbolic links are followed, so that dynamic libraries are likely shown with their user-friendly name (libfoo.so) rather than their UUID (<uuid>.elf) -- see commit 01b8b5ce011d ("TA dev kit: when building a shared library, create symlink with UUID").
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| #
ae252462 |
| 25-May-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: add support for dynamically linked TAs
Dynamically linked TAs contain sections mapped from several ELF files. Update symbolize.py accordingly. As a result, the call stack will
scripts/symbolize.py: add support for dynamically linked TAs
Dynamically linked TAs contain sections mapped from several ELF files. Update symbolize.py accordingly. As a result, the call stack will show the expected debug information instead of "?? ??:0" for stack frames that belong to a dynamic library. Also, the memory regions used to map libraries will be annotated with section names like for the main executable.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| #
0c5bedb5 |
| 15-Feb-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: update help text
Commit 546291f4de9b ("trace: make output more compact") has changed the format of the abort and panic dumps. Update 'symbolize.py --help' accordingly.
The hel
scripts/symbolize.py: update help text
Commit 546291f4de9b ("trace: make output more compact") has changed the format of the abort and panic dumps. Update 'symbolize.py --help' accordingly.
The help text is also reworked slightly to make it clear that the script may be used with all kinds of crash dumps (TEE core or TA, aborts and panics).
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
5f7df507 |
| 15-Feb-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: strip cwd from file paths by default
It is quite common to invoke symbolize.py from a top-level directory which contains the source code of OP-TEE as well as of Trusted Applica
scripts/symbolize.py: strip cwd from file paths by default
It is quite common to invoke symbolize.py from a top-level directory which contains the source code of OP-TEE as well as of Trusted Applications. In this case, it is convenient to strip the directory from all the paths reported by the script.
Therefore, make this behavior the default. In other words, '-s $(pwd)' is now implied. One can still obtain full paths by passing '-s' with no argument.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
b1d7375c |
| 15-Dec-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Remove 'All rights reserved' from Linaro files
The text 'All rights reserved' is useless [1]. The Free Software Foundation's REUSE Initiative best practices document [2] does not contain these words
Remove 'All rights reserved' from Linaro files
The text 'All rights reserved' is useless [1]. The Free Software Foundation's REUSE Initiative best practices document [2] does not contain these words. Therefore, we can safely remove the text from the files that are owned by Linaro.
Generated by: spdxify.py --linaro-only --strip-arr optee_os/
Link: [1] https://en.wikipedia.org/wiki/All_rights_reserved Link: [2] https://reuse.software/practices/ Link: [3] https://github.com/jforissier/misc/blob/f7b56c8/spdxify.py Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| #
78b7c7c7 |
| 15-Dec-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Remove license notice from Linaro files
Now that we have added SPDX identifiers, we can safely remove the verbose license text from the files that are owned by Linaro.
Generated by [1]: spdxify.p
Remove license notice from Linaro files
Now that we have added SPDX identifiers, we can safely remove the verbose license text from the files that are owned by Linaro.
Generated by [1]: spdxify.py --linaro-only --strip-license-text optee_os/
Link: [1] https://github.com/jforissier/misc/blob/f7b56c8/spdxify.py Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| #
1bb92983 |
| 15-Dec-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add SPDX license identifiers
Adds one SPDX-License-Identifier line [1] to each source files that contains license text.
Generated by [2]: spdxify.py --add-spdx optee_os/
The scancode tool [3] wa
Add SPDX license identifiers
Adds one SPDX-License-Identifier line [1] to each source files that contains license text.
Generated by [2]: spdxify.py --add-spdx optee_os/
The scancode tool [3] was used to double check the license matching code in the Python script. All the licenses detected by scancode are either detected by spdxify.py, or have no SPDX identifier, or are false matches.
Link: [1] https://spdx.org/licenses/ Link: [2] https://github.com/jforissier/misc/blob/f7b56c8/spdxify.py Link: [3] https://github.com/nexB/scancode-toolkit Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| #
a2b984bd |
| 15-Dec-2017 |
Joakim Bech <joakim.bech@linaro.org> |
scripts: update regular expression in symbolize.py
Update the regular expression finding the call stack addresses to match the new trace format.
Signed-off-by: Joakim Bech <joakim.bech@linaro.org>
scripts: update regular expression in symbolize.py
Update the regular expression finding the call stack addresses to match the new trace format.
Signed-off-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
27b83ad2 |
| 06-Oct-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: reset state when a (new) abort message is found
The symbolize script may not process correctly several dumps in a row. For instance, if you pipe a TA abort followed by a TEE co
scripts/symbolize.py: reset state when a (new) abort message is found
The symbolize script may not process correctly several dumps in a row. For instance, if you pipe a TA abort followed by a TEE core abort, the later is not decoded properly because the script still uses the TA binary to interpret the core stack. Fix this by resetting the state of the decoder each time an abort line is encountered.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
30999126 |
| 25-Aug-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: print ELF sections after MMU region information
When processing a user TA abort dump, list the ELF sections that are mapped in each MMU region. For example (the lines modified
scripts/symbolize.py: print ELF sections after MMU region information
When processing a user TA abort dump, list the ELF sections that are mapped in each MMU region. For example (the lines modified by this patch are prefixed with >>):
User TA undef-abort at address 0x10574e fsr 0x00000000 ttbr0 0x0e07a06a ttbr1 0x0e07406a cidr 0x1 cpu #0 cpsr 0x60000030 r0 0x20000013 r4 0x0013a6bc r8 0x00000000 r12 0x0e07dd88 r1 0x00000033 r5 0x00121fd3 r9 0x00000000 sp 0x001026cc r2 0x0010581f r6 0x00102590 r10 0x00000000 lr 0x00105823 r3 0x00000043 r7 0x001026cc r11 0x00000000 pc 0x0010574e Status of TA 5b9e0e40-2636-11e1-ad9e-0002a5d5c51b (0xe073b70) (active) arch: arm load address: 0x103000 ctx-idr: 1 stack: 0x100000 10240 region 0: va 0x100000 pa 0xe21e000 size 0x3000 flags rw- >> region 1: va 0x103000 pa 0xe100000 size 0x2e000 flags r-x .ta_head .text .rodata >> region 2: va 0x131000 pa 0xe12e000 size 0xa000 flags r-- .rodata .ARM.extab .ARM.exidx .got .dynsym .rel.got .dynamic .dynstr .hash .rel.dyn >> region 3: va 0x13b000 pa 0xe138000 size 0xe6000 flags rw- .data .bss region 4: va 0 pa 0 size 0 flags --- region 5: va 0 pa 0 size 0 flags --- region 6: va 0 pa 0 size 0 flags --- region 7: va 0 pa 0 size 0 flags --- User TA undef-abort at address 0x10574e undef_instr+6 .text+10030 Call stack: 0x0010574e undef_instr at optee_test/ta/os_test/os_test.c:880 0x00105823 ta_entry_bad_mem_access at optee_test/ta/os_test/os_test.c:917 0x00105e75 TA_InvokeCommandEntryPoint at optee_test/ta/os_test/ta_entry.c:101 0x00121fb7 entry_invoke_command at optee_os/lib/libutee/arch/arm/user_ta_entry.c:207 0x00122013 __utee_entry at optee_os/lib/libutee/arch/arm/user_ta_entry.c:235
Suggested-by: Zeng Tao <prime.zeng@hisilicon.com> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
d720431c |
| 04-Sep-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: get binary architecture from ELF file
Instead of making a fragile assumption, that we have a 64-bit TEE core if we encounter 64-bit registers in the dump, read the architecture
scripts/symbolize.py: get binary architecture from ELF file
Instead of making a fragile assumption, that we have a 64-bit TEE core if we encounter 64-bit registers in the dump, read the architecture from the ELF file itself. This allows to correctly parse 32- and 64-bit TEE core call stacks without any context but the string "Call stack:" at the beginning. Therefore, the helper script can now be used on core panics.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
157e6213 |
| 24-Aug-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: accept -d <ELF_file> in addition to -d <dir>
The -d option of symbolize.py normally expects one or more directories, where the script will look for ELF files (TEE or TA, depend
scripts/symbolize.py: accept -d <ELF_file> in addition to -d <dir>
The -d option of symbolize.py normally expects one or more directories, where the script will look for ELF files (TEE or TA, depending on the input dump). For convenience, let's also accept paths to the actual ELF files. Previously, the script would just ignore file arguments and silently fail to resolve stack traces.
Reported-by: Lijianhui <airbak.li@hisilicon.com> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
show more ...
|
| #
142c5ccc |
| 24-Aug-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: try to resolve abort address to symbol/section[+offset]
Use nm and objdump to find the symbol and ELF section that match the address reported in the the abort line. This can he
scripts/symbolize.py: try to resolve abort address to symbol/section[+offset]
Use nm and objdump to find the symbol and ELF section that match the address reported in the the abort line. This can help debug writes to read-only data or unaligned accesses to global data, for example.
If the address can be resolved to a symbol plus some offset and/or a section plus some offset, the abort line is printed again just before the call stack with the symbolic information added. Not that the translation cannot be done immediately when the abort line is seen because at this point we don't know the architecture, and we don't have the load address of the TA.
Here is an example (the line added by this patch is marked with >>):
User TA data-abort at address 0x1314d0 (write permission fault) fsr 0x0000080f ttbr0 0x0e07a06a ttbr1 0x0e07406a cidr 0x1 cpu #0 cpsr 0x60000030 r0 0x00000001 r4 0x00102780 r8 0x00000000 r12 0xb736e358 r1 0x00102724 r5 0x00121e4f r9 0x00000000 sp 0x001026e0 r2 0x00000001 r6 0x001026dc r10 0x00000000 lr 0x00105cf1 r3 0x001314d0 r7 0x001026e0 r11 0x00000000 pc 0x00105790 Status of TA 5b9e0e40-2636-11e1-ad9e-0002a5d5c51b (0xe073b70) (active) arch: arm load address: 0x103000 ctx-idr: 1 stack: 0x100000 10240 region 0: va 0x100000 pa 0xe21e000 size 0x3000 region 1: va 0x103000 pa 0xe100000 size 0x2e000 region 2: va 0x131000 pa 0xe12e000 size 0xa000 region 3: va 0x13b000 pa 0xe138000 size 0xe6000 region 4: va 0 pa 0 size 0 region 5: va 0 pa 0 size 0 region 6: va 0 pa 0 size 0 region 7: va 0 pa 0 size 0 >> User TA data-abort at address 0x1314d0 const_val+4 .rodata+4452 (write permission fault) Call stack: 0x00105790 ta_entry_bad_mem_access at optee_test/ta/os_test/os_test.c:917 0x00105cf1 TA_InvokeCommandEntryPoint at optee_test/ta/os_test/ta_entry.c:101 0x00121e33 entry_invoke_command at optee_os/lib/libutee/arch/arm/user_ta_entry.c:207 0x00121e8f __utee_entry at optee_os/lib/libutee/arch/arm/user_ta_entry.c:235
The test TA does the following:
const int const_val[3] = { 1, }; /* ... */ ((int *)const_val)[1] = 2;
Suggested-by: Zeng Tao <prime.zeng@hisilicon.com> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
show more ...
|
| #
fd5d0622 |
| 30-Aug-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: use base-16 when converting hex strings
When converting a hex string formatted as '0x<hex>', a value of 0 may be given for base and Python will automatically assume a base-16 l
scripts/symbolize.py: use base-16 when converting hex strings
When converting a hex string formatted as '0x<hex>', a value of 0 may be given for base and Python will automatically assume a base-16 literal. However, since we're always dealing with hex strings (with or without a 0x prefix), it is more convenient to specify base-16 everywhere.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
show more ...
|
| #
733a15f2 |
| 19-May-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts: add symbolize.py
Add a helper script to decode call stacks shown in abort messages. The script relies on addr2line to convert virtual addresses to debug information: 'function at file:line'
scripts: add symbolize.py
Add a helper script to decode call stacks shown in abort messages. The script relies on addr2line to convert virtual addresses to debug information: 'function at file:line'.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|