Added code to close fd for error cases in kgsl
function to prevent possible leak in fd.
CRs-Fixed: 2039493
Change-Id: I353423de286bf42c22b4726b519690d70303574f
A new entry is added in the kgsl driver to the flags field
of a memory entry which sets 'P' if the memory is of type
sparse physical allocation, through this changeID:
Ifaa687b036eeab22ab4cf0238abdfbe7b2311ed3
By Carter Cooper <ccooper@codeaurora.org>
Hence, update the parsing of memory entry's flags field's
value accordingly.
CRs-Fixed: 2001688
Change-Id: I15ab1cac5d31c96f6602929a2919eb867d2108fd
In the kgsl function which gets memory info for a
pid, there could be possibility of integer overflow
in operations with size, mapsize, accounted_size,
and unaccounted_size due to which result might be
smaller than these values. External inputs size and
mapsize are verified, and overflow check has been added.
CRs-Fixed: 1103020
Change-Id: Ic450e990598777591739635facc08fb7a2e477f9
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
AOSP copyright years are incorrectly updated to 2013, 2016.
Revert back AOSP copyright years to 2013 to as per requirement.
Change-Id: I2235f415ce7c40d03f3060d4ac2bbb8690cce6d0
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
Use 2 new columns from the kgsl debugfs mem file:
egl_surface_count: # of buffer attachments with usage=egl_surface
egl_image_count: # of buffer attachments with usage=egl_image
If an ion buffer is mapped with usage=egl_surface, the entire size will
be counted towards the egl_surface. The assumption is that the buffer
will be freed if the producer process is killed.
To handle buffers such as the wallpaper and texture atlas which have
no producer and are potentially mapped multiple times, assign each
process where usage=egl_image a size of "size / egl_image_count". This
ensures that the total memory usage is correct, while still assigning
some memory to each process which maps the buffer.
The above replaces the attempts to avoid double counting buffers using
the "is_surfaceflinger" check.
CRs-Fixed: 1087134
Change-Id: I4e001f4a613520585be8799d7269aafe6140d7a6
Signed-off-by: Santhosh Punugu <spunug@codeaurora.org>
An extra flag is added to the flags field of a memory entry which
sets 's' if the memory is secure. Hence, update the parsing of
a memory entry's fields value.
Change-Id: If4a1ce2a518dd427c5680e6408ce7276457c66ca
The mem file now has additional field, the mapsize. This
represents the size in bytes mapped to userspace. Use this
value and total size of an object to derive the unaccounted
size.
CRs-Fixed: 982589
Change-Id: I9400e7ddacf185ebf93d0dd09e33a61685bea4dd
The length of flags field in kgsl debugfs mem file has changed
from 7 to 8. Hence, change the parsing in libmemtrack accordingly.
CRs-Fixed: 952970
Change-Id: I49d7df74fa24bc900110bf32019a552a09d8ce9d
The flag is the last character in 'flags' field array. It was wrongly
indexed at flags[6] causing all entries to be marked as unaccounted.
The correct check should be for flags[5] to be equal to 'Y'.
Change-Id: I9f9af884b697363186d6315e5fb7c5673c22a495
The system wide Graphics memory usage is inaccurate because some ION
buffers which are shared between processes are counted twice, once for
the buffer's consumer (surfaceflinger), and again for the producer.
These ION buffers appear in surfaceflinger's kgsl memory dump with
usage=egl_image, and in the producer's dump with usage=egl_surface.
Improve the accuracy of Graphics memory tracking by ignoring all ION
buffers with usage=egl_image in the surfaceflinger process, under the
assumption that the buffers will be accounted for when examining the
producer's process.
Change-Id: I764c610f226d41e2897d6e0c2247793b0e321ed0
Signed-off-by: Fred Fettinger <fred.fettinger@motorola.com>
To comply with multi-arch build system changes for 64-bit support,
LOCAL_MODULE_RELATIVE_PATH needs to be used.
Drop explicit use of LOCAL_MODULE_PATH as its not needed, and
causes build system to overwrite one of multi-arch library
variants with the other arch variant.
Change-Id: I882de72ad2003f1e2bcc93fb63bad7377a84d31d
Instead of using useraddr from kgsl memory allocations to be
matched against proc/<pid>/smaps file to be used to determine
usermapping of a buffer, use the newly added flag which directly
indicates whether a given gpubuffer entry is usermapped or
not. The flag is the last character in the "flags" field.
CRs-fixed: 634962
Change-Id: I1f82f7a2ff207eb780f1938a3b1347451b1e3d77
- Add correct target information to make file
- Remove incorrect target names in the src files
- replace sprintf(banned api) with snprintf
Change-Id: I846ff3d5dcc5acc843c2c83506deafadd30b4942
Reads memory info from kgsl to track unaccounted for GL and ION
memory. Right now it has to parse every allocation and then
cross-reference it against /proc/pid/smaps. It would be faster
to modify the kgsl driver to keep counters that could just be
read directly.
Bug: 10294768
Change-Id: Icb17558f03ce53bc594fbee097e51fe82e15dc31