mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-10-03 08:41:34 +00:00
Improve logic for avoiding prof.c to be compiled with -pg
This commit is contained in:
@@ -17,30 +17,12 @@ _mcount:
|
||||
sd $6, 32($29)
|
||||
sd $7, 40($29)
|
||||
|
||||
# Make sure we're not recursively called when compiling __mcount()
|
||||
# With -pg
|
||||
la $4, _busy
|
||||
lw $5, 0($4)
|
||||
bnez $5, done
|
||||
nop
|
||||
|
||||
# Mark busy
|
||||
li $5, 1
|
||||
sw $5, 0($4)
|
||||
|
||||
# Call internal C handler
|
||||
move $4, $1
|
||||
move $5, $31
|
||||
jal __mcount
|
||||
nop
|
||||
|
||||
# Unmark busy
|
||||
la $4, _busy
|
||||
li $5, 0
|
||||
sw $5, 0($4)
|
||||
|
||||
done:
|
||||
|
||||
# Restore registers
|
||||
ld $31, 0($29)
|
||||
ld $1, 8($29)
|
||||
@@ -52,9 +34,6 @@ _mcount:
|
||||
j $31
|
||||
move $31, $1 # restore caller's ra
|
||||
|
||||
_busy:
|
||||
.space 4
|
||||
|
||||
.end _mcount
|
||||
|
||||
.set reorder
|
||||
|
@@ -78,8 +78,11 @@ extern int _ftext;
|
||||
extern int _etext;
|
||||
|
||||
/* forward declarations */
|
||||
__attribute__((__no_instrument_function__, __no_profile_instrument_function__))
|
||||
void __gprof_cleanup(void);
|
||||
__attribute__((__no_instrument_function__, __no_profile_instrument_function__))
|
||||
void __mcount(unsigned int, unsigned int);
|
||||
__attribute__((__no_instrument_function__, __no_profile_instrument_function__))
|
||||
static SceUInt timer_handler(SceUID uid, SceKernelSysClock *c1, SceKernelSysClock *c2, void *common);
|
||||
|
||||
/** Initializes pg library
|
||||
@@ -89,6 +92,7 @@ static SceUInt timer_handler(SceUID uid, SceKernelSysClock *c1, SceKernelSysCloc
|
||||
for sampling statistics. Note that this also installs a timer that
|
||||
runs at 1000 hert.
|
||||
*/
|
||||
__attribute__((__no_instrument_function__, __no_profile_instrument_function__))
|
||||
static void initialize()
|
||||
{
|
||||
initialized = 1;
|
||||
@@ -156,6 +160,7 @@ static void initialize()
|
||||
Called from atexit() handler; will dump out a host:gmon.out file
|
||||
with all collected information.
|
||||
*/
|
||||
__attribute__((__no_instrument_function__, __no_profile_instrument_function__))
|
||||
void __gprof_cleanup()
|
||||
{
|
||||
FILE *fp;
|
||||
@@ -205,6 +210,7 @@ void __gprof_cleanup()
|
||||
beginning of each compiled routine, which eventually brings the
|
||||
control to here.
|
||||
*/
|
||||
__attribute__((__no_instrument_function__, __no_profile_instrument_function__))
|
||||
void __mcount(unsigned int frompc, unsigned int selfpc)
|
||||
{
|
||||
int e;
|
||||
@@ -238,6 +244,7 @@ void __mcount(unsigned int frompc, unsigned int selfpc)
|
||||
|
||||
/** Internal timer handler
|
||||
*/
|
||||
__attribute__((__no_instrument_function__, __no_profile_instrument_function__))
|
||||
static SceUInt timer_handler(SceUID uid, SceKernelSysClock *requested, SceKernelSysClock *actual, void *common)
|
||||
{
|
||||
unsigned int frompc = gp.pc;
|
||||
|
Reference in New Issue
Block a user