Analyse performance / profile Android System? Why is the system slow? My Android 4.2.1 tablet is slow, it wasn’t when purchased. As the reason is often the software, I was looking for a tool to analyse the performance of the whole system, but couldn’t find any.

What I tried:


CPU usage monitoring: Only current or accumulated CPU usage
An app that alerts when any app uses more CPU than a specified threshold: This only alerted quite seldomly, so there doesn’t seem to be an app that uses so much CPU itself


To find out the reason of the slowness, I would like to get an overall view of the system’s performance, showing how much time was spent with which activity. This may include CPU usage, but may also include I/O performance or how long processed waited for I/O etc. For example, Firefox offers a profiler.

Or is this not really possible because of Android’s design?
Are there other utilities that might help?

Another point is that Android doesn’t support TRIM until 4.3. Could the usage of nearly two years with many installations and some system resets have caused the flash memory to get so slow that the poor I/O performance now slows down the whole device?

To the manufacturer’s support, I wrote the following problem description:


  Opening of apps takes longer, sometimes everything stands still for
  some seconds. After the last firmware/Android upgrade (a year ago) I
  even reinstalled the system. However, after some time, it got slow
  again.


Only after this vague and undetailed description, the reply said that the reason would most probably be a hardware defect and that I should send the device in to be repaired.

How should I continue my analysis? Is the support’s assessment reasonable?

Update

Recently, a new app was added to the PlayStore concerning exactly one of my desired analysis:


CPU Monitor (non-free, restricted demo)
If you truly want to dive into the slowness issues of your Android device you can use the Android SDK and developer tools to analyze what the device is doing exactly, but that's not for the average Android user.
Something I found out just recently is that the Battery Optimization functionality on my Nexus 5X was really slowing the system down to the point of becoming unusable.
I manually disabled this feature for each and every App and OS element and that made a huge  difference.
And I haven't experienced any obvious battery drainage since.
If you want to try this, the steps are described here