Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e15ad7e authored by Suren Baghdasaryan's avatar Suren Baghdasaryan Committed by Gerrit Code Review
Browse files

Merge changes from topic "revert move sched_policy functions"

* changes:
  DO NOT MERGE: Revert "Add libprocessgroup into VNDK"
  DO NOT MERGE: Revert "libcutils: Move sched_policy functions into libprocessgroup"
  DO NOT MERGE: Revert "Add dependencies on libprocessgroup for sched_policy users"
parents ed3f1a58 c4a02d25
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -109,7 +109,6 @@ CHARGER_STATIC_LIBRARIES := \
    libbase \
    libbase \
    libutils \
    libutils \
    libcutils \
    libcutils \
    libprocessgroup \
    liblog \
    liblog \
    libm \
    libm \
    libc \
    libc \
+2 −5
Original line number Original line Diff line number Diff line
@@ -66,6 +66,7 @@ cc_library {
        "load_file.cpp",
        "load_file.cpp",
        "native_handle.cpp",
        "native_handle.cpp",
        "record_stream.cpp",
        "record_stream.cpp",
        "sched_policy.cpp",
        "sockets.cpp",
        "sockets.cpp",
        "strdup16to8.cpp",
        "strdup16to8.cpp",
        "strdup8to16.cpp",
        "strdup8to16.cpp",
@@ -177,12 +178,8 @@ cc_library {
        "libbase_headers",
        "libbase_headers",
        "libcutils_headers",
        "libcutils_headers",
        "libutils_headers",
        "libutils_headers",
        "libprocessgroup_headers",
    ],
    export_header_lib_headers: [
        "libcutils_headers",
        "libprocessgroup_headers",
    ],
    ],
    export_header_lib_headers: ["libcutils_headers"],
    local_include_dirs: ["include"],
    local_include_dirs: ["include"],


    cflags: [
    cflags: [
+60 −3
Original line number Original line Diff line number Diff line
@@ -17,10 +17,67 @@
#ifndef __CUTILS_SCHED_POLICY_H
#ifndef __CUTILS_SCHED_POLICY_H
#define __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();

/*
/*
 * For backwards compatibility only
 * Check if Linux kernel enables SCHEDTUNE feature (only available in Android
 * New users should include processgroup/sched_policy.h directly
 * 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.
 */
 */
#include <processgroup/sched_policy.h>
extern const char *get_sched_policy_name(SchedPolicy policy);

#ifdef __cplusplus
}
#endif


#endif /* __CUTILS_SCHED_POLICY_H */ 
#endif /* __CUTILS_SCHED_POLICY_H */ 
+1 −1
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@
** limitations under the License.
** limitations under the License.
*/
*/


#include <processgroup/sched_policy.h>
#include <cutils/sched_policy.h>


#define LOG_TAG "SchedPolicy"
#define LOG_TAG "SchedPolicy"


+0 −1
Original line number Original line Diff line number Diff line
@@ -59,7 +59,6 @@ test_libraries = [
    "libcutils",
    "libcutils",
    "liblog",
    "liblog",
    "libbase",
    "libbase",
    "libprocessgroup",
]
]


cc_test {
cc_test {
Loading