summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Youngjae Shin [Mon, 25 Sep 2017 04:39:45 +0000 (13:39 +0900)]
fix build warning
Change-Id: I75d689f1fd1bcb5881eb0409a43819f37b3ceda2
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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
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
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>
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>
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>
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>
KyungMi Lee [Thu, 5 Mar 2015 05:10:39 +0000 (21:10 -0800)]
Initial empty repository