Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
6156580d
Commit
6156580d
authored
Nov 29, 1995
by
Jim Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(_mcleanup): Add support for PROFDIR environment variable.
From-SVN: r10637
parent
8b8def46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
6 deletions
+31
-6
gcc/config/sparc/gmon-sol2.c
+31
-6
No files found.
gcc/config/sparc/gmon-sol2.c
View file @
6156580d
...
@@ -39,11 +39,11 @@
...
@@ -39,11 +39,11 @@
static
char
sccsid
[]
=
"@(#)gmon.c 5.3 (Berkeley) 5/22/91"
;
static
char
sccsid
[]
=
"@(#)gmon.c 5.3 (Berkeley) 5/22/91"
;
#endif
/* not lint */
#endif
/* not lint */
#include <unistd.h>
#ifdef DEBUG
#include <stdio.h>
#include <stdio.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <unistd.h>
#if 0
#if 0
#include "sparc/gmon.h"
#include "sparc/gmon.h"
...
@@ -172,6 +172,7 @@ monstartup(lowpc, highpc)
...
@@ -172,6 +172,7 @@ monstartup(lowpc, highpc)
moncontrol
(
1
);
moncontrol
(
1
);
}
}
void
_mcleanup
()
_mcleanup
()
{
{
int
fd
;
int
fd
;
...
@@ -180,11 +181,35 @@ _mcleanup()
...
@@ -180,11 +181,35 @@ _mcleanup()
char
*
frompc
;
char
*
frompc
;
int
toindex
;
int
toindex
;
struct
rawarc
rawarc
;
struct
rawarc
rawarc
;
char
*
profdir
;
char
*
proffile
;
char
*
progname
;
char
buf
[
PATH_MAX
];
extern
char
**
___Argv
;
moncontrol
(
0
);
moncontrol
(
0
);
fd
=
creat
(
"gmon.out"
,
0666
);
if
((
profdir
=
getenv
(
"PROFDIR"
))
!=
NULL
)
{
/* If PROFDIR contains a null value, no profiling output is produced */
if
(
*
profdir
==
'\0'
)
{
return
;
}
progname
=
strrchr
(
___Argv
[
0
],
'/'
);
if
(
progname
==
NULL
)
progname
=
___Argv
[
0
];
else
progname
++
;
sprintf
(
buf
,
"%s/%d.%s"
,
profdir
,
getpid
(),
progname
);
proffile
=
buf
;
}
else
{
proffile
=
"gmon.out"
;
}
fd
=
creat
(
proffile
,
0666
);
if
(
fd
<
0
)
{
if
(
fd
<
0
)
{
perror
(
"mcount: gmon.out"
);
perror
(
proffile
);
return
;
return
;
}
}
# ifdef DEBUG
# ifdef DEBUG
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment