Bug 3540 - Determine why getIsa is called so often
Summary: Determine why getIsa is called so often
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Nurdin Premji
URL:
Keywords:
Depends on: 3628
Blocks: 1593
  Show dependency treegraph
 
Reported: 2006-11-17 21:30 UTC by Andrew Cagney
Modified: 2006-12-12 16:08 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cagney 2006-11-17 21:30:54 UTC
Proc.getIsa should be evaluated lazy style.

Clearly it isn't or something is pulling that value when it isn't needed.
Comment 1 Andrew Cagney 2006-11-24 16:11:44 UTC
Any updates or results?

Suggest creating a test case that demonstrates the getIsa criteria:

- when a process is detached the isa is invalid
- when a process is attached the isa is valid

by transitioning a process through attached and detached events checking that it
gets its state changed
Comment 2 Nurdin Premji 2006-11-24 19:49:36 UTC
Added TestCase to check memory is null when not attached and not null when attached.

November 24, 2006
frysk-core/frysk/proc/CL
        * TestMemory.java: Added.	
	* TaskState.java (Attached.transitionToRunningState): Changed to notify static
Task observable.
	(detaching.handleStoppedEvent): Ditto.
	* Task.java (ObservableXXX): Made static.
	(taskStateAttached.update): Ditto.
	(taskStateDetached.update): Ditto.
	(Task): Removed add observer from here and made static so any task that
attaches gets data filled.
Comment 3 Nurdin Premji 2006-11-24 20:25:13 UTC
More test cases that should be looked at:

Test that isa is a singleton. (Unless switching between 32 and 64 bit execs)
Test switching between 32 and 64 bit execs.
Test Attach, Detach, Attach agan, (Detach again), etc.
Test Attach, create attached child process.
Comment 4 Nurdin Premji 2006-12-04 16:02:39 UTC
(In reply to comment #3)
> More test cases that should be looked at:
> 
> Test that isa is a singleton. (Unless switching between 32 and 64 bit execs)
Done: TestIsa.testIsaSingleton

> Test switching between 32 and 64 bit execs.
TestIsa.test64To32Isa() and test64To32To64().

> Test Attach, Detach, Attach agan, (Detach again), etc.
TestIsa.testAttachDetachAttachAgainDetachAgainAtachAgainAgain().

> Test Attach, create attached child process.
TestIsa.testAttachedCreateAttachedChild(), testAttachedCreateAttachedClone() and
testAttachedCreateChild().
Comment 5 Nurdin Premji 2006-12-12 16:08:09 UTC
Fixed
December 5, 2006
        frysk-core/frysk/proc/CL
        * LinuxTask.java (fillRegisterBank): Added.
        (fillMemory): Added.
        (LinuxTask): Removed calls to setupMapsXXX/fill memory and register banks.
        * DummyTask.java (fillRegisterBank): Added.
        (fillMemory): Added.
        * TestIsa.java (AttachedObserver.updateAttached): Added call to try to
detect isa. (For "on-demand" access of isa).
        (testAttachDetachAttachAgainDetachAgainAttachAgainAgain): Enabled.
        (testIsa): Enabled.
        * TaskState.java (detaching.handleStoppedEvent): notify Task that the
given task has detached.
        * Task.java (TaskStateObservable): Added.
        (TaskStateObservable.notify): Added.
        (taskStateDetached): Added.
        (getRegisterBank): Added. Fills register bank if null.
        (clearIsa): Added.
        (static.update): When a task detaches, clear it's Isa information.
        (getMemory): Fill memory if null.