[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 531125e: Enable CPU profiling on Cygwin
From: |
Ken Brown |
Subject: |
[Emacs-diffs] master 531125e: Enable CPU profiling on Cygwin |
Date: |
Mon, 22 Jun 2015 21:39:21 +0000 |
branch: master
commit 531125e4c024ca12701608c4516cb9cf993cfad2
Author: Ken Brown <address@hidden>
Commit: Ken Brown <address@hidden>
Enable CPU profiling on Cygwin
* src/syssignal.h [CYGWIN] (PROFILER_CPU_SUPPORT): Revert previous
change that undefined this.
(SIGEV_SIGNAL): Ensure that this is defined as a macro.
* src/profiler.c [CYGWIN] (timer_getoverrun): Define as a macro on
Cygwin.
---
src/profiler.c | 6 ++++++
src/syssignal.h | 10 +++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/profiler.c b/src/profiler.c
index 185382c..d4c98a8 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -217,6 +217,12 @@ static EMACS_INT current_sampling_interval;
/* Signal handler for sampling profiler. */
+/* timer_getoverrun is not implemented on Cygwin, but the following
+ seems to be good enough for profiling. */
+#ifdef CYGWIN
+#define timer_getoverrun(x) 0
+#endif
+
static void
handle_profiler_signal (int signal)
{
diff --git a/src/syssignal.h b/src/syssignal.h
index 2882400..5c14479 100644
--- a/src/syssignal.h
+++ b/src/syssignal.h
@@ -32,13 +32,17 @@ extern void unblock_tty_out_signal (sigset_t const *);
#define FORWARD_SIGNAL_TO_MAIN_THREAD
#endif
+/* On Cygwin as of 2015-06-22 SIGEV_SIGNAL is defined as an enum
+ constant but not as a macro. */
+#if defined CYGWIN && !defined SIGEV_SIGNAL
+#define SIGEV_SIGNAL SIGEV_SIGNAL
+#endif
+
#if defined HAVE_TIMER_SETTIME && defined SIGEV_SIGNAL
# define HAVE_ITIMERSPEC
#endif
-/* On Cygwin, setitimer does not support ITIMER_PROF, so we can't
- support CPU profiling. */
-#if (defined SIGPROF && !defined PROFILING && !defined CYGWIN \
+#if (defined SIGPROF && !defined PROFILING \
&& (defined HAVE_SETITIMER || defined HAVE_ITIMERSPEC))
# define PROFILER_CPU_SUPPORT
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 531125e: Enable CPU profiling on Cygwin,
Ken Brown <=