develooper Front page | perl.perl5.porters | Postings from January 2008

Re: dtrace and Perl (again)

Thread Previous | Thread Next
From:
Andy Armstrong
Date:
January 7, 2008 14:39
Subject:
Re: dtrace and Perl (again)
Message ID:
2D98D813-E618-4E6E-8125-97040A1D94B0@hexten.net
On 6 Jan 2008, at 16:28, Nicholas Clark wrote:
> However, the counter argument is that if it is possible to get the C  
> code that
> is currently a speed hit re-implemented in D, then there is no speed  
> hit in
> having every perl dtrace enabled. Which seems like a much better  
> thing long
> term, as it would mean that any user of Perl on Solaris, FreeBSD, OS  
> X, etc
> would be able to use dtrace instrumentation immediately, and on  
> running
> processes, even if they don't have the permission to install modules  
> from
> CPAN. (Heck, they don't even have to be aware of modules on CPAN)


I now have a dtraced bleadperl which runs no slower than the clean  
version:

orig       | dtrace     | ratio
====================================
2.51239896 | 2.47904992 | 0.98672622
2.50696611 | 2.46995783 | 0.98523782
2.52996778 | 2.47554016 | 0.97848683
2.50457382 | 2.47788405 | 0.98934359
2.50622296 | 2.46893001 | 0.98511986

In fact in those tests the dtraced version is running marginally  
faster. I'm putting that down to a happy code alignment or somesuch.

It's using the SOME_PROBE_ENABLED tests that Sun tell me were added  
specifically for Perl - so they're happy that we're using them and  
they work :)

I could use a little advice about how dtrace should be detected by  
Configure and handled at build time. I need to

* find the dtrace executable
* use it to filter a D script into a .h
* (on Solaris but not MacOS) filter a D script into a .o
* link against the generated .o

I assume that all the above should be conditional on -Dusedtrace and  
that Apple and Sun will set that option when they build their vendor  
versions. Is that sensible?

Is there a precedent for finding an executable? Anything else I should  
be thinking about?

-- 
Andy Armstrong, Hexten





Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About