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 57786 - Strange behavior of specifying begin/end line for code fragment profiling
Summary: Strange behavior of specifying begin/end line for code fragment profiling
Status: CLOSED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: mishadmitriev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-12 17:05 UTC by Jan Lahoda
Modified: 2007-02-12 22:08 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test application. (13.89 KB, application/octet-stream)
2005-04-12 17:06 UTC, Jan Lahoda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2005-04-12 17:05:56 UTC
[recent profiler sources], NB4.1: build number 200504111930, client on
JDK1.5.0_03, profiled app running on provided JDK1.4.2.

1. Download, unpack and open the provided project in NetBeans.
2. Click on Profile (Main Project), Select "Code Fragment".
3. Select "Specify Code Fragment" and in the dialog select class
"profilertestapp.Main" and lines 28-30.
4. Run profiling: the statistics says only 2 lines are instrumented (and the
results got from Get Results suggest that only lines 28 and 29 were measured).
5. Stop profiling & begin a new one, and open the "Specify Code Fragment" dialog
once again.
6. In the dialog, Whole Method radio button is selected, instead of Part of
Method Code.
7. Select lines 28-31.
8. Run profiling: the statistics say there are 3 lines instrumented. The Get
Results never returns any results.

From step 4, it seems that the instrumentation code is added before start line
and before end line (which is a bit strange to the user, I would await the last
line to be covered as well).

Step 8 has probably problems because the while loop ending at line 31 never
ends, so the profiler never reaches the end of the profiling region.

But these two facts mean that it is not possible to profile line 30.
Comment 1 Jan Lahoda 2005-04-12 17:06:27 UTC
Created attachment 21580 [details]
Test application.
Comment 2 iformanek 2005-04-14 15:30:08 UTC
Misha, can you please take a look at this?
Comment 3 mishadmitriev 2005-05-05 04:50:09 UTC
Ok, checked and observed the same behavior.

Your explanation about item 8 is correct - that's how code fragment profiling is
supposed to work. If the loop eventually terminated, essentially the whole time
spent in this loop would be shown.

The fact that line 30 is not selected needs to be fixed. Started working on that.
Comment 4 mishadmitriev 2005-05-05 04:50:44 UTC
Ok, checked and observed the same behavior.

Your explanation about item 8 is correct - that's how code fragment profiling is
supposed to work. If the loop eventually terminated, essentially the whole time
spent in this loop would be shown.

The fact that line 30 is not selected needs to be fixed. Started working on that.
Comment 5 mishadmitriev 2005-05-06 08:14:16 UTC
Fixed in M7. Since this actually revealed some pretty fundamental problems and
thus required at least one fix in the general bytecode rewriting functionality,
I would like to ask Jan to re-run all the tests he has just to make sure nothing
is broken with instrumentation.
Comment 6 ehucka 2006-10-09 12:10:52 UTC
Verification of old issues.
Comment 7 Alexander Kouznetsov 2007-02-12 22:08:08 UTC
Closing old issues.