Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

system-extras: Commit

system/extras


Commit MetaInfo

Révision9b887214abde2794e6475284d08ce78b216c4979 (tree)
l'heure2019-06-06 15:40:01
Auteurandroid-build-team Robot <android-build-team-robot@goog...>
Commiterandroid-build-team Robot

Message de Log

Snap for 5637155 from cc1b0fba71b55dabf3a3a5d4d4f6e5c806b7db6c to qt-qpr1-release

Change-Id: I583aee87c82ec15034772779f5b58db298936390

Change Summary

Modification

--- a/toolchain-extras/profile-extras-test.cpp
+++ b/toolchain-extras/profile-extras-test.cpp
@@ -28,7 +28,7 @@ void __gcov_flush() {
2828 }
2929 }
3030
31-static const char kCoveragePropName[] = "coverage.flush";
31+static const char kCoveragePropName[] = "debug.coverage.flush";
3232
3333 TEST(profile_extras, smoke) {
3434 flush_count = 0;
--- a/toolchain-extras/profile-extras.cpp
+++ b/toolchain-extras/profile-extras.cpp
@@ -17,7 +17,9 @@
1717 #include <errno.h>
1818 #include <pthread.h>
1919 #include <signal.h>
20+#include <stdlib.h>
2021 #include <string.h>
22+#include <libgen.h> // For POSIX basename().
2123
2224 // Use _system_properties.h to use __system_property_wait_any()
2325 #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
@@ -33,7 +35,7 @@ static void gcov_signal_handler(__unused int signum) {
3335 __gcov_flush();
3436 }
3537
36-static const char kCoveragePropName[] = "coverage.flush";
38+static const char kCoveragePropName[] = "debug.coverage.flush";
3739
3840 // In a loop, wait for any change to sysprops and trigger a __gcov_flush when
3941 // <kCoveragePropName> sysprop transistions to "1" after a transistion to "0".
@@ -84,6 +86,20 @@ __attribute__((constructor)) int init_profile_extras(void) {
8486 return -1;
8587 }
8688
89+ // Do not create thread running property_watch_loop for zygote (it can get
90+ // invoked as zygote or app_process). This check is only needed for the
91+ // platform, but can be done on any version after Android L, when
92+ // getprogname() was added.
93+#if defined(__ANDROID_API__) && __ANDROID_API__ >= __ANDROID_API_L__
94+ const char *prog_basename = basename(getprogname());
95+ if (strncmp(prog_basename, "zygote", strlen("zygote")) == 0) {
96+ return 0;
97+ }
98+ if (strncmp(prog_basename, "app_process", strlen("app_process")) == 0) {
99+ return 0;
100+ }
101+#endif
102+
87103 pthread_t thread;
88104 int error = pthread_create(&thread, nullptr, property_watch_loop, nullptr);
89105 if (error != 0) {
Afficher sur ancien navigateur de dépôt.