Merge changes I732e5b8a,I4271909e am: b9d8e8289e am: 73d171ff83
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2243559 Change-Id: Id1acfa9aec44f7ecc34a9dbdfe71622950650b45 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
bebd9adca0
4 changed files with 46 additions and 9 deletions
|
|
@ -58,10 +58,6 @@ cc_defaults {
|
||||||
vendor_available: true,
|
vendor_available: true,
|
||||||
product_available: true,
|
product_available: true,
|
||||||
recovery_available: true,
|
recovery_available: true,
|
||||||
vndk: {
|
|
||||||
enabled: true,
|
|
||||||
support_system_process: true,
|
|
||||||
},
|
|
||||||
host_supported: true,
|
host_supported: true,
|
||||||
|
|
||||||
cflags: [
|
cflags: [
|
||||||
|
|
@ -126,8 +122,8 @@ cc_defaults {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
cc_library {
|
cc_defaults {
|
||||||
name: "libutils",
|
name: "libutils_impl_defaults",
|
||||||
defaults: ["libutils_defaults"],
|
defaults: ["libutils_defaults"],
|
||||||
native_bridge_supported: true,
|
native_bridge_supported: true,
|
||||||
|
|
||||||
|
|
@ -180,12 +176,40 @@ cc_library {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "libutils",
|
||||||
|
defaults: ["libutils_impl_defaults"],
|
||||||
|
|
||||||
|
vndk: {
|
||||||
|
enabled: true,
|
||||||
|
support_system_process: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "libutils_test_compile",
|
||||||
|
defaults: ["libutils_impl_defaults"],
|
||||||
|
|
||||||
|
cflags: [
|
||||||
|
"-DCALLSTACKS=1",
|
||||||
|
"-DDEBUG_POLL_AND_WAKE=1",
|
||||||
|
"-DDEBUG_REFS=1",
|
||||||
|
"-DDEBUG_TOKENIZER=1",
|
||||||
|
],
|
||||||
|
|
||||||
|
visibility: [":__subpackages__"],
|
||||||
|
}
|
||||||
|
|
||||||
cc_library {
|
cc_library {
|
||||||
name: "libutilscallstack",
|
name: "libutilscallstack",
|
||||||
defaults: ["libutils_defaults"],
|
defaults: ["libutils_defaults"],
|
||||||
// TODO(b/153609531): remove when no longer needed.
|
// TODO(b/153609531): remove when no longer needed.
|
||||||
native_bridge_supported: true,
|
native_bridge_supported: true,
|
||||||
min_sdk_version: "29",
|
min_sdk_version: "29",
|
||||||
|
vndk: {
|
||||||
|
enabled: true,
|
||||||
|
support_system_process: true,
|
||||||
|
},
|
||||||
|
|
||||||
srcs: [
|
srcs: [
|
||||||
"CallStack.cpp",
|
"CallStack.cpp",
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,14 @@
|
||||||
//#define LOG_NDEBUG 0
|
//#define LOG_NDEBUG 0
|
||||||
|
|
||||||
// Debugs poll and wake interactions.
|
// Debugs poll and wake interactions.
|
||||||
|
#ifndef DEBUG_POLL_AND_WAKE
|
||||||
#define DEBUG_POLL_AND_WAKE 0
|
#define DEBUG_POLL_AND_WAKE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
// Debugs callback registration and invocation.
|
// Debugs callback registration and invocation.
|
||||||
|
#ifndef DEBUG_CALLBACKS
|
||||||
#define DEBUG_CALLBACKS 0
|
#define DEBUG_CALLBACKS 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <utils/Looper.h>
|
#include <utils/Looper.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,11 @@
|
||||||
|
|
||||||
#include <android-base/macros.h>
|
#include <android-base/macros.h>
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
||||||
#include <log/log.h>
|
#include <log/log.h>
|
||||||
|
|
||||||
#include <utils/RefBase.h>
|
#include <utils/RefBase.h>
|
||||||
|
#include <utils/String8.h>
|
||||||
|
|
||||||
#include <utils/Mutex.h>
|
#include <utils/Mutex.h>
|
||||||
|
|
||||||
|
|
@ -32,7 +34,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Compile with refcounting debugging enabled.
|
// Compile with refcounting debugging enabled.
|
||||||
|
#ifndef DEBUG_REFS
|
||||||
#define DEBUG_REFS 0
|
#define DEBUG_REFS 0
|
||||||
|
#endif
|
||||||
|
|
||||||
// The following three are ignored unless DEBUG_REFS is set.
|
// The following three are ignored unless DEBUG_REFS is set.
|
||||||
|
|
||||||
|
|
@ -45,7 +49,11 @@
|
||||||
|
|
||||||
// folder where stack traces are saved when DEBUG_REFS is enabled
|
// folder where stack traces are saved when DEBUG_REFS is enabled
|
||||||
// this folder needs to exist and be writable
|
// this folder needs to exist and be writable
|
||||||
|
#ifdef __ANDROID__
|
||||||
#define DEBUG_REFS_CALLSTACK_PATH "/data/debug"
|
#define DEBUG_REFS_CALLSTACK_PATH "/data/debug"
|
||||||
|
#else
|
||||||
|
#define DEBUG_REFS_CALLSTACK_PATH "."
|
||||||
|
#endif
|
||||||
|
|
||||||
// log all reference counting operations
|
// log all reference counting operations
|
||||||
#define PRINT_REFS 0
|
#define PRINT_REFS 0
|
||||||
|
|
@ -320,11 +328,11 @@ public:
|
||||||
char name[100];
|
char name[100];
|
||||||
snprintf(name, sizeof(name), DEBUG_REFS_CALLSTACK_PATH "/%p.stack",
|
snprintf(name, sizeof(name), DEBUG_REFS_CALLSTACK_PATH "/%p.stack",
|
||||||
this);
|
this);
|
||||||
int rc = open(name, O_RDWR | O_CREAT | O_APPEND, 644);
|
int rc = open(name, O_RDWR | O_CREAT | O_APPEND, 0644);
|
||||||
if (rc >= 0) {
|
if (rc >= 0) {
|
||||||
(void)write(rc, text.string(), text.length());
|
(void)write(rc, text.string(), text.length());
|
||||||
close(rc);
|
close(rc);
|
||||||
ALOGD("STACK TRACE for %p saved in %s", this, name);
|
ALOGI("STACK TRACE for %p saved in %s", this, name);
|
||||||
}
|
}
|
||||||
else ALOGE("FAILED TO PRINT STACK TRACE for %p in %s: %s", this,
|
else ALOGE("FAILED TO PRINT STACK TRACE for %p in %s: %s", this,
|
||||||
name, strerror(errno));
|
name, strerror(errno));
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,10 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <utils/Log.h>
|
#include <utils/Log.h>
|
||||||
|
|
||||||
|
#ifndef DEBUG_TOKENIZER
|
||||||
// Enables debug output for the tokenizer.
|
// Enables debug output for the tokenizer.
|
||||||
#define DEBUG_TOKENIZER 0
|
#define DEBUG_TOKENIZER 0
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue