From e99737c12cac1fcc8604ac89a14dac5b2606a42d Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Sun, 2 Dec 2018 17:19:44 -0500 Subject: Clean up the profiling code to the point where I stand a chance of understanding it 6 months from now. While I'm at it, try to make it a little more efficient (because 50-60% of time in a typical profiling run is spent in the function-entry counting), and collapse profil.c into gmon.c. --- libraries/libprof/profil.h | 60 ---------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 libraries/libprof/profil.h (limited to 'libraries/libprof/profil.h') diff --git a/libraries/libprof/profil.h b/libraries/libprof/profil.h deleted file mode 100644 index c72dc00..0000000 --- a/libraries/libprof/profil.h +++ /dev/null @@ -1,60 +0,0 @@ -/* profil.h: gprof profiling header file - - Copyright 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -/* - * This file is taken from Cygwin distribution. Please keep it in sync. - * The differences should be within __MINGW32__ guard. - */ - -#ifndef __PROFIL_H__ -#define __PROFIL_H__ - -/* profiling frequency. (No larger than 1000) */ -#define PROF_HZ 1000 - -/* convert an addr to an index */ -#define PROFIDX(pc, base, scale) \ - ({ \ - size_t i = (pc - base) / 2; \ - if (sizeof (unsigned long long int) > sizeof (size_t)) \ - i = (unsigned long long int) i * scale / 65536; \ - else \ - i = i / 65536 * scale + i % 65536 * scale / 65536; \ - i; \ - }) - -/* convert an index into an address */ -#define PROFADDR(idx, base, scale) \ - ((base) \ - + ((((unsigned long long)(idx) << 16) \ - / (unsigned long long)(scale)) << 1)) - -/* convert a bin size into a scale */ -#define PROFSCALE(range, bins) (((bins) << 16) / ((range) >> 1)) - -typedef void *_WINHANDLE; - -typedef enum { - PROFILE_NOT_INIT = 0, - PROFILE_ON, - PROFILE_OFF -} PROFILE_State; - -struct profinfo { - PROFILE_State state; /* profiling state */ - unsigned short *counter; /* profiling counters */ - size_t lowpc, highpc; /* range to be profiled */ - unsigned int scale; /* scale value of bins */ -}; - -int profile_ctl(struct profinfo *, char *, size_t, size_t, unsigned int); -int profil(char *, size_t, size_t, unsigned int); - -#endif /* __PROFIL_H__ */ -- cgit v1.2.3