libmemtrack: Update the flags field for sparse memory type
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
diff --git a/libmemtrack/kgsl.c b/libmemtrack/kgsl.c
index 877b54e..3f36b8d 100644
--- a/libmemtrack/kgsl.c
+++ b/libmemtrack/kgsl.c
@@ -74,7 +74,7 @@
while (1) {
unsigned long size, mapsize;
char line_type[7];
- char flags[9];
+ char flags[10];
char line_usage[19];
int ret, egl_surface_count = 0, egl_image_count = 0;
@@ -86,9 +86,9 @@
* gpuaddr useraddr size id flags type usage sglen mapsize eglsrf eglimg
* 545ba000 545ba000 4096 1 -----pY gpumem arraybuffer 1 4096 0 0
*/
- ret = sscanf(line, "%*x %*x %lu %*d %8s %6s %18s %*d %lu %6d %6d\n",
- &size, flags, line_type, line_usage, &mapsize,
- &egl_surface_count, &egl_image_count);
+ ret = sscanf(line, "%*x %*x %lu %*d %9s %6s %18s %*d %lu %6d %6d\n",
+ &size, flags, line_type, line_usage, &mapsize,
+ &egl_surface_count, &egl_image_count);
if (ret != 7) {
continue;
}