Ticket #985 (new todo)

Opened 5 years ago

Last modified 4 years ago

proper Configure.pl-time check for hires timers

Reported by: dukeleto Owned by: cotto
Priority: normal Milestone:
Component: profiling Version: 1.5.0
Severity: medium Keywords:
Cc: jkeenan Language:
Patch status: Platform: other

Description

Currently parrot uses clock_gettime() unless the platform is darwin, in which it uses gettimeofday(). Any other esoteric platform that does not have clock_gettime() will currently not build on parrot.

A proper check for each function should be done at Configure.pl-time for these. Devel::NYTProf2 has already solved most of these issues, we should emulate that.

Change History

follow-up: ↓ 5   Changed 5 years ago by jkeenan

  • cc jkeenan added

Please see this  Parrot build failure on Cygwin reported by one of our bots. It appears related to the subject matter of this ticket and to have emerged subsequent to commits related to it.

  Changed 5 years ago by cotto

  • owner set to cotto
  • component changed from build to profiling

  Changed 5 years ago by doughera

The various specific "clock id" values (e.g. CLOCK_PROCESS_CPUTIME_ID) may well vary by operating system version as well as by platform. A fallback of CLOCK_REALTIME might be reasonable if none of the other desired ones are available.

Also, it would be a good idea to record the results of this probe with appropriate keys in parrot's PConfig hash and in <parrot/config.h>, rather than simply passing additional -D flags to the compiler. See  http://rt.perl.org/rt3/Public/Bug/Display.html?id=51232 for much more on this topic.

  Changed 5 years ago by doughera

Solaris 8 is one such "esoteric" platform. The build there currently fails because CLOCK_PROCESS_CPUTIME_ID is not defined.

in reply to: ↑ 1   Changed 5 years ago by jkeenan

Replying to jkeenan:

Please see this  Parrot build failure on Cygwin reported by one of our bots. It appears related to the subject matter of this ticket and to have emerged subsequent to commits related to it.

See also TT 989 which reports some unusual bus errors on Darwin that were seen starting with the revision where hi-res timer files were added.

  Changed 5 years ago by darbelo

On Thu, Sep 10, 2009 at 8:24 PM, Parrot <parrot-tickets@lists.parrot.org> wrote:
>  Replying to [comment:1 jkeenan]:
>  > Please see this [http://tt.ro.vutbr.cz/file/cmdout/84164.txt Parrot
>  build failure on Cygwin] reported by one of our bots.  It appears related
>  to the subject matter of this ticket and to have emerged subsequent to
>  commits related to it.

I think I saw that same ttbot report on IRC a while back and. This
failure should be fixed after -r41094 by cotto++. Is there a way we
can check for that without waiting on ttbot?

  Changed 5 years ago by darbelo

Small update on the state of this code:

We still don't have a proper Configure.pl-time check for hires timers. But, right now parrot will default to gettimeofday() unless _POSIX_TIMERS is #defined to a true value. Which is about as safe as it gets for retrieving timing info. This however short-changes platforms with a correct clock_gettime() that don't #define _POSIX_TIMERS.

All of his provides safer defaults but doesn't solve the actual problem that this ticket is about. The ticket should remain open until we can add a proper Configure.pl-time check for hires timers or decide they aren't needed.

in reply to: ↑ description   Changed 4 years ago by jkeenan

Replying to dukeleto:

Devel::NYTProf2 has already solved most of these issues, we should emulate that.

Where can we find Devel::NYTProf2? Is it different from this:  http://search.cpan.org/~timb/Devel-NYTProf-4.06/ ?

kid51

  Changed 4 years ago by dukeleto

NYTProf 4.x is the new shiny. Use that.

Note: See TracTickets for help on using tickets.