util: kernel: Add functions for getting procfs stat fields 20/272420/2
authorDongwoo Lee <dwlee08@gmail.com>
Mon, 14 Mar 2022 09:33:54 +0000 (02:33 -0700)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Thu, 17 Mar 2022 03:39:51 +0000 (12:39 +0900)
commit188670cec19879d3c35df2024509083f4546cc3c
treed8fc81ce5f252cb9ae0e5a21632ae20a5fa809e9
parent63c2ed14f3c81be63e529359716da406502bfdd9
util: kernel: Add functions for getting procfs stat fields

This adds new functions for getting procfs stat fields of certain
process id as like below prototype:

int kernel_get_process_stat_fields(pid_t pid, char *buffer, int buf_len, char **stat_fields)
 - pid: target process id
 - buffer: string buffer for retrieving procfs stat, each field of
           stat_fileds points out some index within this buffer area.
   Thus, life time of stat_fields are determined by this.
 - buf_len: length of provided buffer
 - stat_fields: string array of retrieved fields, this should be
  declared as (char *)[PROCESS_STAT_FIELD_MAX] type.

Signed-off-by: Dongwoo Lee <dwlee08@gmail.com>
Change-Id: I23008751fdd17ddd17d9e756e1f0d7394bee5f98
include/util/kernel.h
src/util/kernel.c