Fetching /proc/<pid>/status entry after validation. 60/157560/1 accepted/tizen/unified/20171026.074653 submit/tizen/20171025.074016
authorNishant Chaprana <n.chaprana@samsung.com>
Wed, 25 Oct 2017 05:46:07 +0000 (11:16 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Wed, 25 Oct 2017 05:46:07 +0000 (11:16 +0530)
commit71f7bebb11e3b1c00959d20377225b4af46c9e36
treee437c2850d5b1a7eb7a74530a8fa2ebec8f3edbf
parentfe9d6335ed936bf8995b34efe37ff36dacbef089
Fetching /proc/<pid>/status entry after validation.

Description: This patch adds validation check before storing status
entries and assignes proper index for storing value.

In TM1 reference device kernel makes below entries in status file.
proc entry is like below:-
sh-3.2# cat /proc/373/status
Name:   stc-manager
State:  S (sleeping)
Tgid:   373
Pid:    373
PPid:   1
TracerPid:      0

However in Odroid reference device, kernel makes below entries in status.
sh-3.2# cat /proc/3404/status
Name:   stc-manager
State:  S (sleeping)
Tgid:   3404
Ngid:   0
Pid:    3404
PPid:   1
TracerPid:      0

Odroid kernel has an extra entry "Ngid" which breaks current extraction logic.
So added logic to match entry key before extracting value when reading status file.

Change-Id: I393ed476919fc8c101a8ce6a11ab835230a39021
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
include/stc-manager-util.h
packaging/stc-manager.spec
src/helper/helper-procfs.c
src/monitor/stc-app-lifecycle.c