Skip to content

Commit

Permalink
libmemtrack: Fix the kgsl memory flag to determine usermapped buffers
Browse files Browse the repository at this point in the history
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'.

Bug: 20447631

Change-Id: Ibe9b88387a87b2caf37f3b20f8fd702dbef322db
  • Loading branch information
richard-uhler authored and pattjin committed Jun 16, 2015
1 parent 54a3a90 commit 54c6397
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion msm8084/libmemtrack/kgsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int kgsl_memtrack_get_memory(pid_t pid, enum memtrack_type type,

if (type == MEMTRACK_TYPE_GL && strcmp(line_type, "gpumem") == 0) {

if (flags[6] == 'Y')
if (flags[5] == 'Y')
accounted_size += size;
else
unaccounted_size += size;
Expand Down
2 changes: 1 addition & 1 deletion msm8226/libmemtrack/kgsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int kgsl_memtrack_get_memory(pid_t pid, enum memtrack_type type,

if (type == MEMTRACK_TYPE_GL && strcmp(line_type, "gpumem") == 0) {

if (flags[6] == 'Y')
if (flags[5] == 'Y')
accounted_size += size;
else
unaccounted_size += size;
Expand Down
2 changes: 1 addition & 1 deletion msm8960/libmemtrack/kgsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int kgsl_memtrack_get_memory(pid_t pid, enum memtrack_type type,
}

if (type == MEMTRACK_TYPE_GL && strcmp(line_type, "gpumem") == 0) {
if (flags[6] == 'Y')
if (flags[5] == 'Y')
accounted_size += size;
else
unaccounted_size += size;
Expand Down
2 changes: 1 addition & 1 deletion msm8974/libmemtrack/kgsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int kgsl_memtrack_get_memory(pid_t pid, enum memtrack_type type,
}

if (type == MEMTRACK_TYPE_GL && strcmp(line_type, "gpumem") == 0) {
if (flags[6] == 'Y')
if (flags[5] == 'Y')
accounted_size += size;
else
unaccounted_size += size;
Expand Down

0 comments on commit 54c6397

Please sign in to comment.