Colin:
Unless the stack is restore back to 0 after it is not used anymore, wouldn't that method indicate how much stack the task has been using *at some point* instead of the current usage?
Stack 'Used' shown in Ranger/SysMon diffs
Re: Stack 'Used' shown in Ranger/SysMon diffs
AmigaOne X1000 running AOS 4 beta
AmigaOne XE/G4
Amiga 1200/PPC 603e + BVision PPC
AmigaOne XE/G4
Amiga 1200/PPC 603e + BVision PPC
- tonyw
- AmigaOS Core Developer
- Posts: 1483
- Joined: Wed Mar 09, 2011 1:36 pm
- Location: Sydney, Australia
Re: Stack 'Used' shown in Ranger/SysMon diffs
Of course - but the current stack pointer is of little interest to anyone, anyway. At the time that it is measured (by a different program), it could be anything. What you usually want to know is the maximum stack depth it has reached in the past.
cheers
tony
tony
Re: Stack 'Used' shown in Ranger/SysMon diffs
Colin :
Thank you very much, I just sent you a PM.
Thank you very much, I just sent you a PM.
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
X1000 - AmigaOS 4.1.6 / 4.1 FE
Re: Stack 'Used' shown in Ranger/SysMon diffs
Many thanks to you, Colin, for your StackUse source.
Stack used is now reenabled for next SysMon update.
Stack used is now reenabled for next SysMon update.
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
X1000 - AmigaOS 4.1.6 / 4.1 FE
Re: Stack 'Used' shown in Ranger/SysMon diffs
If I remember correctly, I used to fill the entire stack from the unused side upto the stackpointer with uint32's containing 0xDEADBEEF. When the program has finished it is a matter of measuring the heap of dead beef that remains. Can't tell you the exact specs as my Micro is out of order since a year and a half.
OldFart
OldFart
X5000, appears to be sick. Dismantled jan 1, 2024.
Dead MicroA1
A1200 in ElBox, c/w Blizzard '040 @ 50MHz + SCSI module, ZIV-board c/w (o.a.) cv64/3d + flickerdoubler + FastATA-ZIV + Lots of SCSI gear, sitting idle.
RaspBerry Pi 2B, 3B, 4B/4Gb, 4B/8Gb
OrangePi 5+ 8Gb
ACER Windows 10
Dead MicroA1
A1200 in ElBox, c/w Blizzard '040 @ 50MHz + SCSI module, ZIV-board c/w (o.a.) cv64/3d + flickerdoubler + FastATA-ZIV + Lots of SCSI gear, sitting idle.
RaspBerry Pi 2B, 3B, 4B/4Gb, 4B/8Gb
OrangePi 5+ 8Gb
ACER Windows 10
- colinw
- AmigaOS Core Developer
- Posts: 218
- Joined: Mon Aug 15, 2011 10:20 am
- Location: Brisbane, QLD. Australia.
Re: Stack 'Used' shown in Ranger/SysMon diffs
Yeah, I know this was done, I found it in a couple of old programs.OldFart wrote:If I remember correctly, I used to fill the entire stack from the unused side upto the stackpointer with uint32's containing 0xDEADBEEF. When the program has finished it is a matter of measuring the heap of dead beef that remains. Can't tell you the exact specs as my Micro is out of order since a year and a half.
OldFart
The only question I have is why, what was wrong with the default cleared stack memory value of zero. ?
A pushed return address can't ever be zero, but there's no guarantee it can't be some other arbitrary value.
It also complicates the stack testing code because it has to have a test for cookie mungers as well as for the default zero values.
Re: Stack 'Used' shown in Ranger/SysMon diffs
@colinw
Another way *MIGHT* be to find the programs Task structure and on a continuous base check the value of its stackpointer, thereby remembering the highest value reached. Ouch, all sorts of statistics could be gotten from this. Hm, I really need an Amiga soonish to sort this kind of thing out. I got that TaskView proggy somewhere on my dead Micro's HD. Might be a nice addition.
OldFart
Another way *MIGHT* be to find the programs Task structure and on a continuous base check the value of its stackpointer, thereby remembering the highest value reached. Ouch, all sorts of statistics could be gotten from this. Hm, I really need an Amiga soonish to sort this kind of thing out. I got that TaskView proggy somewhere on my dead Micro's HD. Might be a nice addition.
OldFart
X5000, appears to be sick. Dismantled jan 1, 2024.
Dead MicroA1
A1200 in ElBox, c/w Blizzard '040 @ 50MHz + SCSI module, ZIV-board c/w (o.a.) cv64/3d + flickerdoubler + FastATA-ZIV + Lots of SCSI gear, sitting idle.
RaspBerry Pi 2B, 3B, 4B/4Gb, 4B/8Gb
OrangePi 5+ 8Gb
ACER Windows 10
Dead MicroA1
A1200 in ElBox, c/w Blizzard '040 @ 50MHz + SCSI module, ZIV-board c/w (o.a.) cv64/3d + flickerdoubler + FastATA-ZIV + Lots of SCSI gear, sitting idle.
RaspBerry Pi 2B, 3B, 4B/4Gb, 4B/8Gb
OrangePi 5+ 8Gb
ACER Windows 10
- tonyw
- AmigaOS Core Developer
- Posts: 1483
- Joined: Wed Mar 09, 2011 1:36 pm
- Location: Sydney, Australia
Re: Stack 'Used' shown in Ranger/SysMon diffs
But the stack pointer in the Task struct is only updated when the task is suspended/checkpointed/waits for I/O or a signal. In between those times, it may have called a recursive function 1058 times.
The saved stack pointer is really of use only to the Exec, so that it can restore the task to a running state at some time in the future.
The saved stack pointer is really of use only to the Exec, so that it can restore the task to a running state at some time in the future.
cheers
tony
tony
Re: Stack 'Used' shown in Ranger/SysMon diffs
@tonyw
Makes sense.
OldFart
Makes sense.
OldFart
X5000, appears to be sick. Dismantled jan 1, 2024.
Dead MicroA1
A1200 in ElBox, c/w Blizzard '040 @ 50MHz + SCSI module, ZIV-board c/w (o.a.) cv64/3d + flickerdoubler + FastATA-ZIV + Lots of SCSI gear, sitting idle.
RaspBerry Pi 2B, 3B, 4B/4Gb, 4B/8Gb
OrangePi 5+ 8Gb
ACER Windows 10
Dead MicroA1
A1200 in ElBox, c/w Blizzard '040 @ 50MHz + SCSI module, ZIV-board c/w (o.a.) cv64/3d + flickerdoubler + FastATA-ZIV + Lots of SCSI gear, sitting idle.
RaspBerry Pi 2B, 3B, 4B/4Gb, 4B/8Gb
OrangePi 5+ 8Gb
ACER Windows 10