Loading healthd/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ CHARGER_STATIC_LIBRARIES := \ libbase \ libutils \ libcutils \ libprocessgroup \ liblog \ libm \ libc \ Loading libcutils/Android.bp +5 −2 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ cc_library { "load_file.cpp", "native_handle.cpp", "record_stream.cpp", "sched_policy.cpp", "sockets.cpp", "strdup16to8.cpp", "strdup8to16.cpp", Loading Loading @@ -178,8 +177,12 @@ cc_library { "libbase_headers", "libcutils_headers", "libutils_headers", "libprocessgroup_headers", ], export_header_lib_headers: [ "libcutils_headers", "libprocessgroup_headers", ], export_header_lib_headers: ["libcutils_headers"], local_include_dirs: ["include"], cflags: [ Loading libcutils/include/cutils/sched_policy.h +3 −60 Original line number Diff line number Diff line Loading @@ -17,67 +17,10 @@ #ifndef __CUTILS_SCHED_POLICY_H #define __CUTILS_SCHED_POLICY_H #include <stdbool.h> #ifdef __cplusplus extern "C" { #endif /* * Check if Linux kernel enables CPUSETS feature. * * Return value: 1 if Linux kernel CONFIG_CPUSETS=y; 0 otherwise. */ extern bool cpusets_enabled(); /* * Check if Linux kernel enables SCHEDTUNE feature (only available in Android * common kernel or Linaro LSK, not in mainline Linux as of v4.9) * * Return value: 1 if Linux kernel CONFIG_CGROUP_SCHEDTUNE=y; 0 otherwise. */ extern bool schedboost_enabled(); /* Keep in sync with THREAD_GROUP_* in frameworks/base/core/java/android/os/Process.java */ typedef enum { SP_DEFAULT = -1, SP_BACKGROUND = 0, SP_FOREGROUND = 1, SP_SYSTEM = 2, // can't be used with set_sched_policy() SP_AUDIO_APP = 3, SP_AUDIO_SYS = 4, SP_TOP_APP = 5, SP_RT_APP = 6, SP_RESTRICTED = 7, SP_CNT, SP_MAX = SP_CNT - 1, SP_SYSTEM_DEFAULT = SP_FOREGROUND, } SchedPolicy; extern int set_cpuset_policy(int tid, SchedPolicy policy); /* 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. * On platforms which support gettid(), zero tid means current thread. * 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. * On platforms which support gettid(), zero tid means current thread. * 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. * For backwards compatibility only * New users should include processgroup/sched_policy.h directly */ extern const char *get_sched_policy_name(SchedPolicy policy); #ifdef __cplusplus } #endif #include <processgroup/sched_policy.h> #endif /* __CUTILS_SCHED_POLICY_H */ libcutils/tests/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ test_libraries = [ "libcutils", "liblog", "libbase", "libprocessgroup", ] cc_test { Loading libprocessgroup/Android.bp +37 −2 Original line number Diff line number Diff line cc_library_headers { name: "libprocessgroup_headers", vendor_available: true, recovery_available: true, host_supported: true, export_include_dirs: ["include"], target: { linux_bionic: { enabled: true, }, windows: { enabled: true, }, }, } cc_library { srcs: ["processgroup.cpp"], srcs: [ "processgroup.cpp", "sched_policy.cpp", ], name: "libprocessgroup", host_supported: true, recovery_available: true, shared_libs: ["libbase"], vendor_available: true, vndk: { enabled: true, support_system_process: true, }, shared_libs: [ "libbase", "liblog", ], // for cutils/android_filesystem_config.h header_libs: [ "libcutils_headers", "libprocessgroup_headers", ], export_include_dirs: ["include"], export_header_lib_headers: [ "libprocessgroup_headers", ], cflags: [ "-Wall", "-Werror", Loading Loading
healthd/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ CHARGER_STATIC_LIBRARIES := \ libbase \ libutils \ libcutils \ libprocessgroup \ liblog \ libm \ libc \ Loading
libcutils/Android.bp +5 −2 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ cc_library { "load_file.cpp", "native_handle.cpp", "record_stream.cpp", "sched_policy.cpp", "sockets.cpp", "strdup16to8.cpp", "strdup8to16.cpp", Loading Loading @@ -178,8 +177,12 @@ cc_library { "libbase_headers", "libcutils_headers", "libutils_headers", "libprocessgroup_headers", ], export_header_lib_headers: [ "libcutils_headers", "libprocessgroup_headers", ], export_header_lib_headers: ["libcutils_headers"], local_include_dirs: ["include"], cflags: [ Loading
libcutils/include/cutils/sched_policy.h +3 −60 Original line number Diff line number Diff line Loading @@ -17,67 +17,10 @@ #ifndef __CUTILS_SCHED_POLICY_H #define __CUTILS_SCHED_POLICY_H #include <stdbool.h> #ifdef __cplusplus extern "C" { #endif /* * Check if Linux kernel enables CPUSETS feature. * * Return value: 1 if Linux kernel CONFIG_CPUSETS=y; 0 otherwise. */ extern bool cpusets_enabled(); /* * Check if Linux kernel enables SCHEDTUNE feature (only available in Android * common kernel or Linaro LSK, not in mainline Linux as of v4.9) * * Return value: 1 if Linux kernel CONFIG_CGROUP_SCHEDTUNE=y; 0 otherwise. */ extern bool schedboost_enabled(); /* Keep in sync with THREAD_GROUP_* in frameworks/base/core/java/android/os/Process.java */ typedef enum { SP_DEFAULT = -1, SP_BACKGROUND = 0, SP_FOREGROUND = 1, SP_SYSTEM = 2, // can't be used with set_sched_policy() SP_AUDIO_APP = 3, SP_AUDIO_SYS = 4, SP_TOP_APP = 5, SP_RT_APP = 6, SP_RESTRICTED = 7, SP_CNT, SP_MAX = SP_CNT - 1, SP_SYSTEM_DEFAULT = SP_FOREGROUND, } SchedPolicy; extern int set_cpuset_policy(int tid, SchedPolicy policy); /* 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. * On platforms which support gettid(), zero tid means current thread. * 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. * On platforms which support gettid(), zero tid means current thread. * 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. * For backwards compatibility only * New users should include processgroup/sched_policy.h directly */ extern const char *get_sched_policy_name(SchedPolicy policy); #ifdef __cplusplus } #endif #include <processgroup/sched_policy.h> #endif /* __CUTILS_SCHED_POLICY_H */
libcutils/tests/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ test_libraries = [ "libcutils", "liblog", "libbase", "libprocessgroup", ] cc_test { Loading
libprocessgroup/Android.bp +37 −2 Original line number Diff line number Diff line cc_library_headers { name: "libprocessgroup_headers", vendor_available: true, recovery_available: true, host_supported: true, export_include_dirs: ["include"], target: { linux_bionic: { enabled: true, }, windows: { enabled: true, }, }, } cc_library { srcs: ["processgroup.cpp"], srcs: [ "processgroup.cpp", "sched_policy.cpp", ], name: "libprocessgroup", host_supported: true, recovery_available: true, shared_libs: ["libbase"], vendor_available: true, vndk: { enabled: true, support_system_process: true, }, shared_libs: [ "libbase", "liblog", ], // for cutils/android_filesystem_config.h header_libs: [ "libcutils_headers", "libprocessgroup_headers", ], export_include_dirs: ["include"], export_header_lib_headers: [ "libprocessgroup_headers", ], cflags: [ "-Wall", "-Werror", Loading