Comments (8)
Another alternative is to try and call clock_gettime_monotonic()
in libkruntime, but I don't know how hard calling C is in (J)ruby.
from krun.
We may have to go for that, because it seems that jruby does not define Process::CLOCK_MONOTONIC_RAW
from krun.
Ok, chatted with Chris. There is no FFI in truffleruby yet. Thus we have to change truffleruby. I'll need some help with this, my java is not good enough. I think this is the beginning of the patch we need:
diff --git a/truffle/src/main/java/org/jruby/truffle/nodes/core/TrufflePrimitiveNodes.java b/truffle/src/main/java/org/jruby/truffle/nodes/core/TrufflePrimitiveNodes.java
index 356a478..04c4796 100644
--- a/truffle/src/main/java/org/jruby/truffle/nodes/core/TrufflePrimitiveNodes.java
+++ b/truffle/src/main/java/org/jruby/truffle/nodes/core/TrufflePrimitiveNodes.java
@@ -127,6 +127,21 @@ public abstract class TrufflePrimitiveNodes {
}
+ @CoreMethod(names = "clock_gettime_monotonic", onSingleton = true)
+ public abstract static class MonotonicTimeNode extends CoreMethodArrayArgumentsNode {
+
+ public MonotonicTimeNode(RubyContext context, SourceSection sourceSection) {
+ super(context, sourceSection);
+ }
+
+ @TruffleBoundary
+ @Specialization
+ public double clockGettimeMonotonic() {
+ return IterationsRunner.JNI_clock_gettime_monotonic();
+ }
+
+ }
+
@CoreMethod(names = "gc_time", onSingleton = true)
public abstract static class GCTimeNode extends CoreMethodArrayArgumentsNode {
but the class IterationsRunner
is of course not found. How do I fix that part?
from krun.
Ok, IterationsRunner is in an "unnamed package", which can't be used from any other Java code in a package. Do we make it a package?
from krun.
Looks like we need to:
http://stackoverflow.com/questions/283816/how-to-access-java-classes-in-the-default-package
from krun.
reflection, do we really want to do that?
from krun.
Wouldn't that produce too much overhead for the timing call?
from krun.
Woops. To be clear.
Looks like we do need to put out code in a package, due to You canβt use classes in the default package from a named package
. I didn't mean to use reflection.
from krun.
Related Issues (20)
- Dummy example is counterproductive HOT 5
- Use static analysers on likbrun HOT 2
- Investigate latency of ioctls compared to syscalls.
- (Possibly) Overhaul Instrumentation Framework HOT 3
- Instrumentation mode doesn't show stderr in the event of a real crash. HOT 2
- The default dmesg whitelist should be updated for the new network interface name style HOT 5
- Update default dmesg whitelist for Debian 9 network interfaces. HOT 1
- Add some means to set per benchmark environmental variables HOT 2
- Help krun better track overlay .krun files HOT 49
- `virt-what` in Debian repos is too old to detect VMM hypervisors. HOT 13
- Cron @reboot doesn't do what it says on the tin.
- Krun fails to run when the krun user group already exists HOT 1
- Warn if a/mperf is not configured HOT 4
- Read additional performance counters.
- Clock lists should be type stable HOT 3
- Python Iteration Runner Broken HOT 1
- Check for disabled overcommit
- Disable P-states by MSR
- Native invocation of libkruntime.so fails during java benchmark example HOT 5
- Remove a/mperf ratio support.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from krun.