unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34527: 27.0.50; Cygwin now has timer_getoverrun
@ 2019-02-18 15:16 Ken Brown
  2019-02-18 16:21 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Ken Brown @ 2019-02-18 15:16 UTC (permalink / raw)
  To: 34527

[-- Attachment #1: Type: text/plain, Size: 290 bytes --]

The latest release of Cygwin supports the timer_getoverrun function, so
there's no longer a need for the workaround in profiler.c that defines
timer_getoverrun as a macro.  The attached patch causes the function to
be used rather than the macro when it exists.

OK for master?

Ken

[-- Attachment #2: 0001-Use-timer_getoverrun-on-Cygwin-when-possible.patch --]
[-- Type: text/plain, Size: 1596 bytes --]

From 162aa52538d38a0ca7f7969f79b1e1cd7f708e3c Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Sun, 17 Feb 2019 12:10:26 -0500
Subject: [PATCH] Use 'timer_getoverrun' on Cygwin when possible

* configure.ac: Add a check for the 'timer_getoverrun' function.

* src/profiler.c [CYGWIN] : Define 'timer_getoverrun' as a
macro only on versions of Cygwin where it is not already
defined as a function.
---
 configure.ac   | 2 +-
 src/profiler.c | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 58579008f3..c26eb6d1e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4126,7 +4126,7 @@ AC_DEFUN
 lrand48 random rint trunc \
 select getpagesize setlocale newlocale \
 getrlimit setrlimit shutdown \
-pthread_sigmask strsignal setitimer \
+pthread_sigmask strsignal setitimer timer_getoverrun \
 sendto recvfrom getsockname getifaddrs freeifaddrs \
 gai_strerror sync \
 getpwent endpwent getgrent endgrent \
diff --git a/src/profiler.c b/src/profiler.c
index 15a0eef0d3..293e52633a 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -232,9 +232,10 @@ 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
+/* timer_getoverrun is not implemented on Cygwin prior to
+   cygwin-3.0.0, but the following seems to be good enough for
+   profiling. */
+#if defined CYGWIN && !defined HAVE_TIMER_GETOVERRUN
 #define timer_getoverrun(x) 0
 #endif
 
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#34527: 27.0.50; Cygwin now has timer_getoverrun
  2019-02-18 15:16 bug#34527: 27.0.50; Cygwin now has timer_getoverrun Ken Brown
@ 2019-02-18 16:21 ` Eli Zaretskii
  2019-02-18 17:14   ` Ken Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2019-02-18 16:21 UTC (permalink / raw)
  To: Ken Brown; +Cc: 34527

> From: Ken Brown <kbrown@cornell.edu>
> Date: Mon, 18 Feb 2019 15:16:32 +0000
> 
> The latest release of Cygwin supports the timer_getoverrun function, so
> there's no longer a need for the workaround in profiler.c that defines
> timer_getoverrun as a macro.  The attached patch causes the function to
> be used rather than the macro when it exists.
> 
> OK for master?

LGTM, thanks.

Is there any user-visible effect of this change?  If so, please say
something in NEWS.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#34527: 27.0.50; Cygwin now has timer_getoverrun
  2019-02-18 16:21 ` Eli Zaretskii
@ 2019-02-18 17:14   ` Ken Brown
  2019-02-22 14:22     ` Ken Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Ken Brown @ 2019-02-18 17:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 34527@debbugs.gnu.org

On 2/18/2019 11:21 AM, Eli Zaretskii wrote:
>> From: Ken Brown <kbrown@cornell.edu>
>> Date: Mon, 18 Feb 2019 15:16:32 +0000
>>
>> The latest release of Cygwin supports the timer_getoverrun function, so
>> there's no longer a need for the workaround in profiler.c that defines
>> timer_getoverrun as a macro.  The attached patch causes the function to
>> be used rather than the macro when it exists.
>>
>> OK for master?
> 
> LGTM, thanks.
> 
> Is there any user-visible effect of this change?

I don't think so.  I think it simply means that profiling will potentially be 
more accurate.  That's probably not NEWSworthy.

Ken

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#34527: 27.0.50; Cygwin now has timer_getoverrun
  2019-02-18 17:14   ` Ken Brown
@ 2019-02-22 14:22     ` Ken Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Ken Brown @ 2019-02-22 14:22 UTC (permalink / raw)
  Cc: 34527-done@debbugs.gnu.org

Closing.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-22 14:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-18 15:16 bug#34527: 27.0.50; Cygwin now has timer_getoverrun Ken Brown
2019-02-18 16:21 ` Eli Zaretskii
2019-02-18 17:14   ` Ken Brown
2019-02-22 14:22     ` Ken Brown

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).