platform/core/system/memps.git
19 months agoAdjust scope of map info list variable 47/281847/2 accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix tizen_7.0 tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.061330 accepted/tizen/7.0/unified/hotfix/20221116.105745 accepted/tizen/unified/20220923.125202 tizen_7.0_m2_release
Seung-Woo Kim [Thu, 22 Sep 2022 07:57:11 +0000 (16:57 +0900)]
Adjust scope of map info list variable

The milist, map info list is allocated for each process and freed
by get_trib_mapinfo(), but the pointer life cycle is not well
shown. Adjust variable scope for each process, and add comment
about its free in get_trib_mapinfo().

Change-Id: I79ed7aadedbac919ce7f3cb9109e485120368835
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
19 months agofree entire geminfo list 46/281846/2
Seung-Woo Kim [Thu, 22 Sep 2022 07:53:04 +0000 (16:53 +0900)]
free entire geminfo list

The geminfo is list, so it should free all list element. Add
clear_geminfo() function to free all list element and use it.

Change-Id: I3e6cc1ef856bd8a755224ee772b7d064fb9972dc
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
19 months agopackaging: Update version to 0.2.0 to show drm render gpu node support 08/281808/2
Seung-Woo Kim [Thu, 22 Sep 2022 04:47:23 +0000 (13:47 +0900)]
packaging: Update version to 0.2.0 to show drm render gpu node support

Change-Id: I5b8679a6d5e5039f53de68827e700ee0fec69c2d
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
19 months agoAdd imported to geminfo 07/281807/2
Seung-Woo Kim [Thu, 22 Sep 2022 04:46:13 +0000 (13:46 +0900)]
Add imported to geminfo

When imported of geminfo is 1, then it means the gem is not
allocated from the gpu driver, instead, it is imported from
other driver as dma-buf fd. In render drm driver case, it is
usually imported from kms drm driver.

The information will be used later.

Change-Id: I4f139344e54c7d1ea6c04f2f9d98a1c3ad0bbe9c
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
19 months agoRemove mmap size of drm render node as like drm node 06/281806/2
Seung-Woo Kim [Thu, 22 Sep 2022 04:31:10 +0000 (13:31 +0900)]
Remove mmap size of drm render node as like drm node

If drm render is used as gpu, its mmap size needs to be removed
from total rss because it is already in 3d graphic memory.
Remove mmap size of drm render node.

Change-Id: I483c261efa76e04c58b45739cea7bac1f80e743f
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
19 months agoAdd gpu_gem_info sysfs node of drm render to 3d graphic memory 05/281805/2
Seung-Woo Kim [Thu, 22 Sep 2022 04:17:05 +0000 (13:17 +0900)]
Add gpu_gem_info sysfs node of drm render to 3d graphic memory

Some soc has its gpu driver in drm subsystem. In the case, gem
buffer of the gpu drm driver is 3d graphic memory, so add the
render node gpu_gem_info to 3d graphic memory.

NOTE2: the gpu_gem_info requires kernel porting for gem_info for
each process as like below link:
  https://git.tizen.org/cgit/platform/kernel/linux-rpi/commit/?h=tizen&id=dc9aad9594b2c8a18b15f6315b2d3ff1ff3dbe50

NOTE2: currently, sum of gpu_gem_info pss for each process is used
but the meory can be imported from drm kms node gem buffer. In the
case, TOTAL size result can be larger than real memory usage.

Change-Id: I851c12f393335c66a01d5dbc6c7cd231ac40ade3
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
19 months agoDivide functions to open and to parse gem_info sysfs node 04/281804/2
Seung-Woo Kim [Thu, 22 Sep 2022 02:57:12 +0000 (11:57 +0900)]
Divide functions to open and to parse gem_info sysfs node

To support other gem_info sysfs node, divide open function and
parse function for gem_info.

Change-Id: Id7f24438356c1636c54fb2cd784c09053ade98c2
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
19 months agoget mmap size of drm gem with all drm card node 50/281650/1 accepted/tizen/unified/20220921.091825
Seung-Woo Kim [Tue, 20 Sep 2022 07:29:46 +0000 (16:29 +0900)]
get mmap size of drm gem with all drm card node

There can be more than one drm card device. For example, in rpi4,
card0 is gpu and card1 is display controller node. Get mmap size
of drm gem with all drm card node.

Change-Id: I484eec17c6306d0d6fbb211c713d8877aee6e03f
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
19 months agoUse same dri node for gem_info and gem_name 49/281649/1
Seung-Woo Kim [Tue, 20 Sep 2022 06:51:21 +0000 (15:51 +0900)]
Use same dri node for gem_info and gem_name

For rpi4, it uses gem_info from /sys/kernel/debug/dri/1/ but
gem_name is read from /sys/kernel/debug/dri/0, so total
gem size is always 0. Fix to use same dri sysfs path for
both gem_info and gem_name.

Change-Id: Ibfb1662dcb8d9c51006adba9d9061b9d06ad3780
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
20 months agoTypo correction 31/280431/3 accepted/tizen/unified/20220901.125748 submit/tizen/20220901.042137
yunhee [Tue, 30 Aug 2022 04:11:30 +0000 (13:11 +0900)]
Typo correction

Typo correction line number 1430 in memps.c file
verbos -> verbose

Change-Id: Iaf58a97aa0456fd1f6328a725c11f438c0075962
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
2 years agoAdd gem_info path in dri card1 28/270928/1 accepted/tizen/unified/20220212.064809 submit/tizen/20220210.111655 submit/tizen/20220211.080819
Seung-Woo Kim [Fri, 11 Feb 2022 05:01:37 +0000 (14:01 +0900)]
Add gem_info path in dri card1

In some target, display dri card can be in 1 instead of 0. Add
gem_info path in dri card1 if card0 is failed.

Change-Id: Ia81840b49db6dbdefbe6bd156765706385e756cb
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2 years agoUse proper printing format for struct statfs 84/260684/2 accepted/tizen_6.5_unified tizen_6.5 accepted/tizen/6.5/unified/20211028.115220 accepted/tizen/unified/20210701.072833 submit/tizen/20210701.062539 submit/tizen_6.5/20211028.162501 tizen_6.5.m2_release
Sungguk Na [Thu, 1 Jul 2021 05:47:20 +0000 (14:47 +0900)]
Use proper printing format for struct statfs

Use cross-platform printing for combined cases.

Change-Id: Ic2789b42c567e950813a404fc72e677ced1ef001
Signed-off-by: Sungguk Na <sungguk.na@samsung.com>
3 years agoUse new zram node first 67/251267/2 accepted/tizen/unified/20210113.121039 submit/tizen/20210112.074120
Seung-Woo Kim [Tue, 12 Jan 2021 05:17:46 +0000 (14:17 +0900)]
Use new zram node first

For zram memory usage, memps uses deprecated old node first, and
if fails, then try newer zram stat node. Even it works fine, but
kernel with old node marked as deprecated, it gives kernel log
about deprecation. Use new zaram stat node first.

Change-Id: I3d6d2711b0dd8021880b9acda35c8613381aba09
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoConsider 64-bit address 93/243693/2 accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix tizen_6.0 tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.115651 accepted/tizen/6.0/unified/hotfix/20201103.001833 accepted/tizen/unified/20200910.123935 submit/tizen/20200909.072053 submit/tizen_6.0/20201029.205104 submit/tizen_6.0_hotfix/20201102.192505 submit/tizen_6.0_hotfix/20201103.114805 tizen_6.0.m2_release
Seung-Woo Kim [Wed, 9 Sep 2020 06:36:42 +0000 (15:36 +0900)]
Consider 64-bit address

The result for 'memps <pid>' shows address of maps only with
32-bit address. So on 64-bit, the printing style is messy.
Fix the result style considering 64-bit address.

Change-Id: I98372bf80882b900edf19a35bfc57231c8b75e10
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agofix length of pss for '-s <pid>' 68/243668/1
Seung-Woo Kim [Wed, 9 Sep 2020 04:20:09 +0000 (13:20 +0900)]
fix length of pss for '-s <pid>'

The pss is printed with 18 length space for '-s <pid>' but it is
too long. Fix the length of pss as 8 like other options.

Change-Id: Ic41a1e106ae86efe2c4bc40ba4a45a1e5a6403a7
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoRead pid_max from kernel 46/243346/2
Hyeongsik Min [Thu, 5 Mar 2020 12:30:43 +0000 (21:30 +0900)]
Read pid_max from kernel

From systemd v243, 'kernel.pid_max' is bumped to 4194304 on 64-bit
system. This change reads pid_max from proc and uses it for pid
validation.

Change-Id: Ief105ef09c7d89bc443878c6d66478f9c5ccc61d
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
3 years agofix printing style of title and data with fixed length 59/243259/3 accepted/tizen/unified/20200908.130519 submit/tizen/20200908.012815
Seung-Woo Kim [Fri, 4 Sep 2020 07:42:07 +0000 (16:42 +0900)]
fix printing style of title and data with fixed length

Change-Id: I18cb10d92b1af42ae798f938bda0a572877c6596
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoUpdate usage with using same whitespace and adding -r option 60/243260/3
Seung-Woo Kim [Fri, 4 Sep 2020 09:36:08 +0000 (18:36 +0900)]
Update usage with using same whitespace and adding -r option

There were tabs in usage print, so usage shows different indent.
Use same whitespace for all the usage options. Also add missing
'-r' option explaination showing rss of all processes.

Change-Id: I58ad37f032914349ac90137624ec500f7760c709
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoremove possible unsigned integer overflow for return value 27/243227/4
Seung-Woo Kim [Fri, 4 Sep 2020 05:57:50 +0000 (14:57 +0900)]
remove possible  unsigned integer overflow for return value

Static analysis tool warns about possible overflowed return value.
During calculation, check the possible overflow for return value.

Change-Id: I676a28670249ffc10462254d60d22a8859498ec4
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoReset errno when cmd file is not exists 60/243060/3 accepted/tizen/unified/20200904.154051 submit/tizen/20200904.044649
Seungha Son [Thu, 3 Sep 2020 00:06:59 +0000 (09:06 +0900)]
Reset errno when cmd file is not exists

 Sometime, there is a timing issue.
 If the process is terminated before calling readdir() and
 the directory of the process is removed, the file fails to open.
 If the file fails to open, errno is set, and the logic is terminated
 without reading other process information.

Change-Id: I332e076ce035bd6d66175d6886ce223aa964513a
Signed-off-by: Seungha Son <seungha.son@samsung.com>
3 years agoAdd PSS column in result table 95/242595/4
Seungha Son [Fri, 28 Aug 2020 06:41:49 +0000 (15:41 +0900)]
Add PSS column in result table

Change-Id: I3b078d8e0b0cc1053b9489946b21cf128f2d7b6c
Signed-off-by: Seungha Son <seungha.son@samsung.com>
3 years agoGet properly zram's used size. 22/242822/3
Dongwoo Lee [Tue, 1 Sep 2020 05:58:02 +0000 (14:58 +0900)]
Get properly zram's used size.

To get zram_used_total propely which is deprecated in up-to-date linux
kernels, zram size will be retrieved by two-paths: first try with
deprecated node for backward-compatibility and if fails then use the
new node.

Change-Id: If9a8ea131b9fbed8165dbbf5d743cbed40bf01ef
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoadjust print style for -s option 19/242619/1
Seung-Woo Kim [Fri, 28 Aug 2020 09:31:55 +0000 (18:31 +0900)]
adjust print style for -s option

Adjust thee whitespace style for "memps -s <pid>".

Change-Id: I8a8899fed613ddb5ebe4828c664452ce94cc3b6e
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoAdjust -Werror option 77/242377/2 accepted/tizen/unified/20200831.122448 submit/tizen/20200828.061050
Seungha Son [Wed, 26 Aug 2020 02:01:45 +0000 (11:01 +0900)]
Adjust -Werror option

Change-Id: Ia90be5c9b9b637f632c9c4b0dc9f81ec5be47dc4
Signed-off-by: Seungha Son <seungha.son@samsung.com>
3 years agoBound maximum index for accessing array 52/242252/3 accepted/tizen/unified/20200826.133022 submit/tizen/20200826.010711
Seung-Woo Kim [Tue, 25 Aug 2020 08:08:15 +0000 (17:08 +0900)]
Bound maximum index for accessing array

To avoid too large index to access buffer array, bound maximum
index.

Change-Id: Ifbf973cb4a90d708effce3aae6adc1029fb2850e
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoUse proper printing format for struct statfs 77/242277/2
Seung-Woo Kim [Tue, 25 Aug 2020 09:33:15 +0000 (18:33 +0900)]
Use proper printing format for struct statfs

If __USE_FILE_OFFSET64 is defined, struct statfs has 64-bit
elements even in 32-bit arch. Use proper printing format as
the definition.

Change-Id: I42e22ddb9fcab11dad322e56621e444df06e0860
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoUse enough arrary size for snprintf() 76/242276/2
Seung-Woo Kim [Tue, 25 Aug 2020 09:15:09 +0000 (18:15 +0900)]
Use enough arrary size for snprintf()

Use enough arrary size for snprintf() to avoid format-truncation.

Change-Id: I5d51ab3e0f9ba2ac97f7bdb57ff4edc9f5308f1a
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoAlways check return value of fgets() 75/242275/1
Seung-Woo Kim [Tue, 25 Aug 2020 09:08:52 +0000 (18:08 +0900)]
Always check return value of fgets()

Fix to check return value of fgets().

Change-Id: Iaededa3b623dd9e351d56c982939511e075a72e3
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoFix wrong if condition 74/242274/1
Seung-Woo Kim [Tue, 25 Aug 2020 08:59:39 +0000 (17:59 +0900)]
Fix wrong if condition

Fix wrong if condition having both "&&" and "||" without proper
parentheses.

Change-Id: I0eb65cbf10b571331498064098fbda70337b8bc8
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoClear freed pointer to null 41/242241/1
Seung-Woo Kim [Tue, 25 Aug 2020 06:51:38 +0000 (15:51 +0900)]
Clear freed pointer to null

To avoid possible use-after-free, clear frred pointer to null.

Change-Id: I180f96bd2550ee68ff3533745bb033581e247ba9
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoFix not to use uninitialized variable 40/242240/1
Seung-Woo Kim [Tue, 25 Aug 2020 06:43:08 +0000 (15:43 +0900)]
Fix not to use uninitialized variable

From get_mem_info(), buf is used without initialization in error
path. Fix not to use uninitialized variable, buf.

Change-Id: I40934a4ccc6fc6859c0b35f63931d0bb4103d5e9
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
4 years ago[PATCH] Support 3D memory usage value for Mali midgard GPU Driver 30/215630/1 accepted/tizen_5.5_unified accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix tizen_5.5 tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix accepted/tizen/5.5/unified/20191031.022202 accepted/tizen/5.5/unified/mobile/hotfix/20201027.090051 accepted/tizen/5.5/unified/wearable/hotfix/20201027.112740 accepted/tizen/unified/20191014.062508 submit/tizen/20191014.011158 submit/tizen_5.5/20191031.000004 submit/tizen_5.5_mobile_hotfix/20201026.185104 submit/tizen_5.5_wearable_hotfix/20201026.184304 tizen_5.5.m2_release
Minyoung, Song [Tue, 16 Jan 2018 07:09:16 +0000 (16:09 +0900)]
[PATCH] Support 3D memory usage value for Mali midgard GPU Driver

The usage of 3D memory is differ from GPU series
In case of Mali utgard, it comes from smaps of process
In case of Mali midgard, it comes form specific debug node

Change-Id: Iaef54537d107f49763ef8f8508c6787a73851a81
Signed-off-by: Minyoung, Song <minyoung.song@samsung.com>
6 years agoFix Coverity issues 68/153568/1 accepted/tizen_5.0_unified tizen_5.0 accepted/tizen/4.0/unified/20171011.071204 accepted/tizen/5.0/unified/20181102.021012 accepted/tizen/unified/20171019.145735 submit/tizen/20171011.011352 submit/tizen/20171019.073616 submit/tizen_4.0/20171010.054207 submit/tizen_5.0/20181101.000004 tizen_4.0.IoT.p1_release tizen_4.0.m2_release
Sungguk Na [Fri, 29 Sep 2017 01:09:24 +0000 (10:09 +0900)]
Fix Coverity issues

22581 Checked_return
36976 Resource_leak

Change-Id: I983248d1a48d8029f4a8cca2d2eb0997af0410de
Signed-off-by: Sungguk Na <sungguk.na@samsung.com>
6 years agofix build warning 72/152072/1 accepted/tizen/unified/20170929.081742 submit/tizen/20170928.120154
Youngjae Shin [Mon, 25 Sep 2017 04:39:45 +0000 (13:39 +0900)]
fix build warning

Change-Id: I75d689f1fd1bcb5881eb0409a43819f37b3ceda2

6 years agoConsider oom_score_adj in case of non-root permission 69/146969/2 accepted/tizen/4.0/unified/20170908.222139 accepted/tizen/unified/20170908.062310 submit/tizen/20170908.025422 submit/tizen_4.0/20170908.025440
ByungSoo Kim [Wed, 23 Aug 2017 04:24:08 +0000 (13:24 +0900)]
Consider oom_score_adj in case of non-root permission

When memps is executed without root permission,
it can't read oom_score_adj value.
The latest kernel doesn't support reading oom_score_adj value without root.
In case of that, memps should read oom_score value.

Change-Id: Ieb24bfcf7ef065f1230dd7c13698cd52264abe91
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
6 years agoAdapt ASLR to memps 36/143236/1 accepted/tizen/4.0/unified/20170829.020044 accepted/tizen/unified/20170810.172129 submit/tizen/20170810.003256 submit/tizen_4.0/20170828.100004 submit/tizen_4.0/20170828.110004
Sungguk Na [Wed, 9 Aug 2017 07:02:45 +0000 (16:02 +0900)]
Adapt ASLR to memps

Change-Id: I1d0210ec580c1b6e483b70e8eba8ab382e517be2
Signed-off-by: Sungguk Na <sungguk.na@samsung.com>
6 years agoFix freeing null pointer 'glist' 22/132822/1 accepted/tizen/4.0/unified/20170816.011719 accepted/tizen/unified/20170629.085509 submit/tizen/20170619.050706 submit/tizen_4.0/20170811.094300
Hyeongsik Min [Thu, 8 Jun 2017 01:07:50 +0000 (10:07 +0900)]
Fix freeing null pointer 'glist'

WGID : 248006
glist pointer can have null value when memps fails to open gem_info debugfs
node in load_geminfo(). This patch adds null check to prevent freeing
null pointer.

Change-Id: I0a7143ef5405fadfb2e39131ddc5db1f58bea135
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
6 years agoFix coding style issues detected by rule checker 93/132393/2
Hyeongsik Min [Mon, 5 Jun 2017 01:32:10 +0000 (10:32 +0900)]
Fix coding style issues detected by rule checker

Change-Id: I0b2f6237f733dc300c7fb8c0f223fc08d8cacd07
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
6 years agoUse debugfs node for accessing GEM information 91/132391/1
Hyeongsik Min [Mon, 5 Jun 2017 00:37:11 +0000 (09:37 +0900)]
Use debugfs node for accessing GEM information

drm_proc.c was removed in linux v3.11

Change-Id: I0ff9e92dea03c654ddc0c871f9bd4388ca5afc7b
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoPrevent buffer overflow with sscanf 74/125774/1 accepted/tizen_3.0_common accepted/tizen_3.0_ivi accepted/tizen_3.0_mobile accepted/tizen_3.0_tv accepted/tizen_3.0_wearable tizen_3.0 accepted/tizen/3.0/common/20170510.183012 accepted/tizen/3.0/ivi/20170509.223043 accepted/tizen/3.0/mobile/20170509.223021 accepted/tizen/3.0/tv/20170509.223028 accepted/tizen/3.0/wearable/20170509.223035 accepted/tizen/unified/20170426.195730 submit/tizen/20170426.041441 submit/tizen_3.0-common/20170510.074450 submit/tizen_3.0/20170428.014856 submit/tizen_3.0/20170428.015157 submit/tizen_3.0_common/20170510.075013 tizen_4.0.m1_release
Hyeongsik Min [Tue, 18 Apr 2017 15:11:23 +0000 (00:11 +0900)]
Prevent buffer overflow with sscanf

By allocating string buffer, prevent buffer overlow issue with sscanf.

Change-Id: I5655f1b7049dc457b525dfbc2d351b67616b3f88
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoReplace deprecated readdir_r() with readdir() 73/125773/1
Hyeongsik Min [Tue, 18 Apr 2017 14:54:05 +0000 (23:54 +0900)]
Replace deprecated readdir_r() with readdir()

Change-Id: I88e7060aecfd0cc982fd995f66a30f643b4fd292
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoFix smaps parsing logic 59/116759/2 accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable accepted/tizen/3.0/common/20170302.075821 accepted/tizen/3.0/ivi/20170302.034042 accepted/tizen/3.0/mobile/20170302.033941 accepted/tizen/3.0/tv/20170302.034004 accepted/tizen/3.0/wearable/20170302.034023 accepted/tizen/common/20170228.162222 accepted/tizen/ivi/20170302.120316 accepted/tizen/mobile/20170302.120235 accepted/tizen/tv/20170302.120244 accepted/tizen/unified/20170309.033717 accepted/tizen/wearable/20170302.120303 submit/tizen/20170228.110810 submit/tizen_3.0/20170228.114713 submit/tizen_unified/20170308.100409
Hyeongsik Min [Tue, 28 Feb 2017 06:27:35 +0000 (15:27 +0900)]
Fix smaps parsing logic

Memps fails to parse smaps and gets crash when kernel shows anon name
information in /proc/smaps, because kernel adds additional line to
print the information.
Instead of using fixed smaps line count, this patch checks every line
to find VMA address line.

Change-Id: I5eaad65804f9cae67bfc62b6625b4b7da0eb27aa
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoFix typos 38/115138/1 accepted/tizen/3.0/common/20170220.125755 accepted/tizen/3.0/ivi/20170220.014128 accepted/tizen/3.0/mobile/20170220.014009 accepted/tizen/3.0/tv/20170220.014105 accepted/tizen/3.0/wearable/20170220.014116 accepted/tizen/common/20170216.154900 accepted/tizen/ivi/20170217.022730 accepted/tizen/mobile/20170217.022722 accepted/tizen/tv/20170217.022725 accepted/tizen/wearable/20170217.022728 submit/tizen/20170216.115218 submit/tizen_3.0/20170216.115157 submit/tizen_3.0/20170217.041217
Hyeongsik Min [Thu, 16 Feb 2017 11:17:54 +0000 (20:17 +0900)]
Fix typos

Change-Id: Ibbfd8c2418959d35b890dd53a838d7994ea60333
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoSurpress Svace warning 37/115137/1
Hyeongsik Min [Thu, 16 Feb 2017 10:11:42 +0000 (19:11 +0900)]
Surpress Svace warning

And also change type of rss variable to unsigned long

Change-Id: I2de5440c7ac8eaefc5acafb84244194e435bad14
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoFix fixed value of smaps line count 95/96795/1
Hyeongsik Min [Thu, 10 Nov 2016 07:47:29 +0000 (16:47 +0900)]
Fix fixed value of smaps line count

Vma line was missed, so we need to add 1 on each hardcoded value.

Change-Id: I735bc0aaa312e034655534a78b456a35c5ce9fdb
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoFix build warnings 56/96056/2 accepted/tizen_3.0.m2_mobile accepted/tizen_3.0.m2_tv accepted/tizen_3.0.m2_wearable tizen_3.0.m2 tizen_3.0_tv accepted/tizen/3.0.m2/mobile/20170104.141400 accepted/tizen/3.0.m2/tv/20170104.142007 accepted/tizen/3.0.m2/wearable/20170104.142302 accepted/tizen/3.0/common/20161114.082327 accepted/tizen/3.0/ivi/20161110.021610 accepted/tizen/3.0/mobile/20161110.021512 accepted/tizen/3.0/tv/20161110.021532 accepted/tizen/3.0/wearable/20161110.021547 accepted/tizen/common/20161108.131702 accepted/tizen/ivi/20161109.002349 accepted/tizen/mobile/20161109.002255 accepted/tizen/tv/20161109.002314 accepted/tizen/wearable/20161109.002332 submit/tizen/20161108.023400 submit/tizen_3.0.m2/20170104.093751 submit/tizen_3.0/20161109.042255 submit/tizen_3.0_common/20161110.084657
Hyeongsik Min [Mon, 7 Nov 2016 12:33:41 +0000 (21:33 +0900)]
Fix build warnings

Change-Id: Icf8062b8f35b788a9d58ed2a7d207ef80a98bdaa
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoFix smaps parsing on 64bit kernel 75/95575/1
Hyeongsik Min [Fri, 4 Nov 2016 01:42:18 +0000 (10:42 +0900)]
Fix smaps parsing on 64bit kernel

In previous patch, there is a issue that memps truncates pathname
when it includes blank space.

Change-Id: I72770bc84c4f11b114c2dcdaad69314bacb113e4
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoFix smaps parsing issue on 64bit kernel 90/94490/2
Minyoung, Song [Mon, 31 Oct 2016 07:28:52 +0000 (16:28 +0900)]
Fix smaps parsing issue on 64bit kernel

Signed-off-by: Minyoung, Song <minyoung.song@samsung.com>
Change-Id: Ib1b439805dab0475fce70f1fa41906691fd5790a

7 years agoRefactoring smaps parsing logic 56/93156/2 accepted/tizen/3.0/ivi/20161103.001727 accepted/tizen/3.0/mobile/20161103.001636 accepted/tizen/3.0/tv/20161103.001653 accepted/tizen/3.0/wearable/20161103.001711 accepted/tizen/common/20161027.073329 accepted/tizen/ivi/20161028.151658 accepted/tizen/mobile/20161028.151609 accepted/tizen/tv/20161028.151624 accepted/tizen/wearable/20161028.151637 submit/tizen/20161026.142525 submit/tizen_3.0/20161102.071854
Hyeongsik Min [Thu, 20 Oct 2016 13:20:11 +0000 (22:20 +0900)]
Refactoring smaps parsing logic

To be compatible with various kernel version

Change-Id: Ie494cebc8581612271acb6eb584437563be1017a
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoModified kernel version check to support 4.x kernel smaps 62/78662/2 accepted/tizen/3.0/ivi/20161011.055318 accepted/tizen/3.0/mobile/20161015.033623 accepted/tizen/3.0/tv/20161016.005142 accepted/tizen/3.0/wearable/20161015.083525 accepted/tizen/common/20160706.142801 accepted/tizen/ivi/20160706.132921 accepted/tizen/mobile/20160706.132440 accepted/tizen/tv/20160706.132443 accepted/tizen/wearable/20160706.132539 submit/tizen/20160706.112136 submit/tizen_3.0_common/20161104.104000 submit/tizen_3.0_ivi/20161010.000005 submit/tizen_3.0_mobile/20161015.000004 submit/tizen_3.0_tv/20161015.000004 submit/tizen_3.0_wearable/20161015.000004
sungguk [Wed, 6 Jul 2016 10:33:01 +0000 (19:33 +0900)]
Modified kernel version check to support 4.x kernel smaps

Change-Id: I0878424145df4920ef09d4f4b659808ddc26c874
Signed-off-by: sungguk <sungguk.na@samsung.com>
8 years agoBug fix for guaranteeing NULL-termination of strncpy 80/64080/1 accepted/tizen/common/20160428.144412 accepted/tizen/ivi/20160428.081420 accepted/tizen/mobile/20160428.081355 accepted/tizen/tv/20160428.081416 accepted/tizen/wearable/20160428.081406 submit/tizen/20160428.011632
Minyoung, Song [Wed, 30 Mar 2016 02:14:32 +0000 (11:14 +0900)]
Bug fix for guaranteeing NULL-termination of strncpy

Change-Id: I8ef500d9007f0b151fcc5558cc5faab84dbb9d7c
Signed-off-by: Minyoung, Song <minyoung.song@samsung.com>
8 years agoModified licensing header 61/63061/2 accepted/tizen/common/20160322.150723 accepted/tizen/ivi/20160322.090305 accepted/tizen/mobile/20160322.090214 accepted/tizen/tv/20160322.090231 accepted/tizen/wearable/20160322.090248 submit/tizen/20160322.064944
Minyoung, Song [Tue, 22 Mar 2016 03:22:43 +0000 (12:22 +0900)]
Modified licensing header

Signed-off-by: Minyoung, Song <minyoung.song@samsung.com>
Change-Id: I0388c60d0e30aa2fb5a47101a52f268d5f56ccbd

8 years agoFixed gem_info parsing logic to find and sum from all rows of gem_info 28/61828/2 accepted/tizen/common/20160315.220818 accepted/tizen/ivi/20160314.104527 accepted/tizen/mobile/20160314.104434 accepted/tizen/tv/20160314.104452 accepted/tizen/wearable/20160314.104509 submit/tizen/20160314.011535
Minyoung, Song [Fri, 11 Mar 2016 01:26:44 +0000 (10:26 +0900)]
Fixed gem_info parsing logic to find and sum from all rows of gem_info

Signed-off-by: Minyoung, Song <minyoung.song@samsung.com>
Change-Id: Ia4af00cfa8542352d6bc2f9a8b096ccb8e99ce82

8 years agoFix svace issues 28/61628/1
Hyeongsik Min [Wed, 9 Mar 2016 08:29:26 +0000 (17:29 +0900)]
Fix svace issues

Change-Id: I9182ba8d42006a5388dacad9144d9cb2b6a0b2b1
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
8 years agoMerged latest memps code providing swap and cgroup usage 90/61490/3 accepted/tizen/common/20160310.080456 accepted/tizen/ivi/20160310.052756 accepted/tizen/mobile/20160310.052654 accepted/tizen/tv/20160310.052718 accepted/tizen/wearable/20160310.052737 submit/tizen/20160309.011659
Minyoung, Song [Tue, 8 Mar 2016 08:17:17 +0000 (17:17 +0900)]
Merged latest memps code providing swap and cgroup usage

Change-Id: I44624fa22a9bc9f9703c55d919cf1fdf5b9cca42
Signed-off-by: Minyoung, Song <minyoung.song@samsung.com>
8 years agoFix Svace issues 09/55809/1 accepted/tizen/ivi/20160218.023839 accepted/tizen/mobile/20151229.120004 accepted/tizen/tv/20151229.120013 accepted/tizen/wearable/20151229.120020 submit/tizen/20151229.110102 submit/tizen_common/20160218.142243 submit/tizen_ivi/20160217.000000 submit/tizen_ivi/20160217.000003
Hyeongsik Min [Tue, 29 Dec 2015 10:30:27 +0000 (19:30 +0900)]
Fix Svace issues

15723 - DIVISION_BY_ZERO
25769 - DIVISION_BY_ZERO
25770 - DIVISION_BY_ZERO

Change-Id: Icfed0528b6891af56f51c4c7864652ae01801ef8
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
9 years agoInitial code commit 27/36327/4 tizen_3.0.2015.q2_common tizen_3.0.m1_mobile tizen_3.0.m1_tv accepted/tizen/common/20150311.085852 accepted/tizen/mobile/20150312.011935 accepted/tizen/tv/20150312.010542 accepted/tizen/wearable/20150312.011156 submit/tizen/20150311.034641 tizen_3.0.m1_mobile_release tizen_3.0.m1_tv_release tizen_3.0.m2.a1_mobile_release tizen_3.0.m2.a1_tv_release
Prajwal A N [Thu, 5 Mar 2015 07:24:37 +0000 (16:24 +0900)]
Initial code commit

* memps is a tool which provides information about the memory usage of processes (RSS, PSS, memory map of process, clean and dirty pages), tmps and graphics memory usage
* Added source files and CmakeLists file
* Added packaging and license files

Change-Id: I5dc2357ff229ad876ec17919a2e9df51488b89e7
Signed-off-by: Prajwal A N <an.prajwal@samsung.com>
9 years agoInitial empty repository master
KyungMi Lee [Thu, 5 Mar 2015 05:10:39 +0000 (21:10 -0800)]
Initial empty repository