| 1 |
Notes on profiling AI: |
| 2 |
|
| 3 |
From: Ian Lance Taylor ([email protected]) |
| 4 |
|
| 5 |
[...] |
| 6 |
> |
| 7 |
>Fork is easy enough to handle, at least on GNU/Linux. If you set the |
| 8 |
>environment variable GMON_OUT_PREFIX, glibc will automatically append |
| 9 |
>the process ID when writing the gmon.out file. If you then also do |
| 10 |
>this in the child after calling fork: |
| 11 |
> extern void _start (void), etext (void); |
| 12 |
> monstartup ((u_long) &_start, (u_long) &etext); |
| 13 |
>you will a set of ${GMON_OUT_PREFIX}.pid files, one for the parent and |
| 14 |
>one for each child. |
| 15 |
|
| 16 |
Note: set GMON_OUT_PREFIX to be the desired filename prefix for the gmon.out |
| 17 |
files. |
| 18 |
|