Opened 14 years ago
Closed 6 years ago
#298 closed enhancement/feature request (fixed)
Add instrumentation code for debug to provide call stack logging
Reported by: | Wouldd | Owned by: | KaZeR |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | core | Version: | git master |
Severity: | normal | Keywords: | debug, tracing |
Cc: | gerritv@… |
Description
It is possible with GCC to compile an instrumented version of code that will call pre-defined methods on entry/exit to all functions. (except those marked with a special attribute) It is possible to use this mechanism to allow for debug.c to indent logging based on it's position in the call stack. What is more, it can be done in such a way that has no effect at all when not compiled with the flag: -finstrument-functions the process is documented here: http://danielwould.wordpress.com/2009/02/10/getting-call-stack-tracing-out-of-navit/
I've attached a patch to debug.c and debug.h as well as a script that can be used to post-process the resulting log files and insert all the function names and file:line nums for the entry/exit logging.
Attachments (3)
Change History (6)
Changed 14 years ago by Wouldd
comment:1 Changed 14 years ago by Gerritv
- Cc gerritv@… added
- Milestone set to version 0.2.0
I added a diff to add enable-calltracing to configure.in and to include (or not) a new file called instrument.c if calltracing is enabled. instrument.c should contain the code added to debug.c by dwould.
comment:2 Changed 10 years ago by usul
- Milestone changed from version 0.2.1 to version 0.5.1
I'm sorry, that I'm not that skilled in debugging internals. Can please provide some further details on how this mechanism would be useful? Is this about profiling or getting a full stack trace, which is otherwise hidden?
comment:3 Changed 6 years ago by http://wiki.navit-project.org/index.php/user:jkoan
- Milestone version 0.5.1 deleted
- Resolution set to fixed
- Severity set to normal
- Status changed from new to closed
As i know we have gdb for debugging things. If you meant something else please open a new ticket
Patch for debug.c/h