Skip to content

Commit

Permalink
Avoid compiling prof.c with -pg flags
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtrujy committed Jul 17, 2024
1 parent 74c9ddc commit ca94e58
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
21 changes: 0 additions & 21 deletions ee/libprofglue/src/mcount.S
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,12 @@ _mcount:
sd $a2, 32($sp)
sd $a3, 40($sp)

# Make sure we're not recursively called when compiling __mcount()
# With -pg
la $a0, _busy
lw $a1, 0($a0)
bnez $a1, done
nop

# Mark busy
li $a1, 1
sw $a1, 0($a0)

# Call internal C handler
move $a0, $at
move $a1, $ra
jal __mcount
nop

# Unmark busy
la $a0, _busy
li $a1, 0
sw $a1, 0($a0)

done:

# Restore registers
ld $ra, 0($sp)
ld $at, 8($sp)
Expand All @@ -51,9 +33,6 @@ done:
jr $ra
move $ra, $at # restore caller's ra

_busy:
.space 4

.end _mcount

.set reorder
Expand Down
1 change: 1 addition & 0 deletions ee/libprofglue/src/prof.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,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;
Expand Down

0 comments on commit ca94e58

Please sign in to comment.