Skip to content
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

Profiling: xtensa-esp-elf-gprof: can't find .text section in X.elf (OCD-881) #312

Closed
bwhitman opened this issue Jan 13, 2024 · 4 comments
Closed

Comments

@bwhitman
Copy link

OpenOCD version

Open On-Chip Debugger v0.12.0-esp32-20230921

Operating System

macOS

Using an IDE ?

no

OpenOCD command line

openocd -f board/esp32s3-builtin.cfg

ESP-IDF version

5.2-beta2

Problem Description

% openocd -f board/esp32s3-builtin.cfg

In separate terminal...

% telnet localhost 4444
profile 10 gmon.out

In third terminal

xtensa-esp32s3-elf-gprof build/X.elf gmon.out

I always get

xtensa-esp-elf-gprof: can't find .text section in X.elf

Debug Logs

No response

Expected behavior

Expected: that the xtensa gprof would understand xtensa elf .text sections.

Screenshots

No response

@github-actions github-actions bot changed the title Profiling: xtensa-esp-elf-gprof: can't find .text section in X.elf Profiling: xtensa-esp-elf-gprof: can't find .text section in X.elf (OCD-881) Jan 13, 2024
@erhankur
Copy link
Collaborator

Yes because in the elf file, we have .flash.text section instead of .text You can rename the section names. e.g;

cp build/hello_world.elf build/gprof_hello_world.elf
xtensa-esp32s3-elf-objcopy -I elf32-xtensa-le --rename-section .flash.text=.text build/gprof_hello_world.elf

@bwhitman
Copy link
Author

That fixed it. Thank you !

@bwhitman
Copy link
Author

I wrote a HOWTO that brings all this together as I couldn't find it anywhere else, if someone comes looking for help here:

https://github.com/bwhitman/tulipcc/blob/main/docs/tulip_debug.md

@erhankur
Copy link
Collaborator

@bwhitman Thanks for your support. I'll update our troubleshooting page as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants