Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Android have a way to display process priority in adb?

Tags:

linux

android

I'm trying to use busybox 'nice' and 'renice' to adjust Android process priorities, but I can't tell if they take effect. I tried using 'ps' and 'busybox top' in adb shell, but those don't display priority. Is there a way to see and adjust priority within adb?

like image 774
Ravi Avatar asked Mar 25 '11 19:03

Ravi


1 Answers

The basic Android "ps -p" will show process priorities. "ps -t -p" will show them for all threads. Not sure how to get the same thing out of busybox.

They also appear in the stack traces from the Dalvik VM. If you hit the process with a SIGQUIT (kill -3 ), it'll dump to dalvik.vm.stack-trace-file, which defaults to /data/anr/traces.txt. The output looks like:

"WindowManager" prio=5 tid=20 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x409404d8 self=0x264970
  | sysTid=2884 nice=-4 sched=0/0 cgrp=default handle=2510248
  | schedstat=( 4116000 5332000 12 ) utm=0 stm=0 core=0

This shows the "nice" value, as well as scheduling priorities and the cgroup. (Exact output varies from release to release.)

like image 92
fadden Avatar answered Sep 22 '22 15:09

fadden