1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00
1999-10-07  Ulrich Drepper  <drepper@cygnus.com>

	* debug/Makefile (install-bin): Add pcprofiledump and xtrace.
	Add rules for both programs.
	* debug/pcprofiledump.c: New file.
	* debug/xtrace.sh: New file.
	* debug/pcprofile.c: Allow creating output file.  Add magic signature
	to let reader recognize file format.
This commit is contained in:
Ulrich Drepper
1999-10-07 07:25:16 +00:00
parent 42d7c59314
commit cab30d75a3
5 changed files with 395 additions and 3 deletions

View File

@@ -18,7 +18,9 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <errno.h>
#include <fcntl.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
@@ -39,10 +41,25 @@ install (void)
if (outfile != NULL && *outfile != '\0')
{
fd = open (outfile, O_RDWR);
fd = open (outfile, O_RDWR | O_CREAT, 0666);
if (fd != -1)
active = 1;
{
uint32_t word;
active = 1;
/* Write a magic word which tells the reader about the byte
order and the size of the following entries. */
word = 0xdeb00000 | sizeof (void *);
if (TEMP_FAILURE_RETRY (write (fd, &word, 4)) != 4)
{
/* If even this fails we shouldn't try further. */
close (fd);
fd = -1;
active = 0;
}
}
}
}