yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] 3c:
The next update will record every 5 minutes by default and allow rates up-to 30 minutes. The description will also be fixed. Still under testing, but will be released soon.

Yes indeed! Still working on that, trying to decide whether to put that in BMW or this app or both as options.

For now I focused on recorded all processes (not only Android apps) so that users can optionally record everything when needed.
[Android Apps and Games] shs1460:
Negative Values

I am finding that a number of processes are showing negative % values for consumption. If I look at details for that process it also shows negative values for time since start, CPU usage and the like.

Not sure what to make of this. Any thoughts?
[Android Apps and Games] 3c:
That's odd as I never saw such behavior, so I just reviewed the code.

The time since start is directly provided by the system in milliseconds! The data is provided as a string and converted using integer parsing with a limit of 24 days!

Has your phone been up and running more than 24 days? If that's the issue, the attached APK should solve this.
[Android Apps and Games] shs1460:
No, device is rebooted pretty much daily. Processes that go into the negative values are not consistent. Right now its gmail and your own battery monitor widget (another process was showing negative values a few hours ago and now is showing positive numbers. I'm running a Droid 2, not rooted, with stock OS. Would love to figure this out. Any more info I can supply you with that might help?
[Android Apps and Games] 3c:
Would like to figure this out too :)

Could you take a snapshot of a process detail screen showing the behavior?

Or write down the values for 'started', 'time since start', 'cpu usage' and 'cpu consumption', that will give me a good idea of what is being affected!

Then using the PID of that process, if you can post the file at the following location: /proc/[pid]/stat

This should be a good start to understand what's going wrong here!
[Android Apps and Games] sancho1234:
After the upgrade

How can I import the data from demo version to the full/paid version?

I would like to see the full month in the full version, but I have been upgrading since yesterday. :-)

Thank you!
[Android Apps and Games] 3c:
You must be talking about Battery Monitor Widget? Thread can be found here. Anyway, just set the same history file (default being /sdcard/battery_history.txt) but you probably changed it in the free version?

The only thing you loose during upgrade is the settings, no the history data...
[Android Apps and Games] shs1460:
Really looks like for some reason, a negative value is being picked for some stat messing up your subsequent calculations.

These are the stat's for Battery Monitor Widget process as reported in Process Monitor Screen:

Note that I rebooted the device about 10 hours ago (11:02 PM Eastern Time)

so even the Process Started time seems wrong (unless displayed Started Time is not respecting time zone offset of the device)

PID 21434

Process Details

Started: 2011/04/10 13:43:18

CPU Usage:

Time Since Start: -1d -5h -4m 0 -26s (note that this number is counting down instead of up. When I look now at it shows as -1d -4h -55m 0 -40s)

CPU Use: 32.87s

CPU Consumption -0.03%

And here's the contents of the stat file for the above process:

21434 (ccc71.bmw) S 20666 20666 0 0 -1 4194624 32437 0 51 0 3038 252 0 0 20 0 20 0 28378250 171098112 3859 4294967295 32768 36568 0 0 0 0 4612 0 38120 4294967295 0 0 17 0 0 0 0 0 0

Hope this helps.
[Android Apps and Games] 3c:
Thanks for taking the time to report those data.

Yes, consumption is based on start time, which is wrong in the first place!

What is of interest in the stat file is the 22nd value (28378250) which counts the number of 'jiffies' since boot, jiffies being on most Linux architecture 10ms... Which is what PMW uses for simplicity. But on your device it seems to be 1ms, because that figure would mean BMW started 3 days after boot using 10ms jiffy or 7 hours using 1ms jiffy!

To confirm this could you post the files /proc/uptime and /proc/timer_list?

In the timer_list, a single line is of interest near the end starting with jiffies...

I'm very interested to know what kind of hardware and ROM you have? :)
[Android Apps and Games] shs1460:
Running Verizon Droid 2, Not Rooted, most current stock Froyo ROM.

Contents of Uptime

330310.01 172456.25

timer_list

jiffies: 24272722
[Android Apps and Games] brandall:
Inclusion Suggestions

Good work on this application, it's very slick and useful.

A few suggestions (perhaps only useful to me!?):

1) The option to have 'nothing' showing in a position in the widget (currently you have to have a minimum of three things, where as I only want two!

2) The inclusion of the option to show the CPU governor in the widget (I'm tweaking the CPU settings with Tasker and recommended your app - see here for more ideas of CPU 'states' you could include. Poach away!)

3) A way to 'auto-save' at intervals the log to a .txt file on the SD card. I want Tasker to be able to 'read' a log file at intervals, then report errors or perform tasks based upon its output - At present I think I can only manually save the log to a file which prevents this automisation?

Again, great work. Please keep up the dev!
[Android Apps and Games] 3c:
Well, well, something doesn't add up here!

The uptime file says your phone has been up-and-running 3 days 19 hours 45 minutes, and it doesn't even include deep-sleep time!

When you go in CPU detail screen, what does the app says for actual start time, up-time and deep-sleep time? PMW uses Android API instead of the uptime file!

It seems that's were the inconsistency starts!

The jiffy seems to be around 75 per seconds or one jiffy = 13ms! Accounting for time between file opening, we're close enough to 10ms, the usual on Android.

Please find attached a test version that should solve your issue, but there might be other issues, so would you mind reporting this:

- logcat of the app, 3 lines of interest starting with 'Read up-time'

- CPU detail page:

. Start time (is it consistent with the phone actually starting?)

. Up-time

. Deep sleep

Thanks a lot for your time in helping me investigate this issue!
[Android Apps and Games] 3c:
Very good thread about Tasker, will check that when I have free time... hopefully before end of the year :)

1) You can remove the scale and if you keep the central icon you'll have 2 values, one at the top one at the bottom. Would it be satisfying? Otherwise I can still add 'nothing' as an option :)

2) Interesting option, i can add either the initial (or first letters) of the governor name quite easily indeed...

3) True logcat can only be saved manually, but I like your idea, could be useful to track some errors over a long period of time and avoid out of memory conditions :)

Those are added to the ever increasing TODO list :) Option 2 being quite easy should make it through quickly! Let me know if you still want option 1, even easier :).
[Android Apps and Games] sancho1234:
Thank you!
[Android Apps and Games] samadeus:
Could you make this application can be installed in Samsung Galaxy Ace? Thanks. :D
[Android Apps and Games] 3c:
Hello,

Will need your help to understand why it currently doesn't install on your device.

You're running Froyo 2.2 stock ROM? Can you see the app on Market, and if so, what happens when you try to download/install it?
[Android Apps and Games] brandall:
Thanks for your response.

1) It's my personal preference to have no icons on my homescreen, only text - minimalist is all the rage! I use minimalist text, smooth calendar, WP7 wallpaper, clockr etc all with text only options and configurable text font and colours. It's only a suggestion of course, but they are very popular apps and if your widget is compatible, you may get a few more downloads?? Don't dev just on my account though!

2) I currently have the governor name displayed by a Tasker variable via Minimalist Text. Again, CPU controls are all the rage and I found no other widget that displayed the governor when searching. Might just be me that wants it though!

3) It's a shame it's not easier to do - sifting through a huge log is effort!

Hope my feedback helps and I look forward to your future releases.
[Android Apps and Games] shs1460:
Using current Market Version I see Start Time of Apr 5, 2011 4:12:04PM. This is incorrect as the last boot was Apr 8 11:02PM, but interestingly, the book previous to that was indeed April 5 at 4:13PM. More interesting is that the Apr 8 reboot was the result of a device crash so the April 5 date must of been leftover and not reset! While this is do doubt interesting, the problem with the negative values has been happening since I first started using PMW weeks ago with multiple 'clean' reboots of the device during that time.

Up time is showing 2d 15h 54m 59s

Deep Sleep is 2d 1h 10m 37s

Just curious - Could the 13ms per jiffie indicate and general performance issues on my device (it lags from time to time)?

I'll load your test version shortly and report back.....
[Android Apps and Games] shs1460:
More strangeness. Here are two sets of numbers. The first is after I de-installed market version and simply moved your test version to the handset and then had a hard crash again (not sure if this was induced by de-installing PMW or turning on and off handset as a mass storage device). Second set is after a clean reboot.

After Hard Crash

Start Time: March 31 10:38:16 (no clue where this date came from)

Up Time: 4d 17h 33m 59s

Deep Sleep: 24s

Read from OS including Deep Sleep: 408937

Read from OS excluding Deep Sleep: 231863542

Read from/uptime: 408912

After Clean Boot

Start Time: Apr 10 9:49:25 AM (that's more like it)

Up Time: 5m 40s

Deep Sleep: 0s

Read from OS including Deep Sleep: 266

Read from OS excluding Deep Sleep: 138687

Read from/uptime: 267
[Android Apps and Games] 3c:
The app is fully written in Java and runs within a Virtual Machine, so if the phone reboots unexpectedly it's definitely a bug with the installed ROM.

Back to your issue, forget the March 31st, the start time in this test version is messed up using twice the up-time, nevertheless a 4days up-time whereas the phone just started is quite unexpected.

Note sure how to cope with this then... if you have an uptime of 4 days, then it's ok to have an app started 3 days after boot, shouldn't bring negative values... It seems at some point the uptime and the app started delay are inconsistent!?
[Android Apps and Games] shs1460:
Ignoring the values after the phone crashed, do the values after the clean re-boot look consistent and correct?

So far, with the test version you gave me, none of the values I'm seeing are negative, Start Time and uptime look correct and everything appears to make sense. Is the test version doing something different than market version?
[Android Apps and Games] 3c:
Yes, values are consistent on clean reboot.

No much difference except the uptime is taken from the /proc/utime instead of using Google API... But both sources provides the same value anyway, whether after crash or clean boot.

So it will probably occur again... When it does, if you can provide me with the whole data again, that could help:

- content of /proc/uptime

- jiffy in /proc/timer_list

- Values from PMW: start time, uptime and sleep time and the logcat of PMW

- Values for a faulty process: start time, uptime and /proc/<pid>/stat content

I'm very sorry for the inconvenience and for asking so much, but that's the only way I can figure out what's actually going on without being able to reproduce the issue...

I'll try to not reboot my phone for a long period and/or crash it to see if I can actually reproduce this behavior... just in case.

On all phones I've tried the start time of a process is calculated based on system uptime excluding sleep-time. The only thing I can think of is that sleep-time should be accounted for after a hard crash. If that's the case I can put a work-around for this. The data above should show if I'm correct.
[Android Apps and Games] shs1460:
no problem, I'm also a software developer so I can appreciate the problems of debugging these kinds of issues. When I start to see it go haywire again, I'll pull the values for you...
[Android Apps and Games] 3c:
I've reviewed your last figures again and realized you don't get the same results as I do!

Read from OS including Deep Sleep: 266
Read from OS excluding Deep Sleep: 138
Read from kernel/uptime: 267

Your uptime reports time since boot INCLUDING deep sleep, whereas on my phone (HD2) and a Galaxy S, it reports time since boot EXCLUDING deep sleep!?

Read from OS including Deep Sleep: 31514
Read from OS excluding Deep Sleep: 7642
Read from kernel/uptime: 7642

The market version of PMW uses 'OS excluding DS' value as a reference (it's actually faster)... whereas the test version uses uptime because I suspected a difference! And there is actually a big difference I didn't noticed at first!

So you shouldn't be able to reproduce the issue with the test version :)

Thanks again for taking the time to report and help! Will do more testing for a few days before updating Market! Keep me posted if anything comes up!

NB: The start time in the CPU detail page will be incorrect in the test version, but it's not used elsewhere. It shows a time twice as much in the past that it actually is.
[Android Apps and Games] shs1460:
Glad I could help. Will the test version I have auto update when Market is updated or will I need to de-install and re-install new Market version?

Let me know if you need anything else....

P.S. do you use any of the same values in Battery Monitor Widget that might also be suspect?
[Android Apps and Games] MKairys:
Another small request,although I realize your todo list must be growing :) Allow us to specify a directory in which to save logs. I would like to co-locate saved logs with recordings etc.

P.S. I hope you will be able to improve the button bar as well! :)
[Android Apps and Games] 3c:
Hello, yes specifying the output directory would be much better :) Added to the list (getting longer and longer indeed).

The last update was a first step towards improving the button bar.

I tried the scrolling button bar, but didn't find it very convenient as scrollers takes a little bit of time to stop scrolling I ended up having to press the desired button twice after any scroll, very annoying! Will make further attempt for a scrolling button bar...
[Android Apps and Games] maxx228:
Thanks !! Just installed

This is a powerful tool~~~~
[Android Apps and Games] MKairys:
Perhaps you would consider just allowing us to specify which buttons show on the bar and which on the menu? What I really want is to have the buttons I use most right up front, so if I could just replace Kill All and Terminal with Record and Analyze I would be most happy :)
[Android Apps and Games] 3c:
Understood, will see to that. there might not be ordering initially
[Android Apps and Games] shs1460:
Internal Memory Details

PWM does not seem to recognize that my phone is rooted when I try and see details for internal memory. Keeps giving message that it Requires Rooted Phone for Details. I have given it SuperUser access and the SuperUser logs does show that it is being given access.

Droid 2, Stock Froyo ROM, Rooted
[Android Apps and Games] 3c:
Hello and sorry for the inconvenience, I suspect PMW has issues finding your data partition...

Do you know where it's located on your phone? By default PMW looks in /data/*, and more precisely those sub-folders: /data/data, /data/app, etc...

Sometimes those are links to /sd-ext/*... I need to switch ROM to actually implement good support for this!
[Android Apps and Games] shs1460:
sure looks like it's in the usual /data/* location.
[Android Apps and Games] 3c:
Yes, they are in /data/* no matter what, but then the subdirectories are probably links.

Which ROM are you using, thread link on XDA? Do you have app2sd+ or app2ext?

Can you attach the logcat for PMW after opening the memory detail page?
[Android Apps and Games] shs1460:
Using Root Explorer - nothing looks unusual with sub folders - would there be an indication that it's a link?

ROM is stock most current Verizon Droid 2 Froyo

Do not have app2sd or app2 ext

Note that version of PMW I'm running is a test copy you gave me last week to deal with the negative values we were seeing...

log attached.

Using Root Explorer - nothing looks unusual with sub folders - would there be an indication that it's a link?
[Android Apps and Games] 3c:
No problem using the test version.

Can you try this command in PMW terminal (SU must be checked): du -s /data/app

If it goes well, you should get the size of the /data/app directory... maybe the du command is not available on your phone!? Then I'll have to browse the folder 'manually'...

You may also try this one: du /sdcard, this one doesn't need super user, but if it fails will confirm you don't have du on the phone...
[Android Apps and Games] shs1460:
command du -s /data/app with SU check yields a green line below that reads:

> du -s /data/app (su)

and no other values

du /sdcard without SU checked yields an error that reads:

>du /sdcard

Failed to run: java.io.IOException==Error running exec(). Command: [du,/sdcard] Working Directory: null Environment: null
[Android Apps and Games] 3c:
It definitely seems du is not available on your phone. Can you try the following command with SU checked: ls -Rl /data/app
[Android Apps and Games] shs1460:
ls -Rl /data/app yields a list of .apk files
[Android Apps and Games] tw0f4z3:
giving this app a try, thanks...
[Android Apps and Games] peterbonge:
I have a problem with the analyzer graph:

(In my example I've used a recording file with a duration of 58m 40s)

If I open the file the graph is shown correctly, but the duration below the graph shows 00 (Grid also 00).

If I use the clip command the duration shows 58:00.

If I zoom x2 the duration shows 29:00.

If I now use the clip command again the duration shows 15:00.

If I now choose no zoom the duration shows 30:00

Now the questions:

- Why does it show 0 at the beginning?

- What is the clip command good for?

- How do I go back to the full duration?

Another small problem: If I click on the Filter button there seems to be no way to go back without changing the filter.
[Android Apps and Games] 3c:
This is a bug, until you zoom the info is not set. Fix ready for next update.

A little approximation bug, considering there is no zoom and you see the whole 58:40 minutes.

When you zoom x2 on 58 minute interval it only shows half of it, that is 29 minutes

When you clip on what's visible, you clip on those 29 minutes, but x2 zoom remains active, hence you see half of it = 15 minutes (+/- approximation errors).

Resetting the zoom from x2 to x1, shows 30 minutes. that is you clipped half of 58 minutes +/- approximation errors

Doing what it says: clip or crop or keep only the visible area.

I use it to crop part of the history to study a particular behavior, eg during sleep mode, in call, active, etc...

When you clip each process data is recalculated, so you can check how much a specific process consumes in each phone state of interest, without various perturbations. If CPU is at 5% and your process consumed 1% of than, your process actually used 0.05% of the whole interval... or over 60 minutes, it used 1 s 800 ms

Another scenario I run is to switch on/off the screen frequently, I check behavior of my apps.

See screen-shot of a sample while a HD2 @1GHz phone is in standby during 7h35 (initial duration was 12h00):

PMW has consumed 11.69% of 0.49% = 0.057% (or 15.56 seconds total or 49 seconds per day)

BMW is at 2.27% of 0.49% = 0.01% (or 2.73s or 8.73 seconds per day)

I also plan to add a save command allowing to save to a new recording the clipped data. Then you can name those and load a scenario later for study.

You have to reload the file

Yes indeed... annoying, isn't it! will add support for back button or a timer.
[Android Apps and Games] shs1460:
Any further thoughts on this or any other info I can supply?
[Android Apps and Games] 3c:
EDIT: Actually yes, I have a rooted phone with the same issue, but running this as su works fine: du /data/*

Can you try and let me know if this command works?

If not the other choice but to use less performant ls -Rl solution...
[Android Apps and Games] qweasdpoilkj:
look nice will giv a try ;) thanks
[Android Apps and Games] shs1460:
Unfortunately, du /data/* with SU checked yields no result values as well.
[Android Apps and Games] peterbonge:
Thanks for all the explanations!

Maybe it would be less confusing (for some people) if the zoom would be reset when using the clip command.
[Android Apps and Games] shs1460:
Some success below

Just for kicks I tried using the command:

busybox du /data/*

and it returned a whole list of data

Likewise

busybox du -s /data/app

returned

52460 /data/app

Hope this info helps...
[Android Apps and Games] 3c:
Agreed, will do!

Great, now I have to add support for busybox :) Weird how busybox seems to take control over the shell! I installed it on my (new) phone and since I get the same issue you do! Was wondering how I could solve this, but you found the solution!

Thanks!
[Android Apps and Games] shs1460:
Glad I could help!
[Android Apps and Games] Gunthermic:
Have been runing Battery Monitor for weeks now, love it.. So decided to try and the Process Monitor, took al of 5 minutes to decide to buy it! Awesome work.. Love the information it provides.

Several items:

1. If you select CPU freq it does not fit in the Widget in any of the thre slots.

2. You allow us to change the color of the bars at the top. How about defualt color for back ground of the bars and a different color for the reporting of info. Slect a green, and a green on green background is truly hard to see.

3. The text within the bars is hard to see as well. Bold?
[Android Apps and Games] 3c:
Very happy to see you like the app :)

1. I suppose sizing down the text a little should do. Will see to do that (got to implement support for my new phone to actually test).

2. Maybe I should not allow that much customizations :) So you'd like to select two colors for the usage bars to create the actual shade, right?

3. Next version have a black text on the used side, white on the free side... seems to work nicely so far.
[Android Apps and Games] Gunthermic:
Yea two colors bars might make it easier to read.

Another item. I have my CPU set to 1230 but the bar when at max CPU still only fills in half of the bar. It doesn't scale to what the CPU max is, you have the number cause you report it.
[Android Apps and Games] 3c:
Ok for the 2 colors, will have a look.

For the CPU, do you have a screen-shot? Then if you could attach the content of the file /sys/devices/system/cpu/cpu0/freq/available_frequencies (filename may differ slightly as I'm writing from memory)

I'm actually working on the CPU screen to add support for the Optimus 2X which doesn't provide the same files as most other devices, so it's a good time to fix any related issues.

Are you able to use the slider to change max CPU frequency?
[Android Apps and Games] Gunthermic:
I will grab a screen shot tonight and upload it.

We can change the CPU freq in your program? Where? **EDit nevermind I see it.. LOL

I had the PW set to start recording upon boot, and it FC's every time. I took of start recording at boot and it doesn't have the issue anymore.

I am tryign to learn this puppy. I went from 8pm to 4am as was down to 52% left, but the process isn't showing anything using up processing. So where do I star tto look within the program to understand the drain?

Any thought about making the widget the same size as the BW?

Looking at the logs I see several things and am wondering:

Tons of these:

dalvikm(XXX)

Failed to find cpu subsys

TrafficStats(XXXX)

[QCTMM]tryAll index=0 and index =1 and index=3