summaryrefslogtreecommitdiffstats
path: root/toolbox/ps.c
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-03-05 16:14:39 -0800
committerGlenn Kasten <gkasten@google.com>2012-03-15 15:10:45 -0700
commit86c7cc81891a69ace7044de667b0624c284ee82b (patch)
tree6fff9f3e763724ee70181b6559e0a76b1ec21a03 /toolbox/ps.c
parent019524a60e979053b8b8ffef61eae162de522257 (diff)
downloadsystem_core-86c7cc81891a69ace7044de667b0624c284ee82b.zip
system_core-86c7cc81891a69ace7044de667b0624c284ee82b.tar.gz
system_core-86c7cc81891a69ace7044de667b0624c284ee82b.tar.bz2
Add get_sched_policy_name() and use in ps and top
This will make it easier to add additional policies (cgroups) if needed. Also added comments to the sched_policy APIs. Change-Id: I33ce1cc4deae10983241f7391294b7a512d2c47c
Diffstat (limited to 'toolbox/ps.c')
-rw-r--r--toolbox/ps.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/toolbox/ps.c b/toolbox/ps.c
index 7c3de4a..7c35ccb 100644
--- a/toolbox/ps.c
+++ b/toolbox/ps.c
@@ -167,14 +167,8 @@ static int ps_line(int pid, int tid, char *namefilter)
SchedPolicy p;
if (get_sched_policy(pid, &p) < 0)
printf(" un ");
- else {
- if (p == SP_BACKGROUND)
- printf(" bg ");
- else if (p == SP_FOREGROUND)
- printf(" fg ");
- else
- printf(" er ");
- }
+ else
+ printf(" %.2s ", get_sched_policy_name(p));
}
printf(" %08x %08x %s %s", wchan, eip, state, cmdline[0] ? cmdline : name);
if(display_flags&SHOW_TIME)