Skip to content

Commit b580972

Browse files
committed
Avoid compiling prof.c with -pg flags
1 parent 74c9ddc commit b580972

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

ee/libprofglue/src/mcount.S

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,12 @@ _mcount:
1616
sd $a2, 32($sp)
1717
sd $a3, 40($sp)
1818

19-
# Make sure we're not recursively called when compiling __mcount()
20-
# With -pg
21-
la $a0, _busy
22-
lw $a1, 0($a0)
23-
bnez $a1, done
24-
nop
25-
26-
# Mark busy
27-
li $a1, 1
28-
sw $a1, 0($a0)
29-
3019
# Call internal C handler
3120
move $a0, $at
3221
move $a1, $ra
3322
jal __mcount
3423
nop
3524

36-
# Unmark busy
37-
la $a0, _busy
38-
li $a1, 0
39-
sw $a1, 0($a0)
40-
41-
done:
42-
4325
# Restore registers
4426
ld $ra, 0($sp)
4527
ld $at, 8($sp)
@@ -51,9 +33,6 @@ done:
5133
jr $ra
5234
move $ra, $at # restore caller's ra
5335

54-
_busy:
55-
.space 4
56-
5736
.end _mcount
5837

5938
.set reorder

ee/libprofglue/src/prof.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ extern int _etext;
7878

7979
/** Internal timer handler
8080
*/
81+
__attribute__((__no_instrument_function__, __no_profile_instrument_function__))
8182
static uint64_t timer_handler(int id, uint64_t scheduled_time, uint64_t actual_time, void *arg, void *pc_value)
8283
{
8384
struct gmonparam *current_gp = (struct gmonparam *)arg;
@@ -104,6 +105,7 @@ static uint64_t timer_handler(int id, uint64_t scheduled_time, uint64_t actual_t
104105
for sampling statistics. Note that this also installs a timer that
105106
runs at 1000 hert.
106107
*/
108+
__attribute__((__no_instrument_function__, __no_profile_instrument_function__))
107109
void __gprof_init()
108110
{
109111
memset(&gp, '\0', sizeof(gp));
@@ -142,6 +144,7 @@ void __gprof_init()
142144
Called from atexit() handler; will dump out a host:gmon.out file
143145
with all collected information.
144146
*/
147+
__attribute__((__no_instrument_function__, __no_profile_instrument_function__))
145148
void __gprof_cleanup()
146149
{
147150
FILE *fp;
@@ -192,6 +195,7 @@ void __gprof_cleanup()
192195
beginning of each compiled routine, which eventually brings the
193196
control to here.
194197
*/
198+
__attribute__((__no_instrument_function__, __no_profile_instrument_function__))
195199
void __mcount(unsigned int frompc, unsigned int selfpc)
196200
{
197201
int e;

0 commit comments

Comments
 (0)