PKG_CHECK_MODULES(TANCHOR_DEPS REQUIRED tanchor)
PKG_CHECK_MODULES(TTRACE_DEPS REQUIRED ttrace)
PKG_CHECK_MODULES(VCONF_DEPS REQUIRED vconf)
+PKG_CHECK_MODULES(SYSTEM_RESOURCE_DEPS REQUIRED capi-system-resource)
ADD_SUBDIRECTORY(src)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(libsmack)
BuildRequires: pkgconfig(pkgmgr-installer)
+BuildRequires: pkgconfig(capi-system-resource)
Requires(post): /sbin/ldconfig
Requires(post): /usr/bin/systemctl
%{_libdir}/*.so
%{_libdir}/pkgconfig/liblaunchpad.pc
%{_libdir}/pkgconfig/liblaunchpad-hydra.pc
-
*/
#define _GNU_SOURCE
+#include <cpu-boosting.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
__sequencer_fini();
}
+static void __set_cpu_boosting()
+{
+ pid_t pid = getpid();
+ resource_pid_t res_pid = {
+ .pid = 0,
+ .tid = &pid,
+ .tid_count = 1,
+ };
+
+ int ret = resource_set_cpu_boosting(res_pid, CPU_BOOSTING_LEVEL_MEDIUM,
+ CPU_BOOSTING_RESET_ON_FORK, 5000);
+ if (ret != 0)
+ _E("Failed to set cpu boosting, %d", ret);
+ else
+ _D("Successfully set cpu boosting");
+}
+
+static void __unset_cpu_boosting()
+{
+ pid_t pid = getpid();
+ resource_pid_t res_pid = {
+ .pid = 0,
+ .tid = &pid,
+ .tid_count = 1,
+ };
+
+ int ret = resource_clear_cpu_boosting(res_pid);
+ if (ret != 0)
+ _E("Failed to unset cpu boosting, %d", ret);
+ else
+ _D("Successfully unset cpu boosting");
+}
+
int main(int argc, char **argv)
{
GMainLoop *mainloop = NULL;
return -1;
}
+ __set_cpu_boosting();
_print_hwc_log("%s(%d): __before_loop()", __FUNCTION__, __LINE__);
if (__before_loop(argc, argv) != 0) {
_E("process-pool Initialization failed!");
_set_priority(-12);
#endif
_print_hwc_log("%s(%d): g_main_loop_run()", __FUNCTION__, __LINE__);
+
+ __unset_cpu_boosting();
g_main_loop_run(mainloop);
__after_loop();