This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 171388 - CPU Profiler does not show Scala method calls
Summary: CPU Profiler does not show Scala method calls
Status: NEW
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Jiri Sedlacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-03 11:14 UTC by ogrisel
Modified: 2009-10-29 09:25 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ogrisel 2009-09-03 11:14:48 UTC
Using the latest nightlybuilds of both netbeans 6.8, scala 2.8 and the scala nb plugin on Open JDK 6, I can attach a CPU
profiler session to a running scala program, however I can only see the java method methods calls and non of the scala
method calls in any of the CPU profiler subviews.

To launch the scala program, I use a maven netbeans project with the scala-tools maven plugin and an scala object with a
"main" method such as this:

  http://code.oliviergrisel.name/cloudmole/src/tip/src/main/scala/org/cloudmole/benchmarking/DotProductBenchmark.scala

Memory monitoring seems to work as expected.
Comment 1 Jiri Sedlacek 2009-10-27 19:14:53 UTC
NetBeans profiler is a Java profiler, it's not expected to work with Scala. No profiling support is mentioned in the
Scala plugin Wiki. Isn't it a bug that profiling is enabled for Maven Scala project? Milosi please evaluate...
Comment 2 Jiri Sedlacek 2009-10-27 19:15:53 UTC
Scala plugin Wiki: http://wiki.netbeans.org/Scala
Comment 3 Milos Kleint 2009-10-29 08:55:54 UTC
jis: "NetBeans profiler is a Java profiler, it's not expected to work with Scala."
Well, scala sources compile into .class files, fully compatible with java .class files. Therefore, I'd say that any Java
profiler is a Scala profiler as well, at least on the very basic level. However there probably will be hard problems of
tracking the class/method reference from the classfile to a given scala source file. Scala applies various tricks to
implement constructs not available in the scala language, but not in java language. Eg functions, closures, tuples..


"No profiling support is mentioned in the Scala plugin Wiki." But debugging is. If the debugger manages to find the
backtraces from class to scala files, profiler could we well I guess. I would not it a defect though, just a missing
feature.

"Isn't it a bug that profiling is enabled for Maven Scala project?"
No, it isn't. In any given maven project you can combine scala *and* java (and probably also groovy files) and compile
them together. The resulting jar with class files can be used by another java/scala/groovy maven project. And so on. How
do you tell which project can be profiled and which cannot be?
Comment 4 Jiri Sedlacek 2009-10-29 09:25:42 UTC
Thanks Milosi! Since I don't know much about the Maven/Scala etc. projects I thought Scala projects could be easily
marked as not supporting profiling the same way as it is done for for example for C++ or Ruby projects.

Changing to FEATURE. It's up to the Scala support to implement profiling Scala projects incl. Go To Source functionality
like it's already done for JavaFX projects.