Notices


Reply
Thread Tools
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#21
Yeah, do so please. As this script does not depend on anything.
And name the output something like "swap amount written". Or make it a percentage value (even bettter ).
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 
Posts: 2,290 | Thanked: 4,133 times | Joined on Apr 2010 @ UK
#22
Originally Posted by peterleinchen View Post
Yeah, do so please. As this script does not depend on anything.
And name the output something like "swap amount written". Or make it a percentage value (even bettter ).
I have changed the disk part to get the current swap partition.
Code:
disk=$(cat /proc/swaps | awk '/dev/ {print $1}' | cut -d "/" -f 3)
This outputs the current partition without the "/dev/" part "mmcblk1p2" and fits it perfect.

But where do I get the total number of bytes to get a percentage?
A percentage will be easier to work off as this doesn't limit you to a particular swap size.
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.
 
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#23
Originally Posted by sixwheeledbeast View Post
Code:
disk=$(cat /proc/swaps | awk '/dev/ {print $1}' | cut -d "/" -f 3)
This outputs the current partition without the "/dev/" part "mmcblk1p2" and fits it perfect.
OK.


Originally Posted by sixwheeledbeast View Post
But where do I get the total number of bytes to get a percentage?
What about:
Code:
awk '{if ($1=="'"/dev/$disk"'") print $3}' /proc/swaps
in your notation.

P.S.: as I have more than one swap online (I know I know), I needed to get the one out of them, You seem to have only one online at a time.
Sorry for delay, had a batt shutdown.
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following User Says Thank You to peterleinchen For This Useful Post:
Posts: 2,290 | Thanked: 4,133 times | Joined on Apr 2010 @ UK
#24
OK. Sorry I got you now. D'oh

cat /proc/swaps get the bytes from there.
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.
 
Posts: 2,290 | Thanked: 4,133 times | Joined on Apr 2010 @ UK
#25
Updated to Version 0.0.4

Changes / QR code / Download in OP

This update now makes Flopswap do what I intended.
After some fun with ash and some help from others here, I have now made Flopswap able to monitor Swap defragmentation.

This update now makes Flopswap have all the functionally of Ereswap with the added benifits of:-

*Being optified and not installing files in /sbin and /root that don't get removed on uninstallation.

*Not modifing rcs-late at all (you may wish to return your rcs-late to it's pre-ereswap form).

*Not depending on anything, like busybox-power or iostat for example.

*GUI

While not looking like much of an update there have been a fair few changes in the code and scripts.
I have been testing it on two devices for the last week to make sure it stable and functional.

Happy Swapping.
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.

Last edited by sixwheeledbeast; 2012-12-11 at 19:36.
 

The Following 9 Users Say Thank You to sixwheeledbeast For This Useful Post:
Posts: 107 | Thanked: 173 times | Joined on Feb 2011
#26
Thanks for this useful tool
What about integrating compcache ?
 
Posts: 2,290 | Thanked: 4,133 times | Joined on Apr 2010 @ UK
#27
Originally Posted by pierrem View Post
What about integrating compcache ?
I don't use it myself.
To benefit from compcache you need to modify VM settings to swap more. Also using ramz will reduce battery life, due to compressing and uncompressing.

I personally don't see much benefit, compared with thumb for example, so will leave compcache to the "swapset"application.
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.
 

The Following User Says Thank You to sixwheeledbeast For This Useful Post:
Posts: 1,397 | Thanked: 2,126 times | Joined on Nov 2009 @ Dublin, Ireland
#28
Would you try to upload it to the repos? At least the dput method is still working.
 
Posts: 2,290 | Thanked: 4,133 times | Joined on Apr 2010 @ UK
#29
Originally Posted by ivgalvez View Post
Would you try to upload it to the repos? At least the dput method is still working.
I would love to put it in the repos.
I have been trying scp everyday for the last couple of weeks.
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.
 

The Following User Says Thank You to sixwheeledbeast For This Useful Post:
Posts: 249 | Thanked: 277 times | Joined on May 2010 @ Brighton, UK
#30
Intriguing...have to check this out later. Been away from my Maemo hacking for far too long...hence the lack of updates to swapset

...incidentally, has any effort been made by those versed in kernel-power to fix the fragmentation problem at source i.e. in the kernel?
 
Reply


 
Forum Jump


All times are GMT. The time now is 06:19.