summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-03-15 15:45:19 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-03-15 15:45:19 -0700
commit0ad682cddef396c91707a31d4982dc55206dca1b (patch)
treecaddef67ccc69d7f00031f21f003e91dbc8a4735 /include
parentc4c631a15f04bdcbf8c70737e818c7e4efd5ff7b (diff)
parent86c7cc81891a69ace7044de667b0624c284ee82b (diff)
downloadsystem_core-0ad682cddef396c91707a31d4982dc55206dca1b.zip
system_core-0ad682cddef396c91707a31d4982dc55206dca1b.tar.gz
system_core-0ad682cddef396c91707a31d4982dc55206dca1b.tar.bz2
Merge "Add get_sched_policy_name() and use in ps and top"
Diffstat (limited to 'include')
-rw-r--r--include/cutils/sched_policy.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/cutils/sched_policy.h b/include/cutils/sched_policy.h
index eaf3993..753a08c 100644
--- a/include/cutils/sched_policy.h
+++ b/include/cutils/sched_policy.h
@@ -24,11 +24,28 @@ extern "C" {
typedef enum {
SP_BACKGROUND = 0,
SP_FOREGROUND = 1,
+ SP_CNT,
+ SP_MAX = SP_CNT - 1,
} SchedPolicy;
+/* Assign thread tid to the cgroup associated with the specified policy.
+ * If the thread is a thread group leader, that is it's gettid() == getpid(),
+ * then the other threads in the same thread group are _not_ affected.
+ * Return value: 0 for success, or -errno for error.
+ */
extern int set_sched_policy(int tid, SchedPolicy policy);
+
+/* Return the policy associated with the cgroup of thread tid via policy pointer.
+ * Return value: 0 for success, or -1 for error and set errno.
+ */
extern int get_sched_policy(int tid, SchedPolicy *policy);
+/* Return a displayable string corresponding to policy.
+ * Return value: non-NULL NUL-terminated name of unspecified length;
+ * the caller is responsible for displaying the useful part of the string.
+ */
+extern const char *get_sched_policy_name(SchedPolicy policy);
+
#ifdef __cplusplus
}
#endif