Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-02-17 22:38:33 +0300
committerChristopher Faylor <me@cgf.cx>2000-02-17 22:38:33 +0300
commit1fd5e000ace55b323124c7e556a7a864b972a5c4 (patch)
treedc4fcf1e5e22a040716ef92c496b8d94959b2baa /winsup/cygwin/profil.h
parent369d8a8fd5e887eca547bf34bccfdf755c9e5397 (diff)
import winsup-2000-02-17 snapshot
Diffstat (limited to 'winsup/cygwin/profil.h')
-rw-r--r--winsup/cygwin/profil.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/winsup/cygwin/profil.h b/winsup/cygwin/profil.h
new file mode 100644
index 000000000..c62f92251
--- /dev/null
+++ b/winsup/cygwin/profil.h
@@ -0,0 +1,44 @@
+/* profil.h: gprof profiling header file
+
+ Copyright 1998 Cygnus Solutions.
+
+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. */
+
+/* profiling frequency. (No larger than 1000) */
+#define PROF_HZ 100
+
+/* 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) + ((((idx) << 16) / (scale)) << 1))
+
+/* convert a bin size into a scale */
+#define PROFSCALE(range, bins) (((bins) << 16) / ((range) >> 1))
+
+typedef void *_WINHANDLE;
+
+struct profinfo {
+ _WINHANDLE targthr; /* thread to profile */
+ _WINHANDLE profthr; /* profiling thread */
+ u_short *counter; /* profiling counters */
+ u_long lowpc, highpc; /* range to be profiled */
+ u_int scale; /* scale value of bins */
+};
+
+int profile_ctl(struct profinfo *, char *, size_t, u_long, u_int);
+int profil(char *, size_t, u_long, u_int);
+