gmon.c (840b91cc52085d26c112e99d733f71eb92c3ff54) | gmon.c (be8490925afe186d1e8ed16390feacb7de46359b) |
---|---|
1/*- 2 * Copyright (c) 1983, 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 143 unchanged lines hidden (view full) --- 152 } else if (clockinfo.profhz == 0) { 153 if (clockinfo.hz != 0) 154 clockinfo.profhz = clockinfo.hz; 155 else 156 clockinfo.profhz = hertz(); 157 } 158 159 moncontrol(0); | 1/*- 2 * Copyright (c) 1983, 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 143 unchanged lines hidden (view full) --- 152 } else if (clockinfo.profhz == 0) { 153 if (clockinfo.hz != 0) 154 clockinfo.profhz = clockinfo.hz; 155 else 156 clockinfo.profhz = hertz(); 157 } 158 159 moncontrol(0); |
160 snprintf(outname, sizeof(outname), "%s.gmon", _getprogname()); | 160 if (getenv("PROFIL_USE_PID")) 161 snprintf(outname, sizeof(outname), "%s.%d.gmon", 162 _getprogname(), getpid()); 163 else 164 snprintf(outname, sizeof(outname), "%s.gmon", _getprogname()); 165 |
161 fd = _open(outname, O_CREAT|O_TRUNC|O_WRONLY, 0666); 162 if (fd < 0) { 163 _warn("_mcleanup: %s", outname); 164 return; 165 } 166#ifdef DEBUG 167 log = _open("gmon.log", O_CREAT|O_TRUNC|O_WRONLY, 0664); 168 if (log < 0) { --- 82 unchanged lines hidden --- | 166 fd = _open(outname, O_CREAT|O_TRUNC|O_WRONLY, 0666); 167 if (fd < 0) { 168 _warn("_mcleanup: %s", outname); 169 return; 170 } 171#ifdef DEBUG 172 log = _open("gmon.log", O_CREAT|O_TRUNC|O_WRONLY, 0664); 173 if (log < 0) { --- 82 unchanged lines hidden --- |