diff options
| author | Jamie Gennis <jgennis@google.com> | 2013-02-25 18:15:40 -0800 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-03-28 20:59:31 +0000 |
| commit | 774f9299912cdf9f2a6b3805bb557e30bafbad05 (patch) | |
| tree | 6ab88f971e07d3048fdaa57ce7b59ee8d603b25c /include | |
| parent | de97f798a1c24303de35ff44e2f47b590b46a815 (diff) | |
| download | system_core-774f9299912cdf9f2a6b3805bb557e30bafbad05.zip system_core-774f9299912cdf9f2a6b3805bb557e30bafbad05.tar.gz system_core-774f9299912cdf9f2a6b3805bb557e30bafbad05.tar.bz2 | |
libcutils: add support for app tracing
This change adds support for tracing using the ATRACE_TAG_APP tag. This tag is
enabled only for processes in which the /proc/<pid>/cmdline value appears in
the comma-separated list of such values in the debug.atrace.app_cmdlines system
property. It is also only enabled if either the ro.debuggable system property
is set to 1 or the application has declared itself debuggable in its manifest,
which gets reported to libcutils by the framework.
Change-Id: Ic94ba55f4e70a9cf994056acbf151e523428b65d
Diffstat (limited to 'include')
| -rw-r--r-- | include/cutils/trace.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/cutils/trace.h b/include/cutils/trace.h index ad65dfb..55aabdd 100644 --- a/include/cutils/trace.h +++ b/include/cutils/trace.h @@ -20,6 +20,7 @@ #include <sys/cdefs.h> #include <sys/types.h> #include <stdint.h> +#include <stdbool.h> #include <unistd.h> #include <cutils/compiler.h> @@ -62,7 +63,8 @@ __BEGIN_DECLS #define ATRACE_TAG_VIDEO (1<<9) #define ATRACE_TAG_CAMERA (1<<10) #define ATRACE_TAG_HAL (1<<11) -#define ATRACE_TAG_LAST ATRACE_TAG_HAL +#define ATRACE_TAG_APP (1<<12) +#define ATRACE_TAG_LAST ATRACE_TAG_APP // Reserved for initialization. #define ATRACE_TAG_NOT_READY (1LL<<63) @@ -97,6 +99,14 @@ void atrace_setup(); void atrace_update_tags(); /** + * Set whether the process is debuggable. By default the process is not + * considered debuggable. If the process is not debuggable then application- + * level tracing is not allowed unless the ro.debuggable system property is + * set to '1'. + */ +void atrace_set_debuggable(bool debuggable); + +/** * Flag indicating whether setup has been completed, initialized to 0. * Nonzero indicates setup has completed. * Note: This does NOT indicate whether or not setup was successful. |
