• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[SCRIPT] iotop for Android

Search This thread

laufersteppenwolf

Inactive Recognized Developer / Retired Forum Mod
Jul 1, 2012
2,880
6,991
Baden-Württemberg
droideveloper.com
There are probably only two ways you ended up here in this thread:
1) You were browsing XDA and came across this thread and thought "Hey, that's that? Let's take a look..."
2) You were looking for an iotop port for Android

If 2) applies to you, then the you were doing the exact same this as I was doing some days ago. The only difference is.... when I was searching there was no such port :eek:
But for debugging purposes on my Tab, I needed such a tool. So I started writing my own :) :D


So, in case you're not familiar with iotop, iotop is a tool for examining I/O loads and and I/O usage on per-process basis. It shows the total amount of read and written bytes as well as the current read/write speeds.

First up, the script is not yet as powerful as the one for PCs. It's still WIP but does the main tasks it's supposed to.
If you have an idea and know how to realize it, please feel free to fork my repo and create a pull request. I will most likely be merging it happily.


Requirements
  1. Root
  2. Kernel with I/O accounting enabled
    The following configs must be set:
    • CONFIG_TASKSTATS
    • CONFIG_TASK_IO_ACCOUNTING
    • CONFIG_TASK_XACCT
    • CONFIG_TASK_DELAY_ACCT

If your kernel does not support I/O accounting, you may politely ask your kernel dev to enable it in his defconfig. But always remember, it's his call and you have to accept whatever he's gonna do. There is nothing you can do about it.


Usage
You can execute the script from wherever you like, be it your sdcard, data partition or system partition. But for easier use, I would recommend you to place it in your /system/bin folder.

(for this example, I assume you've placed it in /system/bin)
To run it, you must be root (---> $su )
Then you can run the actual script
Code:
iotop.sh

You don't like the units being KB? How about MB?
Code:
iotop.sh -m

Still not what you want? Bytes then?
Code:
iotop.sh -b

Found your desired unit? Great! But those entries with no I/O activity are quite annoying, right? So let's get rid of them!
Code:
iotop.sh --only

You don't want to see all those empty entries, but still want to know how many were skipped? No problem:
Code:
iotop-sh --only --show-skips

Still need some help? Check this:
Code:
iotop.sh --help


Download
So, in case you still want to know where to get it from, the github project is located HERE
The raw script can be found HERE

Help
If you want to join the fun, just let me know!

XDA:DevDB Information
iotop for Android, Tool/Utility for all devices (see above for details)

Contributors
laufersteppenwolf

Version Information
Status: Beta

Created 2014-10-19
Last Updated 2014-10-18
 

IRKONIK

Senior Member
Feb 5, 2013
377
119
Pyongyang
This is pretty awesome! Now I can find out what or if something is wrong with my external sd card, and why power amp sometimes has problems.

Thank you very much! Schwabenpower!
 

laufersteppenwolf

Inactive Recognized Developer / Retired Forum Mod
Jul 1, 2012
2,880
6,991
Baden-Württemberg
droideveloper.com
This is pretty awesome! Now I can find out what or if something is wrong with my external sd card, and why power amp sometimes has problems.

Thank you very much! Schwabenpower!

But make sure your kernel supports I/O accounting ;)

BTW, please don't call me a "Schwabe"... It almost hurts :p :D
 
Last edited:

IRKONIK

Senior Member
Feb 5, 2013
377
119
Pyongyang
:( It seems like it does not.
And if you're not a Schwabe, then you are a Badenser. I don't anything against you. Well, nothing that helps. :laugh:
 

BobZombiE

Member
May 1, 2012
44
15
Can some one please tell me which kernels support this io accounting ?
cause i tried many , without any success.
I'm on Sammy Galaxy s3 i9300 and CM11
 

chenshaoju

Senior Member
Jun 22, 2010
104
30
Wuxi, Jiangsu
www.chenshaoju.com
The result look's this:
attachment.php


But the system running many many process...

OS:Android 5.1.1
Phone:Google Nexus 4
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 28
    There are probably only two ways you ended up here in this thread:
    1) You were browsing XDA and came across this thread and thought "Hey, that's that? Let's take a look..."
    2) You were looking for an iotop port for Android

    If 2) applies to you, then the you were doing the exact same this as I was doing some days ago. The only difference is.... when I was searching there was no such port :eek:
    But for debugging purposes on my Tab, I needed such a tool. So I started writing my own :) :D


    So, in case you're not familiar with iotop, iotop is a tool for examining I/O loads and and I/O usage on per-process basis. It shows the total amount of read and written bytes as well as the current read/write speeds.

    First up, the script is not yet as powerful as the one for PCs. It's still WIP but does the main tasks it's supposed to.
    If you have an idea and know how to realize it, please feel free to fork my repo and create a pull request. I will most likely be merging it happily.


    Requirements
    1. Root
    2. Kernel with I/O accounting enabled
      The following configs must be set:
      • CONFIG_TASKSTATS
      • CONFIG_TASK_IO_ACCOUNTING
      • CONFIG_TASK_XACCT
      • CONFIG_TASK_DELAY_ACCT

    If your kernel does not support I/O accounting, you may politely ask your kernel dev to enable it in his defconfig. But always remember, it's his call and you have to accept whatever he's gonna do. There is nothing you can do about it.


    Usage
    You can execute the script from wherever you like, be it your sdcard, data partition or system partition. But for easier use, I would recommend you to place it in your /system/bin folder.

    (for this example, I assume you've placed it in /system/bin)
    To run it, you must be root (---> $su )
    Then you can run the actual script
    Code:
    iotop.sh

    You don't like the units being KB? How about MB?
    Code:
    iotop.sh -m

    Still not what you want? Bytes then?
    Code:
    iotop.sh -b

    Found your desired unit? Great! But those entries with no I/O activity are quite annoying, right? So let's get rid of them!
    Code:
    iotop.sh --only

    You don't want to see all those empty entries, but still want to know how many were skipped? No problem:
    Code:
    iotop-sh --only --show-skips

    Still need some help? Check this:
    Code:
    iotop.sh --help


    Download
    So, in case you still want to know where to get it from, the github project is located HERE
    The raw script can be found HERE

    Help
    If you want to join the fun, just let me know!

    XDA:DevDB Information
    iotop for Android, Tool/Utility for all devices (see above for details)

    Contributors
    laufersteppenwolf

    Version Information
    Status: Beta

    Created 2014-10-19
    Last Updated 2014-10-18
    1
    cool,great work.thanx