summaryrefslogtreecommitdiff
path: root/extra/stack_analyzer/README.md
diff options
context:
space:
mode:
authorChe-yu Wu <cheyuw@google.com>2017-08-17 09:25:11 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-08-23 23:13:38 -0700
commiteeeee803b731d292c81c3ec013641181bff4f4bd (patch)
treeb70df9a747f876d83f96b04206f7c7bcf8cecade /extra/stack_analyzer/README.md
parent1f5ea1619b584e896967703c6ac002f272e24d72 (diff)
downloadchrome-ec-eeeee803b731d292c81c3ec013641181bff4f4bd.tar.gz
extra/stack_analyzer: Show callsite information.
Show callsite details in the call trace. Handle another addr2line failure output. BUG=chromium:648840 BRANCH=none TEST=extra/stack_analyzer/stack_analyzer_unittest.py make BOARD=elm && extra/stack_analyzer/stack_analyzer.py \ --objdump=arm-none-eabi-objdump \ --addr2line=arm-none-eabi-addr2line \ --export_taskinfo=./build/elm/util/export_taskinfo.so \ --section=RW \ --annotation=./extra/stack_analyzer/example_annotation.yaml \ ./build/elm/RW/ec.RW.elf make BOARD=elm SECTION=RW \ ANNOTATION=./extra/stack_analyzer/example_annotation.yaml \ analyzestack Change-Id: I3f36584af85f578f1d298bcd06622ba8e7e5262d Signed-off-by: Che-yu Wu <cheyuw@google.com> Reviewed-on: https://chromium-review.googlesource.com/628000 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'extra/stack_analyzer/README.md')
-rw-r--r--extra/stack_analyzer/README.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/extra/stack_analyzer/README.md b/extra/stack_analyzer/README.md
index e1be72ebbe..9bb37656f3 100644
--- a/extra/stack_analyzer/README.md
+++ b/extra/stack_analyzer/README.md
@@ -16,3 +16,34 @@ make BOARD=${BOARD} SECTION=${SECTION} ANNOTATION=${ANNOTATION} analyzestack
```
The `${SECTION}` can be `RO` or `RW`. The `${ANNOTATION}` is a optional
annotation file, see the example_annotation.yaml.
+
+Output
+------
+
+For each task, it will output the result like below,
+```
+Task: PD_C1, Max size: 1156 (932 + 224), Allocated size: 640
+Call Trace:
+ pd_task (160) [common/usb_pd_protocol.c:1644] 1008a6e8
+ -> pd_task [common/usb_pd_protocol.c:1808] 1008ac8a
+ - handle_request [common/usb_pd_protocol.c:1191]
+ - handle_data_request [common/usb_pd_protocol.c:798]
+ -> pd_task [common/usb_pd_protocol.c:2672] 1008c222
+ -> [annotation]
+ pd_send_request_msg.lto_priv.263 (56) [common/usb_pd_protocol.c:653] 1009a0b4
+ -> pd_send_request_msg.lto_priv.263 [common/usb_pd_protocol.c:712] 1009a22e0
+```
+The `pd_task` uses 160 bytes on the stack and calls `pd_send_request_msg.lto_priv.263`.
+
+The callsites to the next function will be shown like below,
+```
+-> pd_task [common/usb_pd_protocol.c:1808] 1008ac8a
+ - handle_request [common/usb_pd_protocol.c:1191]
+ - handle_data_request [common/usb_pd_protocol.c:798]
+-> pd_task [common/usb_pd_protocol.c:2672] 1008c222
+```
+This means one callsite to the next function is at `usb_pd_protocol.c:798`,
+but it is inlined to the current function and you can follow the trace:
+`usb_pd_protocol.c:1808 -> usb_pd_protocol.c:1191 -> usb_pd_protocol.c:798` to
+find the callsite. The second callsite is at `usb_pd_protocol.c:2672`. And the
+third one is added by annotation.