-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Book: added section on calltree analysis; a few clarifications in the…
… troubleshooting section. Fix window resize with the mouse (GUI utilities). Fix file dialog "double free" bug (GUI utilities). BMProfile: demangle C++ names.; extra checks on parameters, before running; fix in using default GUI settings when no INI file is found. BMDebug: fix in console history; fix in breakpoint handling by mouse click in the margin; fix "clear" option in "trace" command; pass DWARF symbol table to CTF decoding. BMTrace: option to disable "live view" (so overflow of the trace queue is avoided); panel for status; improvements in CTF loading. Add calltree utility. Gruvbox colour scheme (with adaptions) for the GUI utilities. Add -v (version) option to all utilities. swotrace: bug fix in precision timestamp in Linux version; signal queue overflow. nuklear: merged PRs #463, #482 & #486.
- Loading branch information
1 parent
335566e
commit 1924b1f
Showing
40 changed files
with
1,402 additions
and
485 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* Example functions for function enter/exit tracing via GCC instrumentation. | ||
* It is based on SWO tracing, and should be used with the function_trace.tsdl | ||
* file. | ||
* | ||
* Routines for initializing the micro-controller for TRACESWO are not included, | ||
* as these are (in part) dependend on the particular micro-controller. | ||
* | ||
* | ||
* Copyright 2022 CompuPhase | ||
* | ||
* This software is provided 'as-is', without any express or implied | ||
* warranty. In no event will the authors be held liable for any damages | ||
* arising from the use of this software. | ||
* | ||
* Permission is granted to anyone to use this software for any purpose, | ||
* including commercial applications, and to alter it and redistribute it | ||
* freely, subject to the following restrictions: | ||
* | ||
* 1. The origin of this software must not be misrepresented; you must not | ||
* claim that you wrote the original software. If you use this software | ||
* in a product, an acknowledgment in the product documentation would be | ||
* appreciated but is not required. | ||
* 2. Altered source versions must be plainly marked as such, and must not be | ||
* misrepresented as being the original software. | ||
* 3. This notice may not be removed or altered from any source distribution. | ||
*/ | ||
|
||
#include <stdint.h> | ||
|
||
#if !defined ITM_TCR_ITMENA | ||
#define ITM_TCR_ITMENA ITM_TCR_ITMENA_Msk | ||
#endif | ||
|
||
__attribute__((no_instrument_function)) | ||
void trace_xmit(int stream_id, const unsigned char *data, unsigned size) | ||
{ | ||
if ((ITM->TCR & ITM_TCR_ITMENA) != 0UL && /* ITM tracing enabled */ | ||
(ITM->TER & (1 << channel)) != 0UL) /* ITM channel enabled */ | ||
{ | ||
/* collect and transmit bytes in packets of 4 bytes */ | ||
uint32_t value = 0, shift = 0; | ||
while (size-- > 0) { | ||
value |= (uint32_t)*data++ << shift; | ||
shift += 8; | ||
if (shift >= 32) { | ||
/* in the waiting loop, use an empty statement and not __NOP(); | ||
although __NOP() is an inline function, it would still be | ||
instrumented */ | ||
while (ITM->PORT[channel].u32 == 0UL) | ||
{} | ||
ITM->PORT[channel].u32 = value; | ||
value = shift = 0; | ||
} | ||
} | ||
/* transmit last collected bytes */ | ||
if (shift > 0) { | ||
while (ITM->PORT[channel].u32 == 0UL) | ||
{} | ||
ITM->PORT[channel].u32 = value; | ||
} | ||
} | ||
} | ||
|
||
__attribute__((no_instrument_function)) | ||
void __cyg_profile_func_enter(void *this_fn, void *call_site) | ||
{ | ||
(void)call_site; | ||
trace_function_profile_enter((unsigned long)this_fn); | ||
} | ||
__attribute__((no_instrument_function)) | ||
void __cyg_profile_func_exit(void *this_fn, void *call_site) | ||
{ | ||
(void)call_site; | ||
trace_function_profile_exit((unsigned long)this_fn); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* TSDL file suitable for tracing function entries and exits. | ||
* | ||
* The source code must be compiled with GCC option -finstrument-functions. | ||
* The code must also supply a function trace_xmit(), as explained in the | ||
* book. An * important note is that trace_xmit() must be declared with | ||
* __attribute__((no_instrument_function)) | ||
*/ | ||
trace { | ||
major = 1; | ||
minor = 8; | ||
packet.header := struct { | ||
uint16_t magic; | ||
}; | ||
}; | ||
|
||
stream function_profile { | ||
id = 31; | ||
event.header := struct { | ||
uint16_t id; | ||
}; | ||
}; | ||
|
||
typealias integer { | ||
size = 32; | ||
signed = false; | ||
base = symaddress; | ||
} := code_address; | ||
|
||
event function_profile::enter { | ||
attribute = "no_instrument_function"; | ||
fields := struct { | ||
code_address symbol; | ||
}; | ||
}; | ||
|
||
event function_profile::exit { | ||
attribute = "no_instrument_function"; | ||
fields := struct { | ||
code_address symbol; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.