summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* private: Add event payload structures to android_logger.hMark Salyzyn2015-03-041-0/+42
| | | | | | | | | | | | - common android_event_header_t - android_event_int_t ANDROID_TYPE_INT payload - android_log_event_int_t single ANDROID_TYPE_INT event - android_event_long_t ANDROID_TYPE_LONG payload - android_log_event_long_t single ANDROID_TYPE_LONG event - android_event_string_t ANDROID_TYPE_STRING payload - android_log_event_string_t single ANDROID_TYPE_STRING event Change-Id: I9e5fccba38e3f230c2c4ec7dec51ed110c460f95
* liblog: add pstore readMark Salyzyn2015-02-261-0/+1
| | | | | | | | | | | Used to pull the Android log messages after a reboot. Adding an ANDROID_LOG_PSTORE flag to the mode parameter in calls to android_logger_list_alloc() and android_logger_list_alloc_time(). The side effects are that android_logger_clear() and android_logger_list_read() will react with the user space pstore driver. Forms a companion to the pstore console logs. Change-Id: I7bb07b87b3bf73f059a21af3f810af37c7715b6d
* liblog: introduce ANDROID_LOG_* flagsMark Salyzyn2015-02-251-0/+6
| | | | | | | | Move away from using POSIX open(2) flags and introduce ANDROID_LOG_* flags to replace them. Add security by preventing random mode flags from getting into underlying POSIX calls. ANDROID_LOG_* flags overlap POSIX O_* flag definitions. Change-Id: Ib32bb64c287e8bf150be62242e1ba46bb37839fc
* Remove useless refCounting from FileMap.Narayan Kamath2015-02-231-16/+2
| | | | | | | | | Nobody ever called acquire() so release() was always equivalent to delete. Just use delete instead so that people can use unique_ptr directly (or shared_ptr if they really want refcounts). Change-Id: I9e3ad5e0f6a4fcc4e02e5a2ff7ef9514fe234415
* log.h: Fix typoAndreas Gampe2015-02-091-1/+1
| | | | Change-Id: I6b5e9bc9d40e5e5ecf9f50f7392675391e6f18e6
* log.h: wrap android_testLog around __android_log_is_loggableMark Salyzyn2015-02-091-1/+16
| | | | | | | | | | | | | | | | - take android_testLog from the bonepile and resurrect - android_testLog is used, and makes sense in its current context as a holder for Android Logging policy. - Default level when not specified is ANDROID_LOG_VERBOSE for eng and userdebug, and ANDROID_LOG_DEBUG for user. NB: Properties, which are associated with __android_log_is_loggable are not to be adjusted in user release; it would be useful at that juncture to return a constant of (0) for VERBOSE, and a (1) for others on user builds. Or default level to drop to ANDROID_LOG_DEBUG for all in future. Bug: 17760225 Change-Id: I420b5b8a94d53d664c6a8b13546ebc424a147923
* log.h: deprecate CONDITIONMark Salyzyn2015-02-091-31/+39
| | | | | | - replace CONDITION with __predict_false to match with bionic Change-Id: Ica23fe41cf9a7ea5eaf1b8552780af9ec7827808
* liblog: add __android_log_is_loggable()Mark Salyzyn2015-02-091-0/+6
| | | | | | | | | - Add new liblog API __android_log_is_loggable(prio, tag, def) - future plan to integrate this into the runtime checks and into the logd daemon for filtration. Inert for now. Bug: 17760225 Change-Id: I16395b4d42acc08f0209f55a1cbf87b0b2112898
* Merge "Move map data into backtrace data proper."Christopher Ferris2015-02-062-8/+15
|\
| * Move map data into backtrace data proper.Christopher Ferris2015-02-062-8/+15
| | | | | | | | | | | | | | | | | | | | | | The backtrace structure used to include a pointer to a backtrace_map_t that represented the map data for a particular pc. This introduced a race condition where the pointer could be discarded, but the backtrace structure still contained a pointer to garbage memory. Now all of the map information is right in the structure. Bug: 19028453 Change-Id: If7088a73f3c6bf1f3bc8cdd2bb4b62e7cab831c0
* | Clean up reading and writing in init.Elliott Hughes2015-02-061-0/+3
|/ | | | | | | | | | | | | This isn't particularly useful in and of itself, but it does introduce the first (trivial) unit test, improves the documentation (including details about how to debug init crashes), and made me aware of how unpleasant the existing parser is. I also fixed a bug in passing --- unless you thought the "peboot" and "pm" commands were features... Bug: 19217569 Change-Id: I6ab76129a543ce3ed3dab52ef2c638009874c3de
* Fix Windows build.Elliott Hughes2015-02-051-0/+3
| | | | | | | Take 2. Probably should have done this in the beginning, but thought I was being clever. Change-Id: I85c6e487eece9bcc75f8f62c850c2d4d1ee9e908
* Add a WriteStringToFile overload that cares about permissions.Elliott Hughes2015-02-041-0/+3
| | | | Change-Id: I857a80b61768d4e9610bdd149eff2d9d8e48d2c0
* android_reboot should take a const char*.Elliott Hughes2015-02-031-1/+1
| | | | | | The kernel argument is actually a void*, but it's only read from. Change-Id: I305c50249bf12b7fbdea4721257aed52a0372f8d
* Merge "Add Google-style StringPrintf."Elliott Hughes2015-02-031-0/+38
|\
| * Add Google-style StringPrintf.Elliott Hughes2015-02-031-0/+38
| | | | | | | | Change-Id: If333c28b8ed047346a2dd85e591c4bedbab874cc
* | Extra Win32 compatibility.Elliott Hughes2015-02-031-0/+6
|/ | | | Change-Id: Ibc583aba580f4fc15c243f495ead44b2ce4c6e5e
* Add Google-style ReadFileToString and WriteStringToFile.Elliott Hughes2015-02-031-0/+29
| | | | | Bug: 19217569 Change-Id: I64789d3fa6777ee30a324cdf00fdc275c1230e1b
* Add close_file flag to OpenArchiveFd()Dmitriy Ivanov2015-01-301-1/+4
| | | | | | * We should be able to keep fd alive after CloseArchive() Change-Id: I1aa2c039bb2a590ae72f256acc9ba5401c2c59b1
* Kill HAVE_PTHREADS.Yabin Cui2015-01-278-36/+33
| | | | | Bug: 19083585 Change-Id: Ic09eb3dd250bc5c5b63cac7998f99f5fa007f407
* liblog: add pstore writeMark Salyzyn2015-01-231-1/+11
| | | | | | | Used to push the Android log messages into pstore (when available, and no propagation of error). Change-Id: I9def8cf796d35d347f502d9745d5f42ec1200253
* logd: create private/android_logger.hMark Salyzyn2015-01-231-0/+34
| | | | | | | | | - create a structure to depict the private header expected at logd end of socket. - utilize this new structure instead of unscalable byte stream technique used to unpack in logd. Change-Id: I2d0e5c3531c279f2dc1fbd74807210ff8d804de0
* Move 32 bit/64 bit check into debuggerd.Christopher Ferris2015-01-201-27/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | On 64 bit systems, calls to dump_backtrace_to_file or dump_tombstone try and directly contact the correct debuggerd (32 bit vs 64 bit) by reading the elf information for the executable. Unfortunately, system_server makes a call to dump_backtrace_to_file and it doesn't have permissions to read the executable data, so it defaults to always contacting the 64 bit debuggerd. This CL changes the code so that all dump requests go to the 64 bit debuggerd, which reads the elf information and redirects requests for 32 bit processes to the 32 bit debuggerd. Testing: - Forced the watchdog code in system_server to dump stacks and verified that all native stacks are dumped correctly. - Verified that dumpstate and bugreport still properly dump the native processes on a 64 bit and 32 bit system. - Intentionally forced the 64 bit to 32 bit redirect to write only a byte at a time and verified there are no errors, and no dropped data. - Used debuggerd and debuggerd64 to dump 32 bit and 64 bit processes seemlessly. - Used debuggerd on a 32 bit system to dump native stacks. Bug: https://code.google.com/p/android/issues/detail?id=97024 Change-Id: Ie01945153bdc1c4ded696c7334b61d58575314d1
* Remove unused cruft from libcutils.Elliott Hughes2015-01-151-34/+0
| | | | Change-Id: I316d39e8e0a9aa385d8e1f37678b8bf2c03441eb
* Merge "Extend to receive NFLOG packets."Jeff Sharkey2015-01-163-0/+3
|\
| * Extend to receive NFLOG packets.Jeff Sharkey2015-01-153-0/+3
| | | | | | | | | | | | | | | | | | Packets captured and logged by the NFLOG target are unicast, so extend to catch and decode them. To avoid escaping issues, the raw contents are passed around as hex strings. Bug: 18335678 Change-Id: Ib7299500baa00080a1f000f9da843eb527363353
* | Add timed versions of stack dumping functions.Christopher Ferris2015-01-151-0/+15
|/ | | | | | | | | | | | | Under some unknown circumstances, debuggerd could become unresponsive. If you try and take a bugreport during this time, it will hang forever. Adding functions that have a timeout will allow dumpstate to stop if dumping is taking too long. Bug: 18766581 (cherry picked from commit 5f2ff6a9106083e2a79b8600a0bf6a5341c6ca38) Change-Id: I39e8e9c60209e3ef9efac795fedb8e1edce2bd3e
* Add required casts for clang/llvm -Wc++11-narrowingChih-Hung Hsieh2015-01-121-2/+2
| | | | | | | | | | | | system/core/include/utils/Mutex.h:134:25: error: non-constant-expression cannot be narrowed from type 'long long' to '__kernel_time_t' (aka 'long') in initializer list [-Wc++11-narrowing] system/core/include/utils/Mutex.h:135:26: error: non-constant-expression cannot be narrowed from type 'long long' to 'long' in initializer list [-Wc++11-narrowing] Change-Id: Icb9df26aeb01617da5ab1c36987289f7c2b11954
* Remove HAVE_LIBC_SYSTEM_PROPERTIES and HAVE_SYSTEM_PROPERTY_SERVER.Elliott Hughes2015-01-121-16/+0
| | | | Change-Id: I3d92dbecebd2bb449a8c4332de684919a58847ad
* Linux always has POSIX clocks available.Elliott Hughes2015-01-091-3/+3
| | | | | | | pixelflinger doesn't have to run on the Mac, but the Condition code might. Change-Id: Ib4e9b4daa6e848ffd5742959427b172d45f08e3c
* You either have winsock or <sys/sockets.h>.Elliott Hughes2015-01-091-1/+1
| | | | | | There is no third choice. Change-Id: I8f1206f22798f747896dd53f3081cdfa4b1707c4
* Merge "Mutex: add timedLock() method"Jesse Hall2015-01-071-4/+24
|\
| * Mutex: add timedLock() methodJesse Hall2015-01-071-4/+24
| | | | | | | | | | | | | | | | This is not available for host builds because OSX doesn't have pthread_mutex_timedlock() or equivalent. Bug: 18842510 Change-Id: I072e74ab1a6f770fd245828b39c5f954dda1113b
* | liblog: Add log_time += operatorMark Salyzyn2015-01-051-0/+12
|/ | | | Change-Id: I1d2987b6cb333fc344d4fee1b7bb25f32a4143c6
* Merge "Remove incompatible Unicode compatibility types."Dan Albert2014-12-121-6/+0
|\
| * Remove incompatible Unicode compatibility types.Dan Albert2014-11-201-6/+0
| | | | | | | | | | | | | | | | | | | | | | As well intentioned as these were, uint16_t and C++11's char16_t are _not_ actually compatible. They are not implicitly convertible, and they mangle differently, so they are not even ABI compatible. In our now wonderous world of C++11, no one should be using these, so just kill them. Bug: 18300613 Change-Id: I06d92d7f1d937dd94a620874323d4c50eb6a31bd
* | Use full qualified name in macros.Chih-Hung Hsieh2014-12-111-3/+4
| | | | | | | | | | | | | | | | | | The ANDROID_SINGLETON_STATIC_INSTANCE is used in some files out of the android namespace. If it does not use full qualified names, users of this macro will need to use it inside the 'android' namespace to avoid warnings from clang compiler. Change-Id: Ie4d4ba2b57fdc72d0deb3b7c2326304a44a1300f
* | Only Windows doesn't have <sys/uio.h>.Elliott Hughes2014-11-251-5/+8
| | | | | | | | | | | | | | This should probably be in libcutils instead, so code that needs to care about Windows can use readv/writev. Change-Id: I7c2ceec3f742cee0e44f69fd4c88459376bd0e08
* | Remove long-dead readtty.Elliott Hughes2014-11-241-1/+0
| | | | | | | | Change-Id: I15ae14542214a3802d43892da0d03cfb33e63c96
* | Fix Mac build.Elliott Hughes2014-11-221-1/+1
| | | | | | | | Change-Id: Iae697ae257cf4b1d675e2b758dd31d5a6a71ae4d
* | Kill HAVE_BIG_ENDIAN, HAVE_ENDIAN_H, and HAVE_LITTLE_ENDIAN.Elliott Hughes2014-11-211-10/+5
| | | | | | | | Change-Id: I9e25ac9d27e95b04fb8bf7a66c619af0139d8b8f
* | Add a pre-C++11 constexpr compatibility macro.Dan Albert2014-11-201-0/+11
|/ | | | | | | | | Needed for cases where something should be constexpr if possible, but not being constexpr is fine if in pre-C++11 code (such as a const static float member variable). Bug: 18466763 Change-Id: I635d062575ba2fbc4cbe3a89f730128c404d95e1
* Remove atomic-inline.h.Elliott Hughes2014-11-173-21/+2
| | | | Change-Id: I3ac0229b9c516744e6a9c9d9e795b43bc9c5636b
* Remove the error-prone TARGET_CPU_SMP from system/core.Elliott Hughes2014-11-172-8/+0
| | | | | | | | This means that code that uses libcutils no longer has to ensure that it's set ANDROID_SMP in the calling code's Android.mk for this to function correctly. Change-Id: I80c7ff170cd621106f34d6b74689d6b4f03e4eb7
* Second attempt to "Rewrite atomic.h to use stdatomic.h."Hans Boehm2014-11-138-1039/+112
| | | | | | | | | | | | This should not be committed until win_sdk and aarch64 builds are fixed in the presence of this CL. This reverts commit 2789faabfa9cdf16902a52a1de3fc4a7ae98efed. We additionally remove uniprocessor support from the earlier CL, thus avoiding a potential compiler code reordering issue. Change-Id: I7207a5ca2efa907a6f757f172d7090a62b2311fe
* kill HAVE_POSIX_FILEMAPYabin Cui2014-11-111-2/+2
| | | | | Bug: 18315579 Change-Id: I0bd5fb946b12cb90e0c9c73a478df41609b8c3e2
* Merge "Reserve some AIDs for OEMs"Nick Kralevich2014-11-101-0/+5
|\
| * Reserve some AIDs for OEMsJohan Redestig2014-11-101-0/+5
| | | | | | | | | | | | | | OEMs frequently add some AIDs on their own. Reserve some range for them to use. Change-Id: I3c729c889c9bd3e105ae4f6fb0c04a42a10eb25c
* | Merge "Move winsock2.h in front of a potential windows.h include."Stephen Hines2014-11-091-0/+4
|\ \
| * | Move winsock2.h in front of a potential windows.h include.Stephen Hines2014-11-081-0/+4
| |/ | | | | | | | | | | | | | | | | | | | | Files that included FileMap.h (possibly transitively), before including ByteOrder.h (which pulls in winsock2.h directly), will experience a compiler warning/error from the latest mingw headers. This happens because the headers require that winsock2.h come before windows.h in all cases. The simplest (and most error-proof) fix for now is to include winsock2.h before this use of windows.h. Change-Id: I33069e4c9962d9820d0ea5976554f89d7ff6307c