Skip to content

Commit

Permalink
hybris: common: add exit workaround for mali-hist-dump thread
Browse files Browse the repository at this point in the history
  • Loading branch information
morphis committed Jan 7, 2016
1 parent e1329b4 commit 417861a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions hybris/common/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,9 @@ int my_prctl(int option, unsigned long arg2, unsigned long arg3,

HOOK_TRACE("with PR_SET_NAME: name %s", name);

if (getenv("HYBRIS_MALI_HIST_DUMP_WORKAROUND") &&
char *workaround = getenv("HYBRIS_MALI_HIST_DUMP_WORKAROUND");

if (workaround &&
strcmp(name, MALI_HIST_DUMP_THREAD_NAME) == 0) {

// This can only work because prctl with PR_SET_NAME
Expand All @@ -1497,8 +1499,12 @@ int my_prctl(int option, unsigned long arg2, unsigned long arg3,
HYBRIS_DEBUG_LOG(HOOKS, "%s: Found mali-hist-dump, sleeping forever now ...",
__FUNCTION__);

// Sleep forever ...
for (;;) pause();
if (strcmp(workaround, "exit") == 0)
pthread_exit(NULL);
else {
// Sleep forever ...
for (;;) pause();
}
}
}

Expand Down

0 comments on commit 417861a

Please sign in to comment.