summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-09-19util: kernel: Check for returned value is NULL in kernel_get_process_taskstats()tizen_9.0_m2_releaseaccepted/tizen/unified/x/asan/20241014.000510accepted/tizen/unified/x/20240920.053204accepted/tizen/unified/toolchain/20241004.102105accepted/tizen/unified/dev/20240920.060431accepted/tizen/unified/20240919.163750accepted/tizen/9.0/unified/20241030.235945tizen_9.0tizenaccepted/tizen_unified_x_asanaccepted/tizen_unified_xaccepted/tizen_unified_toolchainaccepted/tizen_unified_devaccepted/tizen_unifiedaccepted/tizen_9.0_unifiedChanwoo Choi1-1/+8
Change-Id: I0dba6c77957722aed371b5dd1551454f144d2ca1 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2024-08-30util: timer: Add exception handling when calloc is failedaccepted/tizen/unified/x/20240904.025256accepted/tizen/unified/dev/20240910.111523accepted/tizen/unified/20240903.110740Chanwoo Choi1-0/+5
Add exception handling when calloc is failed to prevent segmentation fault. Change-Id: I5a7a5733bd744acecc10a950f60c8925711354ad Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2024-07-19pass: pass-hal: Fix unreachable code when using pass_hal_save_memory_initdata()accepted/tizen/unified/x/asan/20240813.231931accepted/tizen/unified/x/20240723.043617accepted/tizen/unified/toolchain/20240812.133447accepted/tizen/unified/dev/20240724.110043accepted/tizen/unified/20240722.104306Chanwoo Choi1-1/+5
Fix unreachable code when using pass_hal_save_memory_initdata() by returning the error code if failed. Before this patch, the usage code of pass_hal_save_memory_initdata() is not able to receive the any error code. Change-Id: Iba1af390efe74847f384ca60048fe32fbe07b1ab Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2024-07-19util: device-notifier: Fix unreachable code when using unregister_notifier()Chanwoo Choi1-0/+3
Fix unreachable code when using unregister_notifier() by returning the error code if failed. Before this patch, the usage code of unregister_notifier() is not able to receive the any error code. Change-Id: I1bf9575a05b8dd2ca1c47e26e063dc90dbf892e0 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2024-07-19pass: pmqos: Fix unreachable code when using pass_pmqos_exit()Chanwoo Choi1-0/+3
Fix unreachable code when using pass_pmqos_exit() by returning the error code if failed. Before this patch, the usage code of pass_pmqos_exit() is not able to receive the any error code. Change-Id: I4034bcc7e6ef57e5d284d919acd4e469634c637b Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2024-07-19pmqos: Fix unreachable code when using pmqos_cancel()Chanwoo Choi1-1/+1
Fix unreachable code when using pmqos_cancel() by returning the error code if failed. Before this patch, the usage code of pmqos_cancel() is not able to receive the any error code. Change-Id: Icc1d622f30c67d0552be0a530666912b9b15e678 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2024-07-19monitor: request-handler: Fix unreachable code when using request_server_init()Chanwoo Choi1-1/+7
Fix unreachable code when using request_server_init() by returning the error code if failed. Before this patch, the usage code of request_server_init() is not able to receive the any error code. Change-Id: Ibc525b758f730cc3be376b0628630d2095fea1ef Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2024-04-11packaging: Remove shared lib from libpass-resource-monitor-develaccepted/tizen/unified/x/asan/20240625.092844accepted/tizen/unified/x/20240415.014045accepted/tizen/unified/dev/20240620.005751accepted/tizen/unified/20240412.141433Chanwoo Choi1-1/+1
libpass-resoruce-monitor and libpass-resource-monitor-devel packages contains the same shared library. It causes the build conflict when installing two packages at same time. Remove shared lib from libpass-resource-monitor-devel package. Change-Id: Ib6856d02d162b7e8c68a7f1e99d75b71bcfa7c05 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2024-03-07pass-rescon: Get scenario_level_list inside critical sectionaccepted/tizen/unified/x/20240311.100253accepted/tizen/unified/20240308.174124Dongwoo Lee1-1/+2
Change-Id: Ia371058c6ad4419da4ef48c569bdef6bf43fbe2a Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2024-03-07monitor: Prevent possible deadlock and pseudo wakeupDongwoo Lee2-6/+5
Change-Id: I040e53817b102cb5db6c557fec914912f450302e Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2024-03-07lib: resource-monitor: Fix missing mutual exclusionDongwoo Lee1-1/+5
Since find_client_by_id() walks g_pass_resource_monitor_client_head list which is prevented by critical section, it should be mutually exclusive, thus mutex lock/unlock is added to former/later of loop. Change-Id: I6ea2dad42ff9dd08dec331db7ea4c9de550da618 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2023-12-14resource-monitor: Add a body of the dbus request message for applying the ↵Sung-hun Kim1-0/+6
change of enlightenment Due to the change of enlightenment, the dbus request message should have a body which includes a string type argument. For understanding the change of enlightenment, please refer the below commit: https://review.tizen.org/gerrit/gitweb?p=platform/upstream/enlightenment.git;a=commit;h=fa89f84645623c0522c1d6327ec60c45648da0af Change-Id: Ida0553cfd0bb2172ae3145f03d89e53d290b72e7 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2023-12-14monitor: Add error handling codesSung-hun Kim1-1/+11
Since the request-handler code does not handle error cases, the pass daemon killed with segmentation fault. See the below gdb output: Program terminated with signal SIGSEGV, Segmentation fault. #0 handle_request (client=client@entry=0x7f680008d0, request=request@entry=0x7f72ffc270 "17") at /usr/src/debug/pass-2.0.0-1.aarch64/src/monitor/request-handler.c:877 877 /usr/src/debug/pass-2.0.0-1.aarch64/src/monitor/request-handler.c: No such file or directory. [Current thread is 1 (LWP 5465)] >>> bt #0 handle_request (client=client@entry=0x7f680008d0, request=request@entry=0x7f72ffc270 "17") at /usr/src/debug/pass-2.0.0-1.aarch64/src/monitor/request-handler.c:877 #1 0x000000558df6eda0 in request_handler_func (data=0x7f680008d0, result=<optimized out>) at /usr/src/debug/pass-2.0.0-1.aarch64/src/monitor/request-handler.c:1012 #2 0x000000558df5bb28 in __thread_loop_main (_ctx=0x7f68001170) at /usr/src/debug/pass-2.0.0-1.aarch64/src/util/thread.c:45 #3 0x0000007f833b882c in ?? () from /lib64/libpthread.so.0 #4 0x0000007f83319eac in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78 I added an error handling code with NULL check for the variable `array`. Change-Id: I93bc4a23903c2c7d7fc9315d238d2c5addddc445 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2023-09-12pass: Get rid of CAP_DAC_OVERRIDE capability from systemd servicetizen_8.0_m2_releaseaccepted/tizen/unified/20230913.091617accepted/tizen/8.0/unified/20231005.093825accepted/tizen_8.0_unifiedDongwoo Lee1-1/+1
CAP_SYS_RESOURCE is enough to write the psi nodes, CAP_DAC_OVERRIDED is no more needed. Thus, it is removed. Change-Id: Ie51f967eae11260114e940692edd10e0216b26f4 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2023-09-11pass: Add CAP_SYS_RESOURCE capability to allow write in psi nodesaccepted/tizen/unified/20230912.171559Dongwoo Lee1-1/+1
Since linux kernel 5.13, CAP_SYS_RESOURCE is required to write in psi nodes with unprivileged process. Thus this adds it to systemd service file. Change-Id: Ie8027e8f99aa616770eda9d0718604e2e0189041 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2023-08-08pass: thermal: Fix possible null deference in thermal_free()accepted/tizen/unified/riscv/20230809.013248accepted/tizen/unified/20230808.170202accepted/tizen_unified_riscvSeung-Woo Kim1-3/+5
When there is no thermal scenario, thermal can not be initialized and g_thermal is null. Exiting pass from the status, in thermal_free(), there is null deference. Fix the possible null deference. Change-Id: I69ab200ea3d182adc628913d89306db6fe3ebcff Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2023-08-08pass: thermal: Fix typo in thermal_free()Seung-Woo Kim1-1/+1
There was a typo in thermal_free(), so fix it. Change-Id: I94c49f98b58bb20481e4fe4bd02ccb0cfa352744 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2023-03-17tests: unittest: Add pass-resmon-unittestsaccepted/tizen/unified/20230322.080545Chanwoo Choi6-0/+944
Add support of pass-resmon-unittests to test Resource Monitor module (pass-resmon). [Test result of pass-resmon-unittests] [ 33s] 1: Test command: /home/abuild/rpmbuild/BUILD/pass-2.0.0/tests/unittest/pass-resmon/pass-resmon-unittests [ 33s] 1: Working Directory: /home/abuild/rpmbuild/BUILD/pass-2.0.0/tests/unittest/pass-resmon [ 33s] 1: Test timeout computed to be: 10000000 [ 33s] 1: [==========] Running 12 tests from 2 test suites. [ 33s] 1: [----------] Global test environment set-up. [ 33s] 1: [----------] 2 tests from PassResmonInitExitTest [ 33s] 1: [ RUN ] PassResmonInitExitTest.pass_resmon_prepare_init_and_exit_unprepare_valid [ 33s] 1: [ OK ] PassResmonInitExitTest.pass_resmon_prepare_init_and_exit_unprepare_valid (0 ms) [ 33s] 1: [ RUN ] PassResmonInitExitTest.pass_resmon_prepare_init_and_exit_unprepare_invalid [ 33s] 1: [ OK ] PassResmonInitExitTest.pass_resmon_prepare_init_and_exit_unprepare_invalid (0 ms) [ 33s] 1: [----------] 2 tests from PassResmonInitExitTest (0 ms total) [ 33s] 1: [ 33s] 1: [----------] 10 tests from PassResmonTest [ 33s] 1: [ RUN ] PassResmonTest.pass_resmon_register_timer [ 33s] 1: [ OK ] PassResmonTest.pass_resmon_register_timer (0 ms) [ 33s] 1: [ RUN ] PassResmonTest.pass_resmon_register_timer_invalid [ 33s] 1: [ OK ] PassResmonTest.pass_resmon_register_timer_invalid (0 ms) [ 33s] 1: [ RUN ] PassResmonTest.pass_resmon_unregister_timer [ 33s] 1: [ OK ] PassResmonTest.pass_resmon_unregister_timer (0 ms) [ 33s] 1: [ RUN ] PassResmonTest.pass_resmon_unregister_timer_invalid [ 33s] 1: [ OK ] PassResmonTest.pass_resmon_unregister_timer_invalid (0 ms) [ 33s] 1: [ RUN ] PassResmonTest.pass_resmon_update_timer_interval [ 33s] 1: [ OK ] PassResmonTest.pass_resmon_update_timer_interval (0 ms) [ 33s] 1: [ RUN ] PassResmonTest.pass_resmon_update_timer_interval_invalid [ 33s] 1: [ OK ] PassResmonTest.pass_resmon_update_timer_interval_invalid (0 ms) [ 33s] 1: [ RUN ] PassResmonTest.pass_resmon_register_uevent [ 33s] 1: [ OK ] PassResmonTest.pass_resmon_register_uevent (0 ms) [ 33s] 1: [ RUN ] PassResmonTest.pass_resmon_register_uevent_invalid [ 33s] 1: [ OK ] PassResmonTest.pass_resmon_register_uevent_invalid (0 ms) [ 33s] 1: [ RUN ] PassResmonTest.pass_resmon_unregister_uevent [ 33s] 1: [ OK ] PassResmonTest.pass_resmon_unregister_uevent (0 ms) [ 33s] 1: [ RUN ] PassResmonTest.pass_resmon_unregister_uevent_invalid [ 33s] 1: [ OK ] PassResmonTest.pass_resmon_unregister_uevent_invalid (0 ms) [ 33s] 1: [----------] 10 tests from PassResmonTest (3 ms total) [ 33s] 1: [ 33s] 1: [----------] Global test environment tear-down [ 33s] 1: [==========] 12 tests from 2 test suites ran. (3 ms total) [ 33s] 1: [ PASSED ] 12 tests. [ 33s] 1/1 Test #1: pass-resmon-unittests ............ Passed 0.01 sec [ 33s] [ 33s] 100% tests passed, 0 tests failed out of 1 [ 33s] [ 33s] Total Test time (real) = 0.01 sec Change-Id: Idcb8bac8d5d69862d898a810ddf0f802452b6883 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2023-03-17pass: resmon: Add missing exception handling to check parameterChanwoo Choi2-4/+14
Add missing exception handling to check whether parameter is valid or not And fix the wrong function prototype of pass_resmon_unregister_uevent with the the wrong error log information. Change-Id: I50d857d00bec6fd4f2404f05a8f392dd36d062b3 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2023-03-16pass: resmon: Move private pass_resmon structure for encapsulationChanwoo Choi10-63/+147
The struct pass_resmon is private data structure and the other module cannot access the data of struct pass_resmon directly. In order to protect the data, move private pass_resmon structure into pass_resmon module and then provide the proper getter/setter function to handle the data. Change-Id: Ic4d1d8d0d11294e173ba19cc08b50a459a878492 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2023-03-14pass: rescon: Fix GET functions to work properlyaccepted/tizen/unified/20230315.093502Dongwoo Lee1-5/+20
Change-Id: Ifc48198bbc6fe8736671a192fe1883a02aa90852 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2023-03-14pass: resmon: Add RESMON_TIMER_UNKNOWN enumChanwoo Choi1-0/+2
In order to test the invalid case of pass-resmon unittest, add RESMON_TIMER_UNKNOWN enum. Change-Id: I64d3f21fb6a7ee95c250d134b75310d105cd6f48 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2023-03-02monitor: request-handler: Apply API for creating monitoraccepted/tizen/unified/20230310.062654Youngjae Cho1-1/+1
Change-Id: I81786d80861a741039bd20719831597912c48cc6 Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2023-02-20pass: monitor: Apply libsyscommon resource-monitor changesaccepted/tizen/unified/20230306.172219Dongwoo Lee13-403/+403
Change-Id: I5da0095f9840d613f8962bcf3be824848c09e60f Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2023-02-20resource: system: Fix possible vulnerabilityDongwoo Lee1-1/+1
Change-Id: Ic6c261ea13e1a85086a15376ad360deb05f5d6cd Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2023-02-17tests: unittest: Add pass-rescon-unittestsChanwoo Choi4-0/+681
[Test result of pass-rescon-unittests] [ 2s] 1: Test command: /home/abuild/rpmbuild/BUILD/pass-2.0.0/tests/unittest/pass-rescon/pass-rescon-unittests [ 2s] 1: Test timeout computed to be: 10000000 [ 2s] 1: [==========] Running 22 tests from 2 test suites. [ 2s] 1: [----------] Global test environment set-up. [ 2s] 1: [----------] 1 test from PassResconInitExitTest [ 2s] 1: [ RUN ] PassResconInitExitTest.pass_rescon_prepare_and_init_and_exit [ 2s] 1: [ OK ] PassResconInitExitTest.pass_rescon_prepare_and_init_and_exit (0 ms) [ 2s] 1: [----------] 1 test from PassResconInitExitTest (0 ms total) [ 2s] 1: [ 2s] 1: [----------] 21 tests from PassResconTest [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_set_init_level [ 2s] 1: [ OK ] PassResconTest.pass_rescon_set_init_level (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_set_curr_level [ 2s] 1: [ OK ] PassResconTest.pass_rescon_set_curr_level (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_set_prev_level [ 2s] 1: [ OK ] PassResconTest.pass_rescon_set_prev_level (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_set_min_level [ 2s] 1: [ OK ] PassResconTest.pass_rescon_set_min_level (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_set_max_level [ 2s] 1: [ OK ] PassResconTest.pass_rescon_set_max_level (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_set_init_scenario_level [ 2s] 1: [ OK ] PassResconTest.pass_rescon_set_init_scenario_level (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_get_init_level [ 2s] 1: [ OK ] PassResconTest.pass_rescon_get_init_level (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_get_curr_level [ 2s] 1: [ OK ] PassResconTest.pass_rescon_get_curr_level (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_get_prev_level [ 2s] 1: [ OK ] PassResconTest.pass_rescon_get_prev_level (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_get_min_level [ 2s] 1: [ OK ] PassResconTest.pass_rescon_get_min_level (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_get_max_level [ 2s] 1: [ OK ] PassResconTest.pass_rescon_get_max_level (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_sync [ 2s] 1: [ OK ] PassResconTest.pass_rescon_sync (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_set_level_sync [ 2s] 1: [ OK ] PassResconTest.pass_rescon_set_level_sync (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_set_level [ 2s] 1: [ OK ] PassResconTest.pass_rescon_set_level (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_set_level_and_pass_rescon_sync [ 2s] 1: [ OK ] PassResconTest.pass_rescon_set_level_and_pass_rescon_sync (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_set_scenario_level_sync [ 2s] 1: [ OK ] PassResconTest.pass_rescon_set_scenario_level_sync (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_scenario_set_level [ 2s] 1: [ OK ] PassResconTest.pass_rescon_scenario_set_level (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_set_scenario_level_and_pass_rescon_sync [ 2s] 1: [ OK ] PassResconTest.pass_rescon_set_scenario_level_and_pass_rescon_sync (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_unset_scenario_level_sync [ 2s] 1: [ OK ] PassResconTest.pass_rescon_unset_scenario_level_sync (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_unset_scenario_level [ 2s] 1: [ OK ] PassResconTest.pass_rescon_unset_scenario_level (0 ms) [ 2s] 1: [ RUN ] PassResconTest.pass_rescon_unset_scenario_level_and_pass_rescon_sync [ 2s] 1: [ OK ] PassResconTest.pass_rescon_unset_scenario_level_and_pass_rescon_sync (0 ms) [ 2s] 1: [----------] 21 tests from PassResconTest (5 ms total) [ 2s] 1: [ 2s] 1: [----------] Global test environment tear-down [ 2s] 1: [==========] 22 tests from 2 test suites ran. (6 ms total) [ 2s] 1: [ PASSED ] 22 tests. [ 2s] 1/1 Test #1: pass-rescon-unittests ............ Passed 0.01 sec Change-Id: Ifcf5dc54805e3e40346d6486cae411eb5b8e99c6 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2023-02-15resource: system: Add is_supported ops for memory pressure level attributeDongwoo Lee1-0/+7
Change-Id: I5730b241965213563552f37ea5aa670968e5eaed Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2023-02-15tools: resource-monitor: Fix wrong attribute name descriptionDongwoo Lee1-1/+1
Change-Id: I3cb5e7b253e33930d90c80127511037241e9fb5e Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2023-02-14pass: Fix build warningsDongwoo Lee2-7/+10
Change-Id: I326e9f47c14b14312553ef49b6b5d180f3cf7bb9 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2023-02-08util: thread: Prevent to run thread before creation finishedaccepted/tizen/unified/20230221.031435Dongwoo Lee1-3/+9
Currently thread can be terminated before creation process is over, and it can either cause wrong memory access on thread context. To prevent this situation, thread lock is acquired before creating thread, and thus the new thread cannot acquire lock and is suspended until lock is released after creation is over. Change-Id: Ic769c4dfa522e115959cf25c2c0c78779d176743 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2023-02-07pass: Add capability for writing to procfs nodeDongwoo Lee1-1/+1
In order to use global memory pressure stall information, pass can write to the node '/proc/pressure/memory' and it requires 'CAP_DAC_OVERRIDE' capability. Thus, this adds the capability to service file. Change-Id: I35f865e503678826459e32f723a46a6812529d34 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2023-02-07resource: system: Add MEMORY_PRESSURE_LEVEL attributeDongwoo Lee3-0/+217
This adds the new attribute for representing pressure level of memory as follows: - Name: SYSTEM_ATTR_MEMORY_PRESSURE_LEVEL - Type: SYSCOMMON_RESMAN_DATA_TYPE_INT - Description: this attribute represents the current stall level for memory, which means how long delays memory allocation due to memory leakage. The level ranges between 0 and 4 (higher is worse). Change-Id: Ibdce4a983384743e2316967744ac843a6ebb15e2 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2022-12-13tests: unittest: Add pass-hal-mock class for unittestChanwoo Choi2-0/+517
Change-Id: I0862b7cfdbf300a4ef906f073ef34c0acf670570 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2022-12-13tests: unittest: Move pass-unittests into pass-hal-and-parser and rename itChanwoo Choi32-3/+933
The existing pass-unittests have been tested pass-hal module. When I tried to add pass-hal mocking class for testing pass-rescon module, the multiple definition build error happen. So that I split out the unittest like this. Change-Id: If0927b34197caebec579a52359df76faa1c0308d Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2022-12-13pass: rescon: Encapsulate struct pass_rescon to prevent direct accessChanwoo Choi12-127/+251
Any modules are able to access the internal fields of struct pass_rescon directly. It might make the problem on later and the current method is not proper. So that move the defintion of struct pass_rescon into src/pass/pass-rescon.c to prevent the direct access. Instead, provide the getter/setter function for fields of struct pass_rescon. Change-Id: I801452d0b8ae98146a74f2ebd1926f6cc4c8c47a Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2022-11-08resource: Operate based on resource idaccepted/tizen/unified/20221206.170546Youngjae Cho16-406/+267
The resource-manager of libsyscommon has been revamped to work based on resource id instead of actual instance. Therefore the pass doesn't need to manage actual resource instance of libsyscommon anymore. Instead, the only thing to do is managing id of resource instance, which can be used in any place to which resource instance could have been used. Change-Id: I5b47eb6ad9b5743fdb4a71f21cfe32af83300957 Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2022-10-31resource: Apply system resource manager libraryDongwoo Lee34-2273/+971
Now resource utilities is removed, and new resource manger library in libsyscommon which is extract from pass is used instead. Change-Id: I0ec3403ce297ef1c6d3899987bcb6fd5ad96abbd Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2022-10-31resource: Resolve dependency of HAL devicesDongwoo Lee11-97/+106
To include resource device related features to the resource library, this separates it from pass core. Change-Id: I35327b1932de35f5af2a516f361552160215b088 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2022-10-31resource: extract resource core from monitorDongwoo Lee4-155/+161
To make resource-related features into library, this extracts core part of resource util from resource monitor. Change-Id: I69930d9b7a83e87b3f67fd507360464eea7d4b44 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2022-10-21packaging: libpass-resource-monitor: Fix typoDongwoo Lee1-1/+1
Change-Id: I85a5a119b7a293670c0f66a93625a7ddb259494f Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2022-09-23pass: thermal: Fix to return proper value for dbus signal handlertizen_7.0_m2_releaseaccepted/tizen/unified/20220927.132311accepted/tizen/7.0/unified/hotfix/20221116.105751accepted/tizen/7.0/unified/20221110.063429tizen_7.0_hotfixaccepted/tizen_7.0_unified_hotfixSeung-Woo Kim1-1/+1
From the dbus-stub generated code, signal handler should return TRUE if it handles invocation. Even ret value is error, fix to return TRUE after handling invocation. Below is dbus-stub comment about signal handler: If a signal handler returns %TRUE, it means the signal handler will handle the invocation and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. NOTE: GLIB related asan heap-buffer-overflow issue is from the wrong return. Change-Id: I4db508aafba556406dce63bb0309d55c9f8a4696 Suggested-by: Sangjung Woo <sangjung.woo@samsung.com> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2022-09-23pmqos: Fix to return proper value for dbus signal handlerSeung-Woo Kim1-6/+3
From the dbus-stub generated code, signal handler should return TRUE if it handles invocation. Even ret value is error, fix to return TRUE after handling invocation. Below is dbus-stub comment about signal handler: If a signal handler returns %TRUE, it means the signal handler will handle the invocation and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. NOTE: GLIB related asan heap-buffer-overflow issue is from the wrong return. Change-Id: I070c4a3fd12d5421cc52e69e6ada25b2ec772e6f Suggested-by: Sangjung Woo <sangjung.woo@samsung.com> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2022-09-23pass: Fix to return proper value for dbus signal handlerSeung-Woo Kim1-1/+1
From the dbus-stub generated code, signal handler should return TRUE if it handles invocation. Even ret value is error, fix to return TRUE after handling invocation. Below is dbus-stub comment about signal handler: If a signal handler returns %TRUE, it means the signal handler will handle the invocation and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. NOTE: GLIB related asan heap-buffer-overflow issue is from the wrong return. Change-Id: I11e684101efb68e625a742b4d0655056299fd106 Suggested-by: Sangjung Woo <sangjung.woo@samsung.com> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2022-09-20pass: parser: Change num_of_cpus and first_cpu into signed typeaccepted/tizen/unified/20220922.114008Dongwoo Lee1-2/+2
Since two variable is unsigned so it can be never be less than zero, but in order to check error case they are needed to be negative. Change-Id: Ib60fafeee7c1352d6cf3d63e8e4f9c6e6e7f68ce Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2022-09-20pass: parser: Check NULL before referenceDongwoo Lee1-2/+3
Change-Id: Ifae8c9ae87a9f79bae5b79450b504d3025ecee24 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2022-09-20monitor: Use the systemd Unix socketaccepted/tizen/unified/20220920.110715Sung-hun Kim2-5/+35
Systemd creates an Unix socket when the system is booted on by using existing configuration files in /usr/lib/systemd. Previously, the resource monitor always creates a new Unix socket whether the socket exists or not. From now on, the resource monitor checks that the Unix socket is existed on the given path. If so, it uses the Unix socket instead of open a newer one. By doing so, the permission of the Unix socket can follow the given configuration denoted in the Systemd socket configuration file. Change-Id: I1eab46cd238340cc9700e1a2d52481270c06b8b1 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2022-09-19resource-monitor-tests: Prevent possible memory leaksSung-hun Kim1-0/+8
Change-Id: I9ff9c4bd7ef970ca1541c756fd1b11c5506980f9 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
2022-09-15resource: Fix missing NULL checkDongwoo Lee1-0/+3
Change-Id: I8a9f2d5139ad6298788d373485d24110e9d85979 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2022-09-15resource: Pass error result directly from resource creationaccepted/tizen/unified/20220919.013232accepted/tizen/unified/20220917.094318Dongwoo Lee3-11/+13
Previously, it was lost by returning NULL instead of the error code that occurred during the resource creation process, but now the error code is passed directly so that the caller can know the exact reason. Change-Id: Iffc25c266186195d23ef0f61bba989ff5e36b4d7 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
2022-09-15systemd: Fix socket file pathSung-hun Kim1-1/+1
Change from a invalid socket file path /run/.pass.socket to a valid socket file path /run/.pass-resource-monitor.socket Change-Id: I197c24710ba76ffc5b8fe195129d6057cd0e2035 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>