From 209b1a84bab124c8d7f0ea1b4d60af52cd43d742 Mon Sep 17 00:00:00 2001 From: Wook Song Date: Fri, 3 Feb 2017 08:02:33 +0900 Subject: [PATCH 01/16] pass: Change the usage of the term "hardware" This patch changes most of the usage of the term "hardware" to the usage of the term "hal". Change-Id: I2bab96ec6d77ae4a8058e30baf01c223e3856d80 Signed-off-by: Wook Song --- src/hal/hal-cpu-example.c | 6 +++--- src/hal/hal.c | 4 ++-- src/hal/hal.h | 20 ++++++++++---------- src/pass/pass-hal.c | 24 ++++++++++++------------ src/pass/pass.h | 10 +++++----- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/hal/hal-cpu-example.c b/src/hal/hal-cpu-example.c index 7faaf25..bc3896a 100644 --- a/src/hal/hal-cpu-example.c +++ b/src/hal/hal-cpu-example.c @@ -159,9 +159,9 @@ static int pass_close(struct pass_resource_common *common) return 0; } -HARDWARE_MODULE_STRUCTURE = { - .magic = HARDWARE_INFO_TAG, - .hal_version = HARDWARE_INFO_VERSION, +HAL_MODULE_STRUCTURE = { + .magic = HAL_INFO_TAG, + .hal_version = HAL_INFO_VERSION, .device_version = HARDWARE_INFO_VERSION_CPU, .id = PASS_RESOURCE_CPU_ID, .name = PASS_RESOURCE_CPU_NAME, diff --git a/src/hal/hal.c b/src/hal/hal.c index 3988a42..708a77a 100644 --- a/src/hal/hal.c +++ b/src/hal/hal.c @@ -41,7 +41,7 @@ #define STRINGIZE(s) STRINGIZE2(s) EXPORT -int pass_get_hw_info(const char *name, const struct pass_resource_info **info) +int pass_get_hal_info(const char *name, const struct pass_resource_info **info) { char path[PATH_MAX]; void *handle; @@ -64,7 +64,7 @@ int pass_get_hw_info(const char *name, const struct pass_resource_info **info) goto error; } - it = dlsym(handle, STRINGIZE(HARDWARE_INFO_SYM)); + it = dlsym(handle, STRINGIZE(HAL_INFO_SYM)); if (!it) { _E("fail to find symbol : %s", dlerror()); goto error; diff --git a/src/hal/hal.h b/src/hal/hal.h index b8651fa..de7883d 100644 --- a/src/hal/hal.h +++ b/src/hal/hal.h @@ -30,18 +30,18 @@ (((C) & 0xff) << 8) | (((D) & 0xff))) #define MAKE_TAG_CONSTANT(A,B,C,D) MAKE_4B_CODE_4(A,B,C,D) -#define HARDWARE_INFO_TAG MAKE_TAG_CONSTANT('T','H','I','T') +#define HAL_INFO_TAG MAKE_TAG_CONSTANT('T','H','I','T') #define MAKE_VERSION(maj,min) ((((maj) & 0xff) << 8) | ((min) & 0xff)) /* Version of the struct pass_hw_info */ -#define HARDWARE_INFO_VERSION MAKE_VERSION(0,1) +#define HAL_INFO_VERSION MAKE_VERSION(0,1) #define HARDWARE_INFO_VERSION_CPU MAKE_VERSION(0,1) #define HARDWARE_INFO_VERSION_BUS MAKE_VERSION(0,1) #define HARDWARE_INFO_VERSION_GPU MAKE_VERSION(0,1) -/* Name of the hardware info symbolic (Tizen Hardware Info) */ -#define HARDWARE_INFO_SYM TizenHwInfo +/* Name of the HAL info symbolic (Tizen Hardware Info) */ +#define HAL_INFO_SYM TizenHwInfo #define PASS_RESOURCE_UNKNOWN 0 #define PASS_RESOURCE_CPU_ID 1 @@ -61,7 +61,7 @@ struct pass_resource_common; /* * pass_resource_info - Define the information structure for the resource. * - * @magic : magic must be initialized to HARDWARE_INFO_TAG + * @magic : magic must be initialized to HAL_INFO_TAG * @hal_version : HAL version * @device_version: device version * @id : device id, can have the following value. @@ -177,18 +177,18 @@ struct pass_resource_gpu { struct pass_resource_tmu_ops tmu; }; -int pass_get_hw_info(const char *id, const struct pass_resource_info **info); +int pass_get_hal_info(const char *id, const struct pass_resource_info **info); /** - * Structure define of hardware info module + * Structure define of HAL info module * - * All hardware module should be use below define to make a specific + * All HAL module should be use below define to make a specific * structure for Tizen HAL. pass_get_resource_info function * will load a pass_resource_data structure by using TizenHwInfo name * at runtime. TizenHwInfo means Tizen Hardware Info. */ -#define HARDWARE_MODULE_STRUCTURE \ +#define HAL_MODULE_STRUCTURE \ __attribute__ ((visibility("default"))) \ - struct pass_resource_info HARDWARE_INFO_SYM + struct pass_resource_info HAL_INFO_SYM #endif /* _PASS_HAL_H_ */ diff --git a/src/pass/pass-hal.c b/src/pass/pass-hal.c index 88c1d9a..248ef80 100644 --- a/src/pass/pass-hal.c +++ b/src/pass/pass-hal.c @@ -33,13 +33,13 @@ static struct pass_resource_dvfs_ops *get_dvfs(struct pass_resource *res, int id switch (id) { case PASS_RESOURCE_CPU_ID: - dvfs = &(res->hw.cpu->dvfs); + dvfs = &(res->hal.cpu->dvfs); break; case PASS_RESOURCE_BUS_ID: - dvfs = &(res->hw.bus->dvfs); + dvfs = &(res->hal.bus->dvfs); break; case PASS_RESOURCE_GPU_ID: - dvfs = &(res->hw.gpu->dvfs); + dvfs = &(res->hal.gpu->dvfs); break; } @@ -52,13 +52,13 @@ static struct pass_resource_tmu_ops *get_tmu(struct pass_resource *res, int id) switch (id) { case PASS_RESOURCE_CPU_ID: - tmu = &(res->hw.cpu->tmu); + tmu = &(res->hal.cpu->tmu); break; case PASS_RESOURCE_BUS_ID: - tmu = &(res->hw.bus->tmu); + tmu = &(res->hal.bus->tmu); break; case PASS_RESOURCE_GPU_ID: - tmu = &(res->hw.gpu->tmu); + tmu = &(res->hal.gpu->tmu); break; } @@ -72,7 +72,7 @@ static struct pass_resource_hotplug_ops *get_hotplug(struct pass_resource *res, switch (id) { case PASS_RESOURCE_CPU_ID: - hotplug = &(res->hw.cpu->hotplug); + hotplug = &(res->hal.cpu->hotplug); break; case PASS_RESOURCE_BUS_ID: case PASS_RESOURCE_GPU_ID: @@ -407,10 +407,10 @@ int pass_get_resource(struct pass *pass) name[len] = '\0'; - ret = pass_get_hw_info(name, + ret = pass_get_hal_info(name, (const struct pass_resource_info **)&info); if (ret < 0) { - _E("Failed to get h/w info\n"); + _E("Failed to get hal info\n"); return -EINVAL; } @@ -422,15 +422,15 @@ int pass_get_resource(struct pass *pass) switch (res_type) { case PASS_RESOURCE_CPU_ID: ret = info->open(info, - (struct pass_resource_common**)&pass_res->hw.cpu); + (struct pass_resource_common**)&pass_res->hal.cpu); break; case PASS_RESOURCE_BUS_ID: ret = info->open(info, - (struct pass_resource_common**)&pass_res->hw.bus); + (struct pass_resource_common**)&pass_res->hal.bus); break; case PASS_RESOURCE_GPU_ID: ret = info->open(info, - (struct pass_resource_common**)&pass_res->hw.gpu); + (struct pass_resource_common**)&pass_res->hal.gpu); break; }; diff --git a/src/pass/pass.h b/src/pass/pass.h index a2f0eb3..331f566 100644 --- a/src/pass/pass.h +++ b/src/pass/pass.h @@ -270,10 +270,10 @@ struct pass_conf_data { * struct pass_resource - Represent the each h/w resource. * * @cdata: the parsed data from configuration file (pass.conf). - * @hw: the resource instance of each h/w resource from pass_get_hw_info(). - * - If res_type of cdata is PASS_RESOURCE_CPU_ID, hw.cpu will be used. - * - If res_type of cdata is PASS_RESOURCE_BUS_ID, hw.bus will be used. - * - If res_type of cdata is PASS_RESOURCE_GPU_ID, hw.gpu will be used. + * @hal: the hal instance of each h/w resource from pass_get_hal_info(). + * - If res_type of cdata is PASS_RESOURCE_CPU_ID, hal.cpu will be used. + * - If res_type of cdata is PASS_RESOURCE_BUS_ID, hal.bus will be used. + * - If res_type of cdata is PASS_RESOURCE_GPU_ID, hal.gpu will be used. * @policy: the policy data to handle the h/w resource */ struct pass_resource { @@ -284,7 +284,7 @@ struct pass_resource { struct pass_resource_cpu *cpu; struct pass_resource_bus *bus; struct pass_resource_gpu *gpu; - } hw; + } hal; }; struct pass { -- 2.7.4 From 045a70d2c7e203c3f5f036088217b9b5c3db64e0 Mon Sep 17 00:00:00 2001 From: Wook Song Date: Fri, 3 Feb 2017 08:27:41 +0900 Subject: [PATCH 02/16] hal: Change the symbolic name of the HAL info This patch changes the symbolic name of the HAL info from TizenHardwareInfo to PassHalInfo. Accordingly, HAL_INFO_TAG is also changed. Change-Id: I8fca63caff647655c8ab562227897a94976b61fd Signed-off-by: Wook Song --- src/hal/hal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hal/hal.h b/src/hal/hal.h index de7883d..9dd89c1 100644 --- a/src/hal/hal.h +++ b/src/hal/hal.h @@ -30,7 +30,7 @@ (((C) & 0xff) << 8) | (((D) & 0xff))) #define MAKE_TAG_CONSTANT(A,B,C,D) MAKE_4B_CODE_4(A,B,C,D) -#define HAL_INFO_TAG MAKE_TAG_CONSTANT('T','H','I','T') +#define HAL_INFO_TAG MAKE_TAG_CONSTANT('P','H','I','T') #define MAKE_VERSION(maj,min) ((((maj) & 0xff) << 8) | ((min) & 0xff)) /* Version of the struct pass_hw_info */ @@ -40,8 +40,8 @@ #define HARDWARE_INFO_VERSION_BUS MAKE_VERSION(0,1) #define HARDWARE_INFO_VERSION_GPU MAKE_VERSION(0,1) -/* Name of the HAL info symbolic (Tizen Hardware Info) */ -#define HAL_INFO_SYM TizenHwInfo +/* Symbolic name of the HAL info (PASS HAL Info) */ +#define HAL_INFO_SYM PassHalInfo #define PASS_RESOURCE_UNKNOWN 0 #define PASS_RESOURCE_CPU_ID 1 -- 2.7.4 From 7f831fc4f07c8060b68333e978bf1577784843a3 Mon Sep 17 00:00:00 2001 From: Wook Song Date: Fri, 3 Feb 2017 09:08:15 +0900 Subject: [PATCH 03/16] hal: Use proper header for dlog message display This patch changes the log header file used in hal to the proper ont for dlog message display. Change-Id: I8d20dad5e4447904f21c7a15911d358cb76baab7 Signed-off-by: Wook Song --- src/hal/hal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hal/hal.c b/src/hal/hal.c index 708a77a..7f8bee6 100644 --- a/src/hal/hal.c +++ b/src/hal/hal.c @@ -25,7 +25,7 @@ #include #include "hal.h" -#include "shared/log-macro.h" +#include "shared/log.h" #ifndef EXPORT #define EXPORT __attribute__ ((visibility("default"))) -- 2.7.4 From 13cb56d7ad33c4b60aa551179ee5eb59f50b107b Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Fri, 3 Feb 2017 09:51:16 +0900 Subject: [PATCH 04/16] pmqos: Add new scenario name for MessageScroll/SIOP/UltraPowerSaving This patch just adds the new scenario name as following: - MessageScroll - SIOP - UltraPowerSaving Change-Id: I7778fa6d50ce635e32fe0b996bd8fb6d3b160f0f Signed-off-by: Chanwoo Choi --- src/pmqos/pmqos.c | 3 +++ src/pmqos/pmqos.conf | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/pmqos/pmqos.c b/src/pmqos/pmqos.c index 2fed4a2..63ff6b6 100644 --- a/src/pmqos/pmqos.c +++ b/src/pmqos/pmqos.c @@ -409,6 +409,9 @@ static const struct edbus_method edbus_methods[] = { { "TizenStoreScroll", "i", "i", dbus_pmqos_handler }, { "CallLogScroll", "i", "i", dbus_pmqos_handler }, { "MyfilesScroll", "i", "i", dbus_pmqos_handler }, + { "MessageScroll", "i", "i", dbus_pmqos_handler }, + { "SIOP", "i", "i", dbus_pmqos_handler }, + { "UltraPowerSaving", "i", "i", dbus_pmqos_handler }, }; static int booting_done(void *data, void *user_data) diff --git a/src/pmqos/pmqos.conf b/src/pmqos/pmqos.conf index 788c3d1..ffeeb64 100644 --- a/src/pmqos/pmqos.conf +++ b/src/pmqos/pmqos.conf @@ -7,7 +7,7 @@ # set to "yes" scenario_support (Default value is no) # set scenario_num to be tested scenario_support=yes -scenario_num=49 +scenario_num=52 # describe the scenario section as follows #[Scenario0] @@ -208,3 +208,15 @@ support=yes [Scenario48] name=MyfilesScroll support=yes + +[Scenario49] +name=MessageScroll +support=yes + +[Scenario50] +name=SIOP +support=yes + +[Scenario51] +name=UltraPowerSaving +support=yes -- 2.7.4 From 588e83c67a0027ae212bc58fd557a5b512364d14 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Fri, 3 Feb 2017 10:36:23 +0900 Subject: [PATCH 05/16] pass: conf: Update the supported sceanio list for each resource This patch updates the all configuration files to add the supported scenaio and the following nine scenarios are supported. - AppLaunch - AppLaunchHome - BrowserJavaScript - EmailScroll - TizenStoreScroll - CallLogScroll - MyfilesScroll - MessageScroll Change-Id: I19c72a6607b725d86e6390f790bdbe0cdec575e7 Signed-off-by: Chanwoo Choi --- src/pass/pass-cluster0.conf | 175 ++++++++++++++++++++++++++++++++++++------- src/pass/pass-cluster1.conf | 179 ++++++++++++++++++++++++++++++++++++-------- src/pass/pass-cluster2.conf | 175 ++++++++++++++++++++++++++++++++++++------- src/pass/pass-cluster3.conf | 175 ++++++++++++++++++++++++++++++++++++------- src/pass/pass-cluster4.conf | 179 ++++++++++++++++++++++++++++++++++++-------- 5 files changed, 734 insertions(+), 149 deletions(-) diff --git a/src/pass/pass-cluster0.conf b/src/pass/pass-cluster0.conf index f4276e4..f77a751 100644 --- a/src/pass/pass-cluster0.conf +++ b/src/pass/pass-cluster0.conf @@ -174,7 +174,7 @@ num_right_cond=0 ############################ [PassScenario] pass_scenario_support=yes -pass_num_scenarios=28 +pass_num_scenarios=52 [Scenario0] name=AppLaunch @@ -184,109 +184,226 @@ min_level=9 max_level=11 [Scenario1] -name=MtpSendFile -support=no +name=AppLaunchHome +support=yes + +min_level=9 +max_level=11 [Scenario2] -name=PowerSaving +name=BeautyShot support=no [Scenario3] -name=LowBattery +name=Browser support=no [Scenario4] -name=Emergency +name=BrowserDash support=no [Scenario5] -name=CameraPreview -support=no +name=BrowserJavaScript +support=yes + +min_level=9 +max_level=11 [Scenario6] -name=CameraBurstShot +name=BrowserLoading support=no [Scenario7] -name=CameraCaptureAtRec +name=BrowserScroll support=no [Scenario8] -name=Browser +name=CallSound support=no [Scenario9] -name=BrowserDash +name=CameraBurstShot support=no [Scenario10] -name=BrowserJavaScript +name=CameraCaptureAtRec support=no [Scenario11] -name=BrowserLoading +name=CameraPreview support=no [Scenario12] -name=BrowserScroll +name=CameraSoundAndShot support=no [Scenario13] -name=GpuWakeup +name=ContactSearch support=no [Scenario14] -name=WifiThroughput +name=Emergency support=no [Scenario15] -name=SmemoZoom +name=GalleryScroll support=no [Scenario16] -name=IMEInput +name=GalleryRotation support=no [Scenario17] -name=CallSound +name=GetDefaultLockTime support=no [Scenario18] -name=LockScreen +name=GpsSerialCno support=no [Scenario19] -name=GalleryRotation +name=GpuBoost support=no [Scenario20] -name=ReservedMode +name=GpuWakeup support=no [Scenario21] -name=GetDefaultLockTime +name=HomeScreen support=no [Scenario22] -name=GpuBoost +name=ImageViewer support=no [Scenario23] -name=WebappLaunch +name=IMEInput support=no [Scenario24] -name=ImageViewer +name=LockScreen support=no [Scenario25] -name=PowerOff +name=LowBattery support=no [Scenario26] -name=ProcessCrashed +name=MtpSendFile support=no [Scenario27] +name=MusicPlayLcdOn +support=no + +[Scenario28] +name=PowerSaving +support=no + +[Scenario29] +name=ProcessCrashed +support=no + +[Scenario30] +name=ReservedMode +support=no + +[Scenario31] +name=ScreenMirroring +support=no + +[Scenario32] +name=SmemoZoom +support=no + +[Scenario33] name=SVoice support=no + +[Scenario34] +name=WebappLaunch +support=no + +[Scenario35] +name=WifiThroughput +support=no + +[Scenario36] +name=PowerOff +support=no + +[Scenario37] +name=WebAppDrag +support=no + +[Scenario38] +name=WebAppFlick +support=no + +[Scenario39] +name=SensorWakeup +support=no + +[Scenario40] +name=UgLaunch +support=no + +[Scenario41] +name=MusicScroll +support=no + +[Scenario42] +name=FileScroll +support=no + +[Scenario43] +name=VideoScroll +support=no + +[Scenario44] +name=EmailScroll +support=yes + +min_level=9 +max_level=11 + +[Scenario45] +name=ContactScroll +support=no + +[Scenario46] +name=TizenStoreScroll +support=yes + +min_level=9 +max_level=11 + +[Scenario47] +name=CallLogScroll +support=yes + +min_level=9 +max_level=11 + +[Scenario48] +name=MyfilesScroll +support=yes + +min_level=9 +max_level=11 + +[Scenario49] +name=MessageScroll +support=yes + +min_level=9 +max_level=11 + +[Scenario50] +name=SIOP +support=no + +[Scenario51] +name=UltraPowerSaving +support=no diff --git a/src/pass/pass-cluster1.conf b/src/pass/pass-cluster1.conf index f9213e4..bf7a7c3 100644 --- a/src/pass/pass-cluster1.conf +++ b/src/pass/pass-cluster1.conf @@ -274,119 +274,236 @@ num_right_cond=0 ############################ [PassScenario] pass_scenario_support=yes -pass_num_scenarios=28 +pass_num_scenarios=52 [Scenario0] name=AppLaunch support=yes -min_level=9 -max_level=11 +min_level=13 +max_level=15 [Scenario1] -name=MtpSendFile -support=no +name=AppLaunchHome +support=yes + +min_level=13 +max_level=15 [Scenario2] -name=PowerSaving +name=BeautyShot support=no [Scenario3] -name=LowBattery +name=Browser support=no [Scenario4] -name=Emergency +name=BrowserDash support=no [Scenario5] -name=CameraPreview -support=no +name=BrowserJavaScript +support=yes + +min_level=13 +max_level=15 [Scenario6] -name=CameraBurstShot +name=BrowserLoading support=no [Scenario7] -name=CameraCaptureAtRec +name=BrowserScroll support=no [Scenario8] -name=Browser +name=CallSound support=no [Scenario9] -name=BrowserDash +name=CameraBurstShot support=no [Scenario10] -name=BrowserJavaScript +name=CameraCaptureAtRec support=no [Scenario11] -name=BrowserLoading +name=CameraPreview support=no [Scenario12] -name=BrowserScroll +name=CameraSoundAndShot support=no [Scenario13] -name=GpuWakeup +name=ContactSearch support=no [Scenario14] -name=WifiThroughput +name=Emergency support=no [Scenario15] -name=SmemoZoom +name=GalleryScroll support=no [Scenario16] -name=IMEInput +name=GalleryRotation support=no [Scenario17] -name=CallSound +name=GetDefaultLockTime support=no [Scenario18] -name=LockScreen +name=GpsSerialCno support=no [Scenario19] -name=GalleryRotation +name=GpuBoost support=no [Scenario20] -name=ReservedMode +name=GpuWakeup support=no [Scenario21] -name=GetDefaultLockTime +name=HomeScreen support=no [Scenario22] -name=GpuBoost +name=ImageViewer support=no [Scenario23] -name=WebappLaunch +name=IMEInput support=no [Scenario24] -name=ImageViewer +name=LockScreen support=no [Scenario25] -name=PowerOff +name=LowBattery support=no [Scenario26] -name=ProcessCrashed +name=MtpSendFile support=no [Scenario27] +name=MusicPlayLcdOn +support=no + +[Scenario28] +name=PowerSaving +support=no + +[Scenario29] +name=ProcessCrashed +support=no + +[Scenario30] +name=ReservedMode +support=no + +[Scenario31] +name=ScreenMirroring +support=no + +[Scenario32] +name=SmemoZoom +support=no + +[Scenario33] name=SVoice support=no + +[Scenario34] +name=WebappLaunch +support=no + +[Scenario35] +name=WifiThroughput +support=no + +[Scenario36] +name=PowerOff +support=no + +[Scenario37] +name=WebAppDrag +support=no + +[Scenario38] +name=WebAppFlick +support=no + +[Scenario39] +name=SensorWakeup +support=no + +[Scenario40] +name=UgLaunch +support=no + +[Scenario41] +name=MusicScroll +support=no + +[Scenario42] +name=FileScroll +support=no + +[Scenario43] +name=VideoScroll +support=no + +[Scenario44] +name=EmailScroll +support=yes + +min_level=13 +max_level=15 + +[Scenario45] +name=ContactScroll +support=no + +[Scenario46] +name=TizenStoreScroll +support=yes + +min_level=13 +max_level=15 + +[Scenario47] +name=CallLogScroll +support=yes + +min_level=13 +max_level=15 + +[Scenario48] +name=MyfilesScroll +support=yes + +min_level=13 +max_level=15 + +[Scenario49] +name=MessageScroll +support=yes + +min_level=13 +max_level=15 + +[Scenario50] +name=SIOP +support=no + +[Scenario51] +name=UltraPowerSaving +support=no diff --git a/src/pass/pass-cluster2.conf b/src/pass/pass-cluster2.conf index 25d4454..47e42ae 100644 --- a/src/pass/pass-cluster2.conf +++ b/src/pass/pass-cluster2.conf @@ -25,7 +25,7 @@ limit_min_freq=400000000 ############################ [PassScenario] pass_scenario_support=yes -pass_num_scenarios=28 +pass_num_scenarios=52 [Scenario0] name=AppLaunch @@ -35,109 +35,226 @@ min_level=3 max_level=3 [Scenario1] -name=MtpSendFile -support=no +name=AppLaunchHome +support=yes + +min_level=3 +max_level=3 [Scenario2] -name=PowerSaving +name=BeautyShot support=no [Scenario3] -name=LowBattery +name=Browser support=no [Scenario4] -name=Emergency +name=BrowserDash support=no [Scenario5] -name=CameraPreview -support=no +name=BrowserJavaScript +support=yes + +min_level=3 +max_level=3 [Scenario6] -name=CameraBurstShot +name=BrowserLoading support=no [Scenario7] -name=CameraCaptureAtRec +name=BrowserScroll support=no [Scenario8] -name=Browser +name=CallSound support=no [Scenario9] -name=BrowserDash +name=CameraBurstShot support=no [Scenario10] -name=BrowserJavaScript +name=CameraCaptureAtRec support=no [Scenario11] -name=BrowserLoading +name=CameraPreview support=no [Scenario12] -name=BrowserScroll +name=CameraSoundAndShot support=no [Scenario13] -name=GpuWakeup +name=ContactSearch support=no [Scenario14] -name=WifiThroughput +name=Emergency support=no [Scenario15] -name=SmemoZoom +name=GalleryScroll support=no [Scenario16] -name=IMEInput +name=GalleryRotation support=no [Scenario17] -name=CallSound +name=GetDefaultLockTime support=no [Scenario18] -name=LockScreen +name=GpsSerialCno support=no [Scenario19] -name=GalleryRotation +name=GpuBoost support=no [Scenario20] -name=ReservedMode +name=GpuWakeup support=no [Scenario21] -name=GetDefaultLockTime +name=HomeScreen support=no [Scenario22] -name=GpuBoost +name=ImageViewer support=no [Scenario23] -name=WebappLaunch +name=IMEInput support=no [Scenario24] -name=ImageViewer +name=LockScreen support=no [Scenario25] -name=PowerOff +name=LowBattery support=no [Scenario26] -name=ProcessCrashed +name=MtpSendFile support=no [Scenario27] +name=MusicPlayLcdOn +support=no + +[Scenario28] +name=PowerSaving +support=no + +[Scenario29] +name=ProcessCrashed +support=no + +[Scenario30] +name=ReservedMode +support=no + +[Scenario31] +name=ScreenMirroring +support=no + +[Scenario32] +name=SmemoZoom +support=no + +[Scenario33] name=SVoice support=no + +[Scenario34] +name=WebappLaunch +support=no + +[Scenario35] +name=WifiThroughput +support=no + +[Scenario36] +name=PowerOff +support=no + +[Scenario37] +name=WebAppDrag +support=no + +[Scenario38] +name=WebAppFlick +support=no + +[Scenario39] +name=SensorWakeup +support=no + +[Scenario40] +name=UgLaunch +support=no + +[Scenario41] +name=MusicScroll +support=no + +[Scenario42] +name=FileScroll +support=no + +[Scenario43] +name=VideoScroll +support=no + +[Scenario44] +name=EmailScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario45] +name=ContactScroll +support=no + +[Scenario46] +name=TizenStoreScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario47] +name=CallLogScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario48] +name=MyfilesScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario49] +name=MessageScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario50] +name=SIOP +support=no + +[Scenario51] +name=UltraPowerSaving +support=no diff --git a/src/pass/pass-cluster3.conf b/src/pass/pass-cluster3.conf index ae09cc0..543fe24 100644 --- a/src/pass/pass-cluster3.conf +++ b/src/pass/pass-cluster3.conf @@ -28,7 +28,7 @@ limit_min_freq=825000000 ############################ [PassScenario] pass_scenario_support=yes -pass_num_scenarios=28 +pass_num_scenarios=52 [Scenario0] name=AppLaunch @@ -38,109 +38,226 @@ min_level=4 max_level=4 [Scenario1] -name=MtpSendFile -support=no +name=AppLaunchHome +support=yes + +min_level=4 +max_level=4 [Scenario2] -name=PowerSaving +name=BeautyShot support=no [Scenario3] -name=LowBattery +name=Browser support=no [Scenario4] -name=Emergency +name=BrowserDash support=no [Scenario5] -name=CameraPreview -support=no +name=BrowserJavaScript +support=yes + +min_level=4 +max_level=4 [Scenario6] -name=CameraBurstShot +name=BrowserLoading support=no [Scenario7] -name=CameraCaptureAtRec +name=BrowserScroll support=no [Scenario8] -name=Browser +name=CallSound support=no [Scenario9] -name=BrowserDash +name=CameraBurstShot support=no [Scenario10] -name=BrowserJavaScript +name=CameraCaptureAtRec support=no [Scenario11] -name=BrowserLoading +name=CameraPreview support=no [Scenario12] -name=BrowserScroll +name=CameraSoundAndShot support=no [Scenario13] -name=GpuWakeup +name=ContactSearch support=no [Scenario14] -name=WifiThroughput +name=Emergency support=no [Scenario15] -name=SmemoZoom +name=GalleryScroll support=no [Scenario16] -name=IMEInput +name=GalleryRotation support=no [Scenario17] -name=CallSound +name=GetDefaultLockTime support=no [Scenario18] -name=LockScreen +name=GpsSerialCno support=no [Scenario19] -name=GalleryRotation +name=GpuBoost support=no [Scenario20] -name=ReservedMode +name=GpuWakeup support=no [Scenario21] -name=GetDefaultLockTime +name=HomeScreen support=no [Scenario22] -name=GpuBoost +name=ImageViewer support=no [Scenario23] -name=WebappLaunch +name=IMEInput support=no [Scenario24] -name=ImageViewer +name=LockScreen support=no [Scenario25] -name=PowerOff +name=LowBattery support=no [Scenario26] -name=ProcessCrashed +name=MtpSendFile support=no [Scenario27] +name=MusicPlayLcdOn +support=no + +[Scenario28] +name=PowerSaving +support=no + +[Scenario29] +name=ProcessCrashed +support=no + +[Scenario30] +name=ReservedMode +support=no + +[Scenario31] +name=ScreenMirroring +support=no + +[Scenario32] +name=SmemoZoom +support=no + +[Scenario33] name=SVoice support=no + +[Scenario34] +name=WebappLaunch +support=no + +[Scenario35] +name=WifiThroughput +support=no + +[Scenario36] +name=PowerOff +support=no + +[Scenario37] +name=WebAppDrag +support=no + +[Scenario38] +name=WebAppFlick +support=no + +[Scenario39] +name=SensorWakeup +support=no + +[Scenario40] +name=UgLaunch +support=no + +[Scenario41] +name=MusicScroll +support=no + +[Scenario42] +name=FileScroll +support=no + +[Scenario43] +name=VideoScroll +support=no + +[Scenario44] +name=EmailScroll +support=yes + +min_level=4 +max_level=4 + +[Scenario45] +name=ContactScroll +support=no + +[Scenario46] +name=TizenStoreScroll +support=yes + +min_level=4 +max_level=4 + +[Scenario47] +name=CallLogScroll +support=yes + +min_level=4 +max_level=4 + +[Scenario48] +name=MyfilesScroll +support=yes + +min_level=4 +max_level=4 + +[Scenario49] +name=MessageScroll +support=yes + +min_level=4 +max_level=4 + +[Scenario50] +name=SIOP +support=no + +[Scenario51] +name=UltraPowerSaving +support=no diff --git a/src/pass/pass-cluster4.conf b/src/pass/pass-cluster4.conf index 91d8aae..31855d1 100644 --- a/src/pass/pass-cluster4.conf +++ b/src/pass/pass-cluster4.conf @@ -28,119 +28,236 @@ limit_min_freq=700000000 ############################ [PassScenario] pass_scenario_support=yes -pass_num_scenarios=28 +pass_num_scenarios=52 [Scenario0] name=AppLaunch support=yes -min_level=4 -max_level=4 +min_level=3 +max_level=3 [Scenario1] -name=MtpSendFile -support=no +name=AppLaunchHome +support=yes + +min_level=3 +max_level=3 [Scenario2] -name=PowerSaving +name=BeautyShot support=no [Scenario3] -name=LowBattery +name=Browser support=no [Scenario4] -name=Emergency +name=BrowserDash support=no [Scenario5] -name=CameraPreview -support=no +name=BrowserJavaScript +support=yes + +min_level=3 +max_level=3 [Scenario6] -name=CameraBurstShot +name=BrowserLoading support=no [Scenario7] -name=CameraCaptureAtRec +name=BrowserScroll support=no [Scenario8] -name=Browser +name=CallSound support=no [Scenario9] -name=BrowserDash +name=CameraBurstShot support=no [Scenario10] -name=BrowserJavaScript +name=CameraCaptureAtRec support=no [Scenario11] -name=BrowserLoading +name=CameraPreview support=no [Scenario12] -name=BrowserScroll +name=CameraSoundAndShot support=no [Scenario13] -name=GpuWakeup +name=ContactSearch support=no [Scenario14] -name=WifiThroughput +name=Emergency support=no [Scenario15] -name=SmemoZoom +name=GalleryScroll support=no [Scenario16] -name=IMEInput +name=GalleryRotation support=no [Scenario17] -name=CallSound +name=GetDefaultLockTime support=no [Scenario18] -name=LockScreen +name=GpsSerialCno support=no [Scenario19] -name=GalleryRotation +name=GpuBoost support=no [Scenario20] -name=ReservedMode +name=GpuWakeup support=no [Scenario21] -name=GetDefaultLockTime +name=HomeScreen support=no [Scenario22] -name=GpuBoost +name=ImageViewer support=no [Scenario23] -name=WebappLaunch +name=IMEInput support=no [Scenario24] -name=ImageViewer +name=LockScreen support=no [Scenario25] -name=PowerOff +name=LowBattery support=no [Scenario26] -name=ProcessCrashed +name=MtpSendFile support=no [Scenario27] +name=MusicPlayLcdOn +support=no + +[Scenario28] +name=PowerSaving +support=no + +[Scenario29] +name=ProcessCrashed +support=no + +[Scenario30] +name=ReservedMode +support=no + +[Scenario31] +name=ScreenMirroring +support=no + +[Scenario32] +name=SmemoZoom +support=no + +[Scenario33] name=SVoice support=no + +[Scenario34] +name=WebappLaunch +support=no + +[Scenario35] +name=WifiThroughput +support=no + +[Scenario36] +name=PowerOff +support=no + +[Scenario37] +name=WebAppDrag +support=no + +[Scenario38] +name=WebAppFlick +support=no + +[Scenario39] +name=SensorWakeup +support=no + +[Scenario40] +name=UgLaunch +support=no + +[Scenario41] +name=MusicScroll +support=no + +[Scenario42] +name=FileScroll +support=no + +[Scenario43] +name=VideoScroll +support=no + +[Scenario44] +name=EmailScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario45] +name=ContactScroll +support=no + +[Scenario46] +name=TizenStoreScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario47] +name=CallLogScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario48] +name=MyfilesScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario49] +name=MessageScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario50] +name=SIOP +support=no + +[Scenario51] +name=UltraPowerSaving +support=no -- 2.7.4 From db2c7c307786894095c0cc2189db9d60201380f8 Mon Sep 17 00:00:00 2001 From: Wook Song Date: Fri, 3 Feb 2017 12:42:49 +0900 Subject: [PATCH 06/16] core: Remove duplicate log header file This patch removes the duplicate log header file in the core directory. From now, the only log header is the file in the shared directory. Change-Id: I94d6cae273a7a123c3d65c503d6703d146322f51 Signed-off-by: Wook Song --- src/core/boot.c | 2 +- src/core/common.c | 3 ++- src/core/config-parser.c | 4 +++- src/core/device-idler.c | 2 +- src/core/device-notifier.c | 2 +- src/core/devices.c | 3 ++- src/core/edbus-handler.c | 2 +- src/core/execute.c | 2 +- src/core/log.c | 3 ++- src/core/log.h | 33 --------------------------------- src/core/main.c | 9 +++++---- src/core/sig-handler.c | 5 +++-- src/core/udev.c | 7 ++++--- src/pass/pass.h | 3 ++- src/pmqos/pmqos-parser.c | 5 +++-- src/pmqos/pmqos.c | 3 ++- src/shared/pass-systemd.c | 4 ++-- 17 files changed, 35 insertions(+), 57 deletions(-) delete mode 100644 src/core/log.h diff --git a/src/core/boot.c b/src/core/boot.c index 97c2458..d36a3e8 100644 --- a/src/core/boot.c +++ b/src/core/boot.c @@ -21,11 +21,11 @@ #include #include -#include "core/log.h" #include "core/device-notifier.h" #include "core/common.h" #include "core/edbus-handler.h" #include "shared/pass-systemd.h" +#include "shared/log.h" #define SIGNAL_BOOTING_DONE "BootingDone" diff --git a/src/core/common.c b/src/core/common.c index 3d22461..0dfc10f 100644 --- a/src/core/common.c +++ b/src/core/common.c @@ -34,7 +34,8 @@ #include #include -#include "log.h" +#include "shared/log.h" + #include "common.h" #define BUFF_MAX 255 diff --git a/src/core/config-parser.c b/src/core/config-parser.c index 880d358..fe0df23 100644 --- a/src/core/config-parser.c +++ b/src/core/config-parser.c @@ -19,7 +19,9 @@ #include #include #include -#include "log.h" + +#include "shared/log.h" + #include "config-parser.h" #define MAX_LINE 128 diff --git a/src/core/device-idler.c b/src/core/device-idler.c index 79582a8..edca042 100644 --- a/src/core/device-idler.c +++ b/src/core/device-idler.c @@ -21,7 +21,7 @@ #include #include -#include "log.h" +#include "shared/log.h" struct device_request { void (*func)(void *data); diff --git a/src/core/device-notifier.c b/src/core/device-notifier.c index dd88ffe..1195d0c 100644 --- a/src/core/device-notifier.c +++ b/src/core/device-notifier.c @@ -16,8 +16,8 @@ * limitations under the License. */ +#include "shared/log.h" -#include "log.h" #include "device-notifier.h" #include "list.h" #include "common.h" diff --git a/src/core/devices.c b/src/core/devices.c index 1fce02c..dbfc475 100644 --- a/src/core/devices.c +++ b/src/core/devices.c @@ -19,7 +19,8 @@ #include -#include "log.h" +#include "shared/log.h" + #include "list.h" #include "common.h" #include "devices.h" diff --git a/src/core/edbus-handler.c b/src/core/edbus-handler.c index 6d06faa..bcec02a 100644 --- a/src/core/edbus-handler.c +++ b/src/core/edbus-handler.c @@ -19,12 +19,12 @@ #include -#include "core/log.h" #include "core/edbus-handler.h" #include "core/common.h" #include "core/device-idler.h" #include "core/device-notifier.h" #include "core/list.h" +#include "shared/log.h" #define EDBUS_INIT_RETRY_COUNT 5 #define NAME_OWNER_CHANGED "NameOwnerChanged" diff --git a/src/core/execute.c b/src/core/execute.c index 224ea58..ddfba23 100755 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -26,7 +26,7 @@ #include #include -#include "log.h" +#include "shared/log.h" static int parent(pid_t pid) { diff --git a/src/core/log.c b/src/core/log.c index 2a91d05..866619d 100644 --- a/src/core/log.c +++ b/src/core/log.c @@ -17,7 +17,8 @@ */ #include -#include "log.h" + +#include "shared/log.h" #ifdef DEBUG void __cyg_profile_func_enter(void *, void *) diff --git a/src/core/log.h b/src/core/log.h deleted file mode 100644 index 74b866a..0000000 --- a/src/core/log.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * PASS - * - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef __LOG_H__ -#define __LOG_H__ - -#ifdef ENABLE_PASS_DLOG -#define ENABLE_DLOG -#endif - -#ifdef LOG_TAG -#undef LOG_TAG -#endif - -#define LOG_TAG "PASS" -#include "shared/log-macro.h" -#endif diff --git a/src/core/main.c b/src/core/main.c index 78e9680..233ef0e 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -21,13 +21,14 @@ #include #include -#include "log.h" -#include "common.h" -#include "edbus-handler.h" -#include "devices.h" #include "shared/dbus.h" +#include "shared/log.h" + #include "boot.h" +#include "common.h" #include "device-notifier.h" +#include "devices.h" +#include "edbus-handler.h" #define PIDFILE_PATH "/var/run/.pass.pid" diff --git a/src/core/sig-handler.c b/src/core/sig-handler.c index 9d31cc2..1b51787 100644 --- a/src/core/sig-handler.c +++ b/src/core/sig-handler.c @@ -21,9 +21,10 @@ #include #include -#include "log.h" -#include "devices.h" +#include "shared/log.h" + #include "common.h" +#include "devices.h" static struct sigaction sig_child_old_act; static struct sigaction sig_pipe_old_act; diff --git a/src/core/udev.c b/src/core/udev.c index 262e12f..39e49d9 100644 --- a/src/core/udev.c +++ b/src/core/udev.c @@ -21,12 +21,13 @@ #include #include -#include "log.h" +#include "shared/log.h" + #include "device-notifier.h" #include "devices.h" -#include "udev.h" -#include "list.h" #include "edbus-handler.h" +#include "list.h" +#include "udev.h" #define KERNEL "kernel" #define UDEV "udev" diff --git a/src/pass/pass.h b/src/pass/pass.h index 331f566..80b5497 100644 --- a/src/pass/pass.h +++ b/src/pass/pass.h @@ -22,7 +22,8 @@ #include #include -#include "core/log.h" + +#include "shared/log.h" /****************************************************** * PASS Governors * diff --git a/src/pmqos/pmqos-parser.c b/src/pmqos/pmqos-parser.c index 10302c5..1814e84 100644 --- a/src/pmqos/pmqos-parser.c +++ b/src/pmqos/pmqos-parser.c @@ -23,9 +23,10 @@ #include #include -#include "core/log.h" -#include "core/edbus-handler.h" #include "core/config-parser.h" +#include "core/edbus-handler.h" +#include "shared/log.h" + #include "pmqos.h" static bool is_supported(const char *value) diff --git a/src/pmqos/pmqos.c b/src/pmqos/pmqos.c index 63ff6b6..dff3894 100644 --- a/src/pmqos/pmqos.c +++ b/src/pmqos/pmqos.c @@ -23,12 +23,13 @@ #include #include -#include "core/log.h" #include "core/edbus-handler.h" #include "core/devices.h" #include "core/common.h" #include "core/list.h" #include "core/device-notifier.h" +#include "shared/log.h" + #include "pmqos.h" #define DEFAULT_PMQOS_TIMER 3000 diff --git a/src/shared/pass-systemd.c b/src/shared/pass-systemd.c index e7f5f6f..d418da2 100644 --- a/src/shared/pass-systemd.c +++ b/src/shared/pass-systemd.c @@ -26,12 +26,12 @@ #include #include +#include "shared/log.h" + #include "common.h" #include "dbus.h" #include "pass-systemd.h" -#include "core/log.h" - #define SYSTEMD_UNIT_ESCAPE_CHAR ".-" -- 2.7.4 From 50c50ebef7e333e80cbe8d6e17caf5a0b5d19256 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Mon, 6 Feb 2017 08:47:13 +0900 Subject: [PATCH 07/16] shared: Unify the separate log.h to remove the duplicate header file This patch unifies the separate log.h header file and remove the duplicate the log header file. Change-Id: Id61e07a7a244070e1c139ce007c8a8118137321a Signed-off-by: Chanwoo Choi --- src/shared/log-macro.h | 51 -------------------------------------------------- src/shared/log.h | 16 ++++++++++------ 2 files changed, 10 insertions(+), 57 deletions(-) delete mode 100644 src/shared/log-macro.h diff --git a/src/shared/log-macro.h b/src/shared/log-macro.h deleted file mode 100644 index ab42821..0000000 --- a/src/shared/log-macro.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * PASS (Power Aware System Service) - * - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef __LOG_MACRO_H__ -#define __LOG_MACRO_H__ - -#ifdef ENABLE_DLOG -#include -#define _D(fmt, arg...) \ - do { SLOGD(fmt, ##arg); } while(0) -#define _I(fmt, arg...) \ - do { SLOGI(fmt, ##arg); } while(0) -#define _W(fmt, arg...) \ - do { SLOGW(fmt, ##arg); } while(0) -#define _E(fmt, arg...) \ - do { SLOGE(fmt, ##arg); } while(0) -#define _SD(fmt, arg...) \ - do { SECURE_SLOGD(fmt, ##arg); } while(0) -#define _SI(fmt, arg...) \ - do { SECURE_SLOGI(fmt, ##arg); } while(0) -#define _SW(fmt, arg...) \ - do { SECURE_SLOGW(fmt, ##arg); } while(0) -#define _SE(fmt, arg...) \ - do { SECURE_SLOGE(fmt, ##arg); } while(0) -#else -#define _D(...) do { } while (0) -#define _I(...) do { } while (0) -#define _W(...) do { } while (0) -#define _E(...) do { } while (0) -#define _SD(...) do { } while (0) -#define _SI(...) do { } while (0) -#define _SW(...) do { } while (0) -#define _SE(...) do { } while (0) -#endif -#endif diff --git a/src/shared/log.h b/src/shared/log.h index 5850d15..636be78 100644 --- a/src/shared/log.h +++ b/src/shared/log.h @@ -16,15 +16,19 @@ * limitations under the License. */ - #ifndef __LOG_H__ #define __LOG_H__ -#ifdef ENABLE_LIBPASS_DLOG -#define ENABLE_DLOG -#endif - +#include #define LOG_TAG "PASS" -#include "shared/log-macro.h" + +#define _D(fmt, arg...) do { SLOGD(fmt, ##arg); } while(0) +#define _I(fmt, arg...) do { SLOGI(fmt, ##arg); } while(0) +#define _W(fmt, arg...) do { SLOGW(fmt, ##arg); } while(0) +#define _E(fmt, arg...) do { SLOGE(fmt, ##arg); } while(0) +#define _SD(fmt, arg...) do { SECURE_SLOGD(fmt, ##arg); } while(0) +#define _SI(fmt, arg...) do { SECURE_SLOGI(fmt, ##arg); } while(0) +#define _SW(fmt, arg...) do { SECURE_SLOGW(fmt, ##arg); } while(0) +#define _SE(fmt, arg...) do { SECURE_SLOGE(fmt, ##arg); } while(0) #endif -- 2.7.4 From 3744be83404bddf045e270980c02fac7773e92db Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Sat, 4 Feb 2017 19:48:11 +0900 Subject: [PATCH 08/16] pass: parser: Change 'limit_max_cpu' name to 'limit_min_cpu' The PASS uses the 'limit_max_cpu' as the minimum number of online cpu. This name is not matched with the meaning of 'limit_max_cpu'. So, this patch changes the name of 'limit_max_cpu' to 'limit_min_cpu' to improve the readability of property in configuration files. Change-Id: I35650f622ecf482606cdbbdf6c7c365582bace15 Signed-off-by: Chanwoo Choi --- src/pass/pass-cluster0.conf | 24 ++++++++++++------------ src/pass/pass-cluster1.conf | 40 ++++++++++++++++++++-------------------- src/pass/pass-gov.c | 22 +++++++++++----------- src/pass/pass-micro.conf | 12 ++++++------ src/pass/pass-parser.c | 10 +++++----- src/pass/pass.c | 4 ++-- src/pass/pass.h | 2 +- 7 files changed, 57 insertions(+), 57 deletions(-) diff --git a/src/pass/pass-cluster0.conf b/src/pass/pass-cluster0.conf index f77a751..98a73d6 100644 --- a/src/pass/pass-cluster0.conf +++ b/src/pass/pass-cluster0.conf @@ -19,7 +19,7 @@ pass_governor_timeout=0.4 [Level0] limit_max_freq=1000000 -limit_max_cpu=1 +limit_min_cpu=1 num_down_cond=0 num_up_cond=1 num_up_cond_freq=800000 @@ -30,7 +30,7 @@ num_right_cond_busy_cpu=1 [Level1] limit_max_freq=1000000 -limit_max_cpu=2 +limit_min_cpu=2 num_down_cond=0 num_up_cond=1 num_up_cond_freq=800000 @@ -43,7 +43,7 @@ num_right_cond_busy_cpu=2 [Level2] limit_max_freq=1000000 -limit_max_cpu=3 +limit_min_cpu=3 num_down_cond=0 num_up_cond=1 num_up_cond_freq=800000 @@ -56,7 +56,7 @@ num_right_cond_busy_cpu=3 [Level3] limit_max_freq=1000000 -limit_max_cpu=4 +limit_min_cpu=4 num_down_cond=0 num_up_cond=1 num_up_cond_freq=800000 @@ -67,7 +67,7 @@ num_right_cond=0 [Level4] limit_max_freq=1200000 -limit_max_cpu=1 +limit_min_cpu=1 num_down_cond=1 num_down_cond_freq=1000000 num_up_cond=1 @@ -79,7 +79,7 @@ num_right_cond_busy_cpu=1 [Level5] limit_max_freq=1200000 -limit_max_cpu=2 +limit_min_cpu=2 num_down_cond=1 num_down_cond_freq=1000000 num_up_cond=1 @@ -93,7 +93,7 @@ num_right_cond_busy_cpu=2 [Level6] limit_max_freq=1200000 -limit_max_cpu=3 +limit_min_cpu=3 num_down_cond=1 num_down_cond_freq=1000000 num_up_cond=1 @@ -107,7 +107,7 @@ num_right_cond_busy_cpu=3 [Level7] limit_max_freq=1200000 -limit_max_cpu=4 +limit_min_cpu=4 num_down_cond=1 num_down_cond_freq=1000000 num_up_cond=1 @@ -119,7 +119,7 @@ num_right_cond=0 [Level8] limit_max_freq=1300000 -limit_max_cpu=1 +limit_min_cpu=1 num_down_cond=1 num_down_cond_freq=1200000 num_up_cond=1 @@ -131,7 +131,7 @@ num_right_cond_busy_cpu=1 [Level9] limit_max_freq=1300000 -limit_max_cpu=2 +limit_min_cpu=2 num_down_cond=1 num_down_cond_freq=1200000 num_up_cond=1 @@ -145,7 +145,7 @@ num_right_cond_busy_cpu=2 [Level10] limit_max_freq=1300000 -limit_max_cpu=3 +limit_min_cpu=3 num_down_cond=1 num_down_cond_freq=1200000 num_up_cond=1 @@ -159,7 +159,7 @@ num_right_cond_busy_cpu=3 [Level11] limit_max_freq=1300000 -limit_max_cpu=4 +limit_min_cpu=4 num_down_cond=1 num_down_cond_freq=1200000 num_up_cond=1 diff --git a/src/pass/pass-cluster1.conf b/src/pass/pass-cluster1.conf index bf7a7c3..9f65eee 100644 --- a/src/pass/pass-cluster1.conf +++ b/src/pass/pass-cluster1.conf @@ -19,7 +19,7 @@ pass_governor_timeout=0.4 [Level0] limit_max_freq=1000000 -limit_max_cpu=1 +limit_min_cpu=1 num_down_cond=0 num_up_cond=1 num_up_cond_freq=1000000 @@ -30,7 +30,7 @@ num_right_cond_busy_cpu=1 [Level1] limit_max_freq=1000000 -limit_max_cpu=2 +limit_min_cpu=2 num_down_cond=0 num_up_cond=1 num_up_cond_freq=1000000 @@ -43,7 +43,7 @@ num_right_cond_busy_cpu=2 [Level2] limit_max_freq=1000000 -limit_max_cpu=3 +limit_min_cpu=3 num_down_cond=0 num_up_cond=1 num_up_cond_freq=1000000 @@ -56,7 +56,7 @@ num_right_cond_busy_cpu=3 [Level3] limit_max_freq=1000000 -limit_max_cpu=4 +limit_min_cpu=4 num_down_cond=0 num_up_cond=1 num_up_cond_freq=1000000 @@ -67,7 +67,7 @@ num_right_cond=0 [Level4] limit_max_freq=1200000 -limit_max_cpu=1 +limit_min_cpu=1 num_down_cond=1 num_down_cond_freq=1000000 num_up_cond=1 @@ -79,7 +79,7 @@ num_right_cond_busy_cpu=1 [Level5] limit_max_freq=1200000 -limit_max_cpu=2 +limit_min_cpu=2 num_down_cond=1 num_down_cond_freq=1000000 num_up_cond=1 @@ -93,7 +93,7 @@ num_right_cond_busy_cpu=2 [Level6] limit_max_freq=1200000 -limit_max_cpu=3 +limit_min_cpu=3 num_down_cond=1 num_down_cond_freq=1000000 num_up_cond=1 @@ -107,7 +107,7 @@ num_right_cond_busy_cpu=3 [Level7] limit_max_freq=1200000 -limit_max_cpu=4 +limit_min_cpu=4 num_down_cond=1 num_down_cond_freq=1000000 num_up_cond=1 @@ -119,7 +119,7 @@ num_right_cond=0 [Level8] limit_max_freq=1300000 -limit_max_cpu=1 +limit_min_cpu=1 num_down_cond=1 num_down_cond_freq=1100000 num_up_cond=1 @@ -131,7 +131,7 @@ num_right_cond_busy_cpu=1 [Level9] limit_max_freq=1300000 -limit_max_cpu=2 +limit_min_cpu=2 num_down_cond=1 num_down_cond_freq=1100000 num_up_cond=1 @@ -145,7 +145,7 @@ num_right_cond_busy_cpu=2 [Level10] limit_max_freq=1300000 -limit_max_cpu=3 +limit_min_cpu=3 num_down_cond=1 num_down_cond_freq=1100000 num_up_cond=1 @@ -159,7 +159,7 @@ num_right_cond_busy_cpu=3 [Level11] limit_max_freq=1300000 -limit_max_cpu=4 +limit_min_cpu=4 num_down_cond=1 num_down_cond_freq=1100000 num_up_cond=1 @@ -171,7 +171,7 @@ num_right_cond=0 [Level12] limit_max_freq=1500000 -limit_max_cpu=1 +limit_min_cpu=1 num_down_cond=1 num_down_cond_freq=1300000 num_up_cond=1 @@ -183,7 +183,7 @@ num_right_cond_busy_cpu=1 [Level13] limit_max_freq=1500000 -limit_max_cpu=2 +limit_min_cpu=2 num_down_cond=1 num_down_cond_freq=1300000 num_up_cond=1 @@ -197,7 +197,7 @@ num_right_cond_busy_cpu=2 [Level14] limit_max_freq=1500000 -limit_max_cpu=3 +limit_min_cpu=3 num_down_cond=1 num_down_cond_freq=1300000 num_up_cond=1 @@ -211,7 +211,7 @@ num_right_cond_busy_cpu=3 [Level15] limit_max_freq=1500000 -limit_max_cpu=4 +limit_min_cpu=4 num_down_cond=1 num_down_cond_freq=1300000 num_up_cond=1 @@ -223,7 +223,7 @@ num_right_cond=0 [Level16] limit_max_freq=1700000 -limit_max_cpu=1 +limit_min_cpu=1 num_down_cond=1 num_down_cond_freq=1500000 num_up_cond=0 @@ -234,7 +234,7 @@ num_right_cond_busy_cpu=1 [Level17] limit_max_freq=1700000 -limit_max_cpu=2 +limit_min_cpu=2 num_down_cond=1 num_down_cond_freq=1500000 num_up_cond=0 @@ -247,7 +247,7 @@ num_right_cond_busy_cpu=2 [Level18] limit_max_freq=1700000 -limit_max_cpu=3 +limit_min_cpu=3 num_down_cond=1 num_down_cond_freq=1500000 num_up_cond=0 @@ -260,7 +260,7 @@ num_right_cond_busy_cpu=3 [Level19] limit_max_freq=1700000 -limit_max_cpu=4 +limit_min_cpu=4 num_down_cond=1 num_down_cond_freq=1500000 num_up_cond=0 diff --git a/src/pass/pass-gov.c b/src/pass/pass-gov.c index d8ecab0..7dab679 100644 --- a/src/pass/pass-gov.c +++ b/src/pass/pass-gov.c @@ -167,7 +167,7 @@ static void pass_hotplug_stop(struct pass_policy *policy) if (!policy->hotplug) return; - policy->hotplug->online = table[level].limit_max_cpu; + policy->hotplug->online = table[level].limit_min_cpu; policy->hotplug->max_online = policy->cpufreq.num_nr_cpus; } @@ -175,7 +175,7 @@ static int pass_hotplug_dummy_governor(struct pass_policy *policy) { int level = policy->curr_level; - return policy->pass_table[level].limit_max_cpu; + return policy->pass_table[level].limit_min_cpu; } /* @@ -227,7 +227,7 @@ static int pass_governor_change_level(struct pass_policy *policy, int new_level) int curr_level = policy->curr_level; int limit_max_freq; int limit_min_freq; - int limit_max_cpu; + int limit_min_cpu; int online; int ret; @@ -246,15 +246,15 @@ static int pass_governor_change_level(struct pass_policy *policy, int new_level) */ limit_max_freq = table[new_level].limit_max_freq; limit_min_freq = table[new_level].limit_min_freq; - limit_max_cpu = table[new_level].limit_max_cpu; + limit_min_cpu = table[new_level].limit_min_cpu; policy->prev_level = policy->curr_level; policy->curr_level = new_level; /* Turn on/off CPUs according the maximum number of online CPU */ if (hotplug) { - if (hotplug->max_online != limit_max_cpu) - hotplug->max_online = limit_max_cpu; + if (hotplug->max_online != limit_min_cpu) + hotplug->max_online = limit_min_cpu; if (hotplug->governor) online = hotplug->governor(policy); @@ -289,7 +289,7 @@ static int pass_governor_change_level(struct pass_policy *policy, int new_level) pass_res->cdata.res_name, (curr_level > new_level ? "DOWN" : "UP"), curr_level, new_level, - limit_max_freq, limit_min_freq, limit_max_cpu); + limit_max_freq, limit_min_freq, limit_min_cpu); */ return 0; @@ -313,11 +313,11 @@ static void pass_calculate_busy_cpu(struct pass_policy *policy) unsigned int sum_load; unsigned int sum_runnable_load; unsigned int nr_runnings; - int limit_max_cpu; + int limit_min_cpu; int i; int j; - limit_max_cpu = table[level].limit_max_cpu; + limit_min_cpu = table[level].limit_min_cpu; for (i = 0; i < policy->num_pass_cpu_stats; i++) { cur_freq = stats[i].freq; @@ -350,8 +350,8 @@ static void pass_calculate_busy_cpu(struct pass_policy *policy) } stats[i].num_busy_cpu = busy_cpu; - stats[i].avg_load = sum_load / limit_max_cpu; - stats[i].avg_runnable_load = sum_runnable_load / limit_max_cpu; + stats[i].avg_load = sum_load / limit_min_cpu; + stats[i].avg_runnable_load = sum_runnable_load / limit_min_cpu; if (nr_runnings) { stats[i].avg_thread_load = (sum_load * 100) / nr_runnings; diff --git a/src/pass/pass-micro.conf b/src/pass/pass-micro.conf index 48ce2de..d98b666 100644 --- a/src/pass/pass-micro.conf +++ b/src/pass/pass-micro.conf @@ -19,7 +19,7 @@ pass_governor_timeout=0.4 [Level0] limit_max_freq=600000 -limit_max_cpu=1 +limit_min_cpu=1 num_down_cond=0 num_up_cond=1 @@ -31,7 +31,7 @@ num_right_cond=0 [Level1] limit_max_freq=700000 -limit_max_cpu=1 +limit_min_cpu=1 num_down_cond=1 num_down_cond_freq=500000 @@ -46,7 +46,7 @@ num_right_cond=0 [Level2] limit_max_freq=800000 -limit_max_cpu=1 +limit_min_cpu=1 num_down_cond=1 num_down_cond_freq=700000 @@ -61,7 +61,7 @@ num_right_cond=0 [Level3] limit_max_freq=700000 -limit_max_cpu=2 +limit_min_cpu=2 num_down_cond=1 num_down_cond_freq=600000 @@ -76,7 +76,7 @@ num_right_cond=0 [Level4] limit_max_freq=700000 -limit_max_cpu=2 +limit_min_cpu=2 num_down_cond=1 num_down_cond_freq=600000 @@ -91,7 +91,7 @@ num_right_cond=0 [Level5] limit_max_freq=800000 -limit_max_cpu=2 +limit_min_cpu=2 num_down_cond=1 num_down_cond_freq=700000 diff --git a/src/pass/pass-parser.c b/src/pass/pass-parser.c index cc5fbe4..5ae6cf1 100644 --- a/src/pass/pass-parser.c +++ b/src/pass/pass-parser.c @@ -122,8 +122,8 @@ static int pass_parse_level(struct parse_result *result, policy->pass_table[level].limit_max_freq = atoi(result->value); else if (MATCH(result->name, "limit_min_freq")) policy->pass_table[level].limit_min_freq = atoi(result->value); - else if (MATCH(result->name, "limit_max_cpu")) - policy->pass_table[level].limit_max_cpu = atoi(result->value); + else if (MATCH(result->name, "limit_min_cpu")) + policy->pass_table[level].limit_min_cpu = atoi(result->value); else if (MATCH(result->name, "num_down_cond")) policy->pass_table[level].num_down_cond = atoi(result->value); @@ -365,10 +365,10 @@ int pass_get_table(struct pass_policy *policy, char *pass_conf_path) _I("%s| policy->pass_table[%d].limit_min_freq : %d\n", pass_res->cdata.res_name, level, policy->pass_table[level].limit_min_freq); - if (policy->pass_table[level].limit_max_cpu) - _I("%s| policy->pass_table[%d].limit_max_cpu : %d\n", + if (policy->pass_table[level].limit_min_cpu) + _I("%s| policy->pass_table[%d].limit_min_cpu : %d\n", pass_res->cdata.res_name, level, - policy->pass_table[level].limit_max_cpu); + policy->pass_table[level].limit_min_cpu); if (policy->pass_table[level].gov_timeout) _I("%s| policy->pass_table[%d].gov_timeout : %f\n", pass_res->cdata.res_name, level, diff --git a/src/pass/pass.c b/src/pass/pass.c index 599ea46..726bc64 100644 --- a/src/pass/pass.c +++ b/src/pass/pass.c @@ -156,8 +156,8 @@ static int pass_resource_init(struct pass_policy *policy) for (i = 0; i < policy->num_levels; i++) { if (max_freq < policy->pass_table[i].limit_max_freq) max_freq = policy->pass_table[i].limit_max_freq; - if (max_cpu < policy->pass_table[i].limit_max_cpu) - max_cpu = policy->pass_table[i].limit_max_cpu; + if (max_cpu < policy->pass_table[i].limit_min_cpu) + max_cpu = policy->pass_table[i].limit_min_cpu; } policy->cpufreq.max_freq = max_freq; policy->cpufreq.num_nr_cpus = max_cpu; diff --git a/src/pass/pass.h b/src/pass/pass.h index 80b5497..427dc0e 100644 --- a/src/pass/pass.h +++ b/src/pass/pass.h @@ -139,7 +139,7 @@ struct pass_table { /* Constraints condition for powersaving */ int limit_max_freq; int limit_min_freq; - int limit_max_cpu; + int limit_min_cpu; /* Governor timer's timeout for each pass level */ double gov_timeout; -- 2.7.4 From ec1ec9fdd8cc4c4ab3cdf03df1846d3245f958e4 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Sat, 4 Feb 2017 20:03:32 +0900 Subject: [PATCH 09/16] pmqos: Change the 'PmqosScenario' to 'PassScenario' section name This patch just changes the sectcion name from 'PmqosScenatio' to 'PassScenario' in order to keep the consistency of property name between pmqos.conf and pass-*.conf of each resource. Second, this patch removes the unneeded 'PMQOS' section name which doesn't include the any propeties. Change-Id: I978be1ab5df3dec0213a9035a36fb9962df4339a Signed-off-by: Chanwoo Choi --- src/pmqos/pmqos-parser.c | 14 +++++--------- src/pmqos/pmqos.conf | 7 +------ 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/pmqos/pmqos-parser.c b/src/pmqos/pmqos-parser.c index 1814e84..690a465 100644 --- a/src/pmqos/pmqos-parser.c +++ b/src/pmqos/pmqos-parser.c @@ -45,8 +45,8 @@ static int pmqos_parse_scenario(struct parse_result *result, void *user_data, un assert(result); assert(result->section && result->name && result->value); - /* Parse 'PmqosScenario' section */ - if (MATCH(result->section, "PmqosScenario")) { + /* Parse 'PassScenario' section */ + if (MATCH(result->section, "PassScenario")) { if (MATCH(result->name, "scenario_support")) scenarios->support = is_supported(result->value); else if (MATCH(result->name, "scenario_num")) { @@ -96,15 +96,11 @@ static int pmqos_load_config(struct parse_result *result, void *user_data) if (!result->section || !result->name || !result->value) return 0; - /* Parsing 'PMQOS' section */ - if (MATCH(result->section, "PMQOS")) - goto out; - - /* Parsing 'Pmqos Scenario' section */ - if (MATCH(result->section, "PmqosScenario")) { + /* Parsing 'PassScenario' section */ + if (MATCH(result->section, "PassScenario")) { ret = pmqos_parse_scenario(result, user_data, -1); if (ret < 0) { - _E("failed to parse [PmqosScenario] section : %d", ret); + _E("failed to parse [PassScenario] section : %d", ret); return ret; } goto out; diff --git a/src/pmqos/pmqos.conf b/src/pmqos/pmqos.conf index ffeeb64..b55f023 100644 --- a/src/pmqos/pmqos.conf +++ b/src/pmqos/pmqos.conf @@ -1,9 +1,4 @@ -[PMQOS] - -############################ -### Add list of scenario ### -############################ -[PmqosScenario] +[PassScenario] # set to "yes" scenario_support (Default value is no) # set scenario_num to be tested scenario_support=yes -- 2.7.4 From 1f38794699cadc1e2c1c775d17093baa7e755583 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Sat, 4 Feb 2017 20:10:12 +0900 Subject: [PATCH 10/16] pmqos: Rename the pmqos filename from 'pmqos.conf' to 'pass-pmqos.conf' This patch just renames the file of pmqos configuration file to keep the consistency of the format of pass configuration file. Change-Id: Ib195e698c389ff5f044b8b3bad5cc27600ceb5ad Signed-off-by: Chanwoo Choi --- CMakeLists.txt | 2 +- packaging/pass.spec | 2 +- src/pmqos/{pmqos.conf => pass-pmqos.conf} | 0 src/pmqos/pmqos.c | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename src/pmqos/{pmqos.conf => pass-pmqos.conf} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2b683a..2116f1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,7 +158,7 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/pass/pass-cluster1.conf DESTINATIO INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/pass/pass-cluster2.conf DESTINATION /etc/pass) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/pass/pass-cluster3.conf DESTINATION /etc/pass) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/pass/pass-cluster4.conf DESTINATION /etc/pass) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/pmqos/pmqos.conf DESTINATION /etc/pass) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/pmqos/pass-pmqos.conf DESTINATION /etc/pass) CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) diff --git a/packaging/pass.spec b/packaging/pass.spec index d87e4dd..07677d2 100644 --- a/packaging/pass.spec +++ b/packaging/pass.spec @@ -117,7 +117,7 @@ systemctl daemon-reload %config %{_sysconfdir}/pass/pass-cluster2.conf %config %{_sysconfdir}/pass/pass-cluster3.conf %config %{_sysconfdir}/pass/pass-cluster4.conf -%config %{_sysconfdir}/pass/pmqos.conf +%config %{_sysconfdir}/pass/pass-pmqos.conf %{_bindir}/%{daemon_name} %{_unitdir}/multi-user.target.wants/%{daemon_name}.service %{_unitdir}/sockets.target.wants/%{daemon_name}.socket diff --git a/src/pmqos/pmqos.conf b/src/pmqos/pass-pmqos.conf similarity index 100% rename from src/pmqos/pmqos.conf rename to src/pmqos/pass-pmqos.conf diff --git a/src/pmqos/pmqos.c b/src/pmqos/pmqos.c index dff3894..395a513 100644 --- a/src/pmqos/pmqos.c +++ b/src/pmqos/pmqos.c @@ -34,7 +34,7 @@ #define DEFAULT_PMQOS_TIMER 3000 -#define PMQOS_CONF_PATH "/etc/pass/pmqos.conf" +#define PMQOS_CONF_PATH "/etc/pass/pass-pmqos.conf" #define MILLISECONDS(tv) ((tv.tv_sec)*1000 + (tv.tv_nsec)/1000000) #define DELTA(a, b) (MILLISECONDS(a) - MILLISECONDS(b)) -- 2.7.4 From 60dd86dc32e4b5305edacb8c64685e1f7ef6e05c Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Mon, 6 Feb 2017 11:00:59 +0900 Subject: [PATCH 11/16] pass: pmqos: Fix bug of locked time This patch fixes the bug of the wrong locked time. On previous pass-pmqos.c show the current time instead of the locked time. - Before UnLock 'AppLaunch' scenario for 'cpu0' resource (1799653344ms) - After UnLock 'AppLaunch' scenario for 'cpu0' resource (3001ms) Change-Id: Iab24f788436604091058cc2bd085a088042bf8e0 Fixes: 8ddcc2d18db8 ("pass: Fix the build warnings") Signed-off-by: Chanwoo Choi --- src/pass/pass-pmqos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pass/pass-pmqos.c b/src/pass/pass-pmqos.c index 0edfaec..c3dc584 100644 --- a/src/pass/pass-pmqos.c +++ b/src/pass/pass-pmqos.c @@ -190,11 +190,11 @@ int pass_notifier_pmqos_func(struct pass_policy *policy, void *data) _I("Lock '%s' scenario for '%s' resource\n", name, cdata->res_name); } else { - scenario->list[index].locked_time = 0; - _I("UnLock '%s' scenario for '%s' resource (%lldms)\n", name, cdata->res_name, (pass_get_time_ms() - scenario->list[index].locked_time)); + + scenario->list[index].locked_time = 0; } pass_governor_change_level_scope(policy, min_level, max_level); -- 2.7.4 From 84860980b1bd2a6a9b4b639293c9eeb5a4da41f5 Mon Sep 17 00:00:00 2001 From: Wook Song Date: Mon, 6 Feb 2017 10:59:13 +0900 Subject: [PATCH 12/16] shared: Arrange common header file This patch removes unnecessary defines and macros from the common header file in the shared directory. Change-Id: Id7e6b0c132a9fc2bcec144d2f55fd836729d900a Signed-off-by: Wook Song --- src/shared/common.h | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/src/shared/common.h b/src/shared/common.h index 73f12dd..1379e5a 100644 --- a/src/shared/common.h +++ b/src/shared/common.h @@ -16,23 +16,8 @@ * limitations under the License. */ -#ifndef __DD_COMMON_H__ -#define __DD_COMMON_H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef API -#define API __attribute__ ((visibility("default"))) -#endif - -#ifndef DEPRECATED -#define DEPRECATED __attribute__ ((deprecated)) -#endif +#ifndef __SHARED_COMMON_H__ +#define __SHARED_COMMON_H__ #ifndef __CONSTRUCTOR__ #define __CONSTRUCTOR__ __attribute__ ((constructor)) @@ -42,8 +27,4 @@ extern "C" { #define __DESTRUCTOR__ __attribute__ ((destructor)) #endif -#ifdef __cplusplus - -} -#endif -#endif /* __DD_COMMON_H__ */ +#endif /* __SHARED_COMMON_H__ */ -- 2.7.4 From 5120e612f40c732ede45fb1a65938bf71f97b4ff Mon Sep 17 00:00:00 2001 From: Wook Song Date: Mon, 6 Feb 2017 12:57:40 +0900 Subject: [PATCH 13/16] shared: Fix warning messages due to LOG_TAG define This patch eliminates the following warning messages: In file included from pass-0.0.1/src/shared/dbus.c:27:0: pass-0.0.1/src/shared/log.h:23:0: warning: "LOG_TAG" redefined #define LOG_TAG "PASS" ^ In file included from /usr/include/dlog/dlog.h:34:0, from pass-0.0.1/src/shared/log.h:22, from pass-0.0.1/src/shared/dbus.c:27: /usr/include/dlog/dlog-internal.h:41:0: note: this is the location of the previous definition #define LOG_TAG NULL Change-Id: I072216c79a5daa883097601876cfff1f731ceaef Signed-off-by: Wook Song --- src/shared/log.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared/log.h b/src/shared/log.h index 636be78..0359108 100644 --- a/src/shared/log.h +++ b/src/shared/log.h @@ -20,7 +20,11 @@ #define __LOG_H__ #include +#ifdef LOG_TAG +#undef LOG_TAG #define LOG_TAG "PASS" +#endif /* LOG_TAG */ + #define _D(fmt, arg...) do { SLOGD(fmt, ##arg); } while(0) #define _I(fmt, arg...) do { SLOGI(fmt, ##arg); } while(0) -- 2.7.4 From 0f6604e0e9ce366c1e613eab1d68f8419fe1d5d4 Mon Sep 17 00:00:00 2001 From: Wook Song Date: Tue, 7 Feb 2017 10:56:51 +0900 Subject: [PATCH 14/16] hal: Add hal-log.h file to hal directory This patch creates the hal-log.h file in the hal directory. This header contains useful macros to display dlog messages and is used for the pass hal. Change-Id: I0cdd1c96c7c1d40aae2dc73715f9f71ac8c7a67b Signed-off-by: Wook Song --- src/hal/hal-log.h | 38 ++++++++++++++++++++++++++++++++++++++ src/hal/hal.c | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/hal/hal-log.h diff --git a/src/hal/hal-log.h b/src/hal/hal-log.h new file mode 100644 index 0000000..3590ab5 --- /dev/null +++ b/src/hal/hal-log.h @@ -0,0 +1,38 @@ +/* + * PASS (Power Aware System Service) + * + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __HAL_LOG_H__ +#define __HAL_LOG_H__ + +#include +#ifdef LOG_TAG +#undef LOG_TAG +#define LOG_TAG "PASS" +#endif /* LOG_TAG */ + + +#define _D(fmt, arg...) do { SLOGD(fmt, ##arg); } while(0) +#define _I(fmt, arg...) do { SLOGI(fmt, ##arg); } while(0) +#define _W(fmt, arg...) do { SLOGW(fmt, ##arg); } while(0) +#define _E(fmt, arg...) do { SLOGE(fmt, ##arg); } while(0) +#define _SD(fmt, arg...) do { SECURE_SLOGD(fmt, ##arg); } while(0) +#define _SI(fmt, arg...) do { SECURE_SLOGI(fmt, ##arg); } while(0) +#define _SW(fmt, arg...) do { SECURE_SLOGW(fmt, ##arg); } while(0) +#define _SE(fmt, arg...) do { SECURE_SLOGE(fmt, ##arg); } while(0) + +#endif /* __HAL_LOG_H__ */ diff --git a/src/hal/hal.c b/src/hal/hal.c index 7f8bee6..831b4b8 100644 --- a/src/hal/hal.c +++ b/src/hal/hal.c @@ -25,7 +25,7 @@ #include #include "hal.h" -#include "shared/log.h" +#include "hal-log.h" #ifndef EXPORT #define EXPORT __attribute__ ((visibility("default"))) -- 2.7.4 From 5473869839e4be54c4bd759b62955b9cd5b6716b Mon Sep 17 00:00:00 2001 From: Wook Song Date: Tue, 7 Feb 2017 11:10:57 +0900 Subject: [PATCH 15/16] hal: Add define directive for BUFF_MAX to hal.h This patch moves the define directive for BUFF_MAX to the hal.h. The directives in the other files related to the hal are removed. This patch also inserts the include directive for this hal.h to the files, which require BUFF_MAX. Change-Id: Id6115ad79b0c43f64518fb2aabdacd04b3745e25 Signed-off-by: Wook Song --- src/hal/hal.h | 2 ++ src/pass/pass-hal.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hal/hal.h b/src/hal/hal.h index 9dd89c1..d1c2cad 100644 --- a/src/hal/hal.h +++ b/src/hal/hal.h @@ -20,6 +20,8 @@ #include #include +#define BUFF_MAX 255 + #define MAKE_2B_CODE_2(A,B) \ ((((A) & 0xff) << 8) | ((B) & 0xff)) #define MAKE_2B_CODE_4(A,B,C,D) \ diff --git a/src/pass/pass-hal.c b/src/pass/pass-hal.c index 248ef80..220b454 100644 --- a/src/pass/pass-hal.c +++ b/src/pass/pass-hal.c @@ -471,7 +471,6 @@ int pass_get_num_cpus(void) } /* Get the load_table of each resource to estimate the system load. */ -#define BUFF_MAX 255 int pass_get_cpu_stats(struct pass_policy *policy) { struct pass_cpu_stats *stats = policy->pass_cpu_stats; -- 2.7.4 From 4f80e498a961310a8825ddf3405a3bbe79a5f04e Mon Sep 17 00:00:00 2001 From: Wook Song Date: Tue, 7 Feb 2017 14:37:03 +0900 Subject: [PATCH 16/16] hal: Make separate pass-hal-devel package This patch makes a separate package for pass-hal-devel. This package includes header files to build the board-specific pass-hal packages. Change-Id: Ia0581023a588ff7a1d39549c23a56268c808417d Signed-off-by: Wook Song --- CMakeLists.txt | 4 ++++ packaging/pass-hal-devel.manifest | 5 +++++ packaging/pass.spec | 17 +++++++++++++++++ pass-hal-devel.pc.in | 13 +++++++++++++ src/hal/CMakeLists.txt | 15 +++++++++++++++ src/hal/hal-cpu-example.c | 2 +- 6 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 packaging/pass-hal-devel.manifest create mode 100644 pass-hal-devel.pc.in create mode 100755 src/hal/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 2116f1b..eaffb0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,7 @@ SET(INCLUDEDIR "${PREFIX}/include/${PROJECT_NAME}") SET(DATADIR "${PREFIX}/share/${PROJECT_NAME}") SET(CONFDIR "/etc/${PROJECT_NAME}") SET(VERSION 0.1.0) +SET(PASS_HAL_NAME pass-hal-devel) SET(SRCS src/pass/pass.c @@ -162,6 +163,8 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/pmqos/pass-pmqos.conf DESTINATION CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) +CONFIGURE_FILE(${PASS_HAL_NAME}.pc.in ${PASS_HAL_NAME}.pc @ONLY) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PASS_HAL_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/systemd/ DESTINATION lib/systemd/system FILES_MATCHING @@ -170,3 +173,4 @@ INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/systemd/ DESTINATION lib/systemd/s ) ADD_SUBDIRECTORY(src/shared) +ADD_SUBDIRECTORY(src/hal) diff --git a/packaging/pass-hal-devel.manifest b/packaging/pass-hal-devel.manifest new file mode 100644 index 0000000..97e8c31 --- /dev/null +++ b/packaging/pass-hal-devel.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/pass.spec b/packaging/pass.spec index 07677d2..fe944a4 100644 --- a/packaging/pass.spec +++ b/packaging/pass.spec @@ -1,6 +1,7 @@ %define _unpackaged_files_terminate_build 0 %define daemon_name pass +%define hal_name pass-hal-devel %if "%{?profile}" == "mobile" %endif @@ -21,6 +22,7 @@ Group: System/Kernel License: Apache-2.0 Source0: %{name}-%{version}.tar.gz Source1: %{name}.manifest +Source2: %{hal_name}.manifest BuildRequires: cmake BuildRequires: libattr-devel @@ -49,6 +51,14 @@ Group: main %description %{daemon_name} PASS systemd daemon. +%package -n %{hal_name} +Summary: PASS HAL Header files +Group: Development/Library +Requires: pass = %{version}-%{release} + +%description -n %{hal_name} +Header files required to build pass-hal packages for specific boards. + %prep %setup -q %if %{with emulator} @@ -84,6 +94,7 @@ PASS systemd daemon. %build cp %{SOURCE1} . +cp %{SOURCE2} . make %{?jobs:-j%jobs} %install @@ -123,3 +134,9 @@ systemctl daemon-reload %{_unitdir}/sockets.target.wants/%{daemon_name}.socket %{_unitdir}/%{daemon_name}.service %{_unitdir}/%{daemon_name}.socket +%files -n %{hal_name} +%defattr(-,root,root,-) +%manifest %{hal_name}.manifest +%{_includedir}/%{daemon_name}/hal.h +%{_includedir}/%{daemon_name}/hal-log.h +%{_libdir}/pkgconfig/%{hal_name}.pc diff --git a/pass-hal-devel.pc.in b/pass-hal-devel.pc.in new file mode 100644 index 0000000..16fcdfc --- /dev/null +++ b/pass-hal-devel.pc.in @@ -0,0 +1,13 @@ +# Package Information for pkg-config + +package_name=pass-hal-devel +prefix=@PREFIX@ +exec_prefix=@EXEC_PREFIX@ +libdir=@LIB_INSTALL_DIR@ +includedir=@INCLUDEDIR@ + +Name: ${package_name} +Description: -- +Version: @VERSION@ +Requires: +Cflags: -I${includedir} diff --git a/src/hal/CMakeLists.txt b/src/hal/CMakeLists.txt new file mode 100755 index 0000000..ade8159 --- /dev/null +++ b/src/hal/CMakeLists.txt @@ -0,0 +1,15 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(pass-hal-devel C) + +SET(HAL_HEADERS + hal.h + hal-log.h +) + +INCLUDE(FindPkgConfig) +pkg_check_modules(pkgs REQUIRED + dlog) + +FOREACH(hheader ${HAL_HEADERS}) + INSTALL(FILES ${hheader} DESTINATION ${INCLUDEDIR}) +ENDFOREACH(hheader) diff --git a/src/hal/hal-cpu-example.c b/src/hal/hal-cpu-example.c index bc3896a..6817d87 100644 --- a/src/hal/hal-cpu-example.c +++ b/src/hal/hal-cpu-example.c @@ -28,7 +28,7 @@ #include #include -#include +#include static int get_curr_governor(char *res_name, char *governor) -- 2.7.4