delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/06/22/17:07:36

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
q=dns; s=default; b=Ye4cWNgRUvXERNPCPWoeWIZwviEHcCOmR36vgJJ0TyC
2CrXEVNm3z2YVsetcVqxU+mmzyXjheq9uGo9OtqcLm/CGrZaxk8n8oLBiWzJXPyX
ZoxpoGd0IXVuWeOal39JptmxKkcWAEpp1GXmqkJqstJtzLPRqDuheSOF2hca9Ie4
=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
s=default; bh=AN/dex76ZiuocHTwEHu9mURAhoM=; b=QDuJrZeKtnsHCOCTQ
rv41aoYPf7h5g5HkUaX9qXgckGy826qJgxDj5GgcCNtF18BWk6iD5wMIzWebqH01
rZRnaY6HmWTg/zltkPVoaOjXj03Vbuar5kuruSWpYJrYORepuPpKuI5tycVim93k
J9MDq2Z3H1FEUY8RbvBtppLyoM=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2
X-HELO: limerock04.mail.cornell.edu
X-CornellRouted: This message has been Routed already.
Message-ID: <558878FD.3050909@cornell.edu>
Date: Mon, 22 Jun 2015 17:07:09 -0400
From: Ken Brown <kbrown AT cornell DOT edu>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Support for ITIMER_PROF?
References: <5587FA08 DOT 8080404 AT cornell DOT edu> <20150622132541 DOT GA21402 AT calimero DOT vinschen DOT de>
In-Reply-To: <20150622132541.GA21402@calimero.vinschen.de>
X-IsSubscribed: yes

On 6/22/2015 9:25 AM, Corinna Vinschen wrote:
> On Jun 22 08:05, Ken Brown wrote:
>> According to the Cygwin API documentation
>> (https://cygwin.com/cygwin-api/std-notes.html), "getitimer and setitimer
>> only support ITIMER_REAL for now."  I'm wondering whether there's any chance
>> that support for ITIMER_PROF might be added.  I have no idea what the
>> obstacles are.
>>
>> My reason for asking is that emacs has a CPU profiling function, which
>> doesn't work on Cygwin because it relies on ITIMER_PROF.  (There's an
>> alternative implementation, but it requires timer_getoverrun, also not
>> available in Cygwin.)
>
> Both very tricky.  Given the description of timer_getoverrun and how
> this stuff is implemented in Cygwin, you might get away with
>
>    #ifdef __CYGWIN__
>    #define timer_getoverrun(x)	0
>    #endif
>
> indepedently of using SIGEV_SIGNAL or SIGEV_THREAD.

This seems to work.  Thanks!

One question: It seems that SIGEV_SIGNAL and friends are defined as macros on 
Linux (or at least on the one Linux distribution I looked at), but on Cygwin 
they're only enum constants.  And emacs expects them to be defined as macros. 
Would something like the following be reasonable for the sake of compatibility?

--- a/winsup/cygwin/include/cygwin/signal.h
+++ b/winsup/cygwin/include/cygwin/signal.h
@@ -311,6 +311,10 @@ enum
                                            perform notification */
  };

+#define SIGEV_SIGNAL SIGEV_SIGNAL
+#define SIGEV_NONE   SIGEV_NONE
+#define SIGEV_THREAD SIGEV_THREAD
+
  #if __WORDSIZE == 64
  typedef __uint64_t sigset_t;
  #else


Ken
Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019