Commit graph

205 commits

Author SHA1 Message Date
Colin Cross
9227bd3855 Move liblog headers to system/core/include/log
Move the liblog headers to log/ instead of cutils/ to complete
the separation of libcutils and liblog.  cutils/log.h still
exists and includes log/log.h in order to support the many existing
modules that use cutils/log.h.

Change-Id: I2758c9f4aedcb809ca7ba8383d0f55041dd44345
2013-07-24 12:32:39 -07:00
Nick Kralevich
f5d79aa4bb Merge "Don't use __attribute__(__error__)" 2013-06-18 20:23:29 +00:00
Nick Kralevich
bda25e4ed5 Don't use __attribute__(__error__)
__attribute(__error__) isn't supported on clang, and generates
compiler warnings. Use __errordecl instead, which does the right thing
for different compilers.

Change-Id: Ifb0797a5de703cc5b3c39dcd97bcfaf404f1cafa
2013-06-18 12:14:47 -07:00
Tobias Grosser
9ede33233f Set ATRACE_ENABLE() to '0' if not availble
Change-Id: Iec61d275cd7b2be65f828c282f97cc59adf4cc0b
2013-06-17 18:38:02 -07:00
Dima Zavin
abb7d58010 HACK: cutils: restore record_stream temporarily
Restore the record_stream code in cutils that was removed
in e00a12bf8a as part of cutils
cleanup.

Unfortunately, there are some prebuilt vendor libs that rely on
this functionality that we cannot currently rebuild.

Remove at the earliest possible convenience once the vendor libs
have been fixed.

Bug: 9189218
Change-Id: I5d44126756f1e3ed194d1b5873d64d9154183199
Signed-off-by: Dima Zavin <dima@android.com>
2013-06-04 17:40:28 +00:00
Nick Kralevich
e44c6b7183 Merge "property_get: do argument checking." 2013-05-24 21:36:30 +00:00
Nick Kralevich
1c743de2bd Merge "properties.h: avoid duplicating constant values" 2013-05-24 21:36:22 +00:00
Tim Murray
d8b11c1ddd Add ATRACE_TAG_RS.
Change-Id: Iaff497a1cb04a797441b5bb47b30ad6f09db8e95
2013-05-23 13:46:12 -07:00
Nick Kralevich
0e54ec825e property_get: do argument checking.
Try to verify, at compile time, that the supplied
value buffer is large enough.

Change-Id: I91fa560d3ceff87609194269356ac634bdbf2ede
2013-05-23 11:05:16 -07:00
Nick Kralevich
53df3ade9b properties.h: avoid duplicating constant values
Use the constant value from sys/system_properties.h,
rather than having two copies of this constant in two
different places.

This partially addresses the TODO in the header file.

Change-Id: Ic0b098cb8caf562ed2a25a0cf8cd412ba2e06884
2013-05-23 11:05:16 -07:00
Jamie Gennis
a0e780edd3 am 6e46a3b8: am a1ee12ca: Merge "libcutils: add a trace tag for Dalvik" into jb-mr2-dev
* commit '6e46a3b8e64a7a2ca4754ed7b1f9922719bd0a9b':
  libcutils: add a trace tag for Dalvik
2013-05-08 15:03:54 -07:00
Jamie Gennis
2b68e0675b libcutils: add a trace tag for Dalvik
This change adds a trace tag bit for Dalvik.  It also allows the ATRACE_*
macros to be called from code compiled for the host with no effect.

Bug: 8856374
Change-Id: I9c17129d6cc170cae00b6500485b5b5fa4b5e647
2013-05-07 15:19:34 -07:00
Dima Zavin
e00a12bf8a cutils: first pass at cleaning up legacy/obsolete code in cutils
Removed unused code and moved libraries with single clients
near their respective users.

Change-Id: I65f90f8659f27bd0f44ca5ddf33da2bce14674c1
Signed-off-by: Dima Zavin <dima@android.com>
2013-05-07 00:19:44 -07:00
Nick Kralevich
ca8e66a8b0 Make init handle reboots
Move the responsibility for rebooting the system from the
reboot command to init. Init is in a better position to take
actions to bring the system down cleanly, including making sure
filesystems are mounted read-only.

The only UIDs which can perform an init triggered reboot are
root, system, and shell.

Modify the reboot command so that it calls into init to perform
the reboot. The reboot command no longer requires CAP_SYS_BOOT.

Remove the -n reboot option and code which supports it.  Anyone needing
to do an unclean shutdown can just do a 'echo c > /proc/sysrq-trigger'.

Modify adb so that it calls into init to perform a shutdown.

Bug: 8646621
Change-Id: I84c0513acb549720cb0e8c9fcbda0050f5c396f5
2013-04-23 13:21:40 -07:00
Jamie Gennis
dcbe6b4b17 am b7b2c71b: am 25538257: Merge "cutils: add a way to disable tracing for a process" into jb-mr2-dev
* commit 'b7b2c71bf8bf685af4c716e78d5c70decab98b54':
  cutils: add a way to disable tracing for a process
2013-04-16 15:21:50 -07:00
Jamie Gennis
2553825797 Merge "cutils: add a way to disable tracing for a process" into jb-mr2-dev 2013-04-16 22:12:47 +00:00
Jamie Gennis
b13ea45a04 cutils: add a way to disable tracing for a process
This change adds the atrace_set_tracing_enabled call to libcutils.  The call
can be used to disable all tracing (of the atrace variety) for the current
process.  This is to be used to disable tracing in the Zygote process, as there
is no way for Zygote to be notified of changes to the enabled trace tags.

Change-Id: I0b691cc0dcfc65b16e3d17e1db2866a4deb253a7
2013-04-15 18:50:22 -07:00
Ken Sumrall
cb1300a255 am 3b051178: am 774814d1: Merge "klog: Have klog_write() call klog_init() if needed" into jb-mr2-dev
* commit '3b0511788c86968860a682b6652c26c4415fa222':
  klog: Have klog_write() call klog_init() if needed
2013-04-15 10:38:50 -07:00
Ken Sumrall
774814d194 Merge "klog: Have klog_write() call klog_init() if needed" into jb-mr2-dev 2013-04-15 17:33:27 +00:00
Dianne Hackborn
9bd89925ef am c08b50df: am 24bc41b7: Add new resources trace.
* commit 'c08b50dfc68504b692c13194e86d33328d373019':
  Add new resources trace.
2013-04-12 17:03:06 -07:00
Dianne Hackborn
24bc41b78c Add new resources trace.
Change-Id: I63398f282fe7bf04f1c4cefa8f602100f403fa7c
2013-04-12 14:51:43 -07:00
Ken Sumrall
7425fd1b23 klog: Have klog_write() call klog_init() if needed
Also change klog_init() to do nothing if already initialized.

Change-Id: Ia2dfe914c9d9fd119fb8939508d57b15c9884663
2013-04-11 20:03:47 -07:00
Elliott Hughes
e5f8a692e4 Modify debuggerd to cope with the abort message.
(cherry picked from commit 707b8bbe18)

Bug: 8531731
Change-Id: I2785a07ef83e085f338d3094f9972de23117807c
2013-04-05 15:59:17 -07:00
Elliott Hughes
879d21ebc3 am 8a4ae0a8: resolved conflicts for merge of f79c0518 to jb-mr2-dev-plus-aosp
* commit '8a4ae0a873862ea0a4764cd3492467843485f1e5':
  Modify debuggerd to cope with the abort message.
2013-04-05 14:36:51 -07:00
Elliott Hughes
8a4ae0a873 resolved conflicts for merge of f79c0518 to jb-mr2-dev-plus-aosp
Change-Id: I106a2aa7ec393a68e51132bf277b22bece155a8e
2013-04-05 13:46:55 -07:00
Elliott Hughes
707b8bbe18 Modify debuggerd to cope with the abort message.
Bug: 8531731
Change-Id: I416ec1da38a8a1b0d0a582ccd7c8aaa681ed4a29
2013-04-04 13:52:01 -07:00
Jamie Gennis
15311e0830 am 38e1bb86: am 774f9299: libcutils: add support for app tracing
* commit '38e1bb8617ee6b7913b9b7b7c40e43338ea5c947':
  libcutils: add support for app tracing
2013-03-28 14:04:50 -07:00
Jamie Gennis
774f929991 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
2013-03-28 20:59:31 +00:00
Ian Rogers
63c939aadc am da204c5c: am 62980e81: Inline ldrex/strex for thumb2, remove ARMv5 remnants.
* commit 'da204c5c4244ea67aacbd29c222d0a2d1c35b443':
  Inline ldrex/strex for thumb2, remove ARMv5 remnants.
2013-03-21 21:41:49 +00:00
Ian Rogers
62980e817c Inline ldrex/strex for thumb2, remove ARMv5 remnants.
We assume ARMv7 which with thumb2 has ldrex/strex operations that may be
inlined if -mthumb is defined.
Remove remnants of ARMv5 support.

(cherry picked from commit 80c3b278fd)

Change-Id: I194a3d08e933c63f79d48288d9235b4e64099340
2013-03-21 12:37:35 -07:00
Alex Ray
b178fbe67b am ee2dccf2: am 66317770: cutils: trace: add asynchronous events
* commit 'ee2dccf21b61094a0fd782d32f221804b0a7d3fa':
  cutils: trace: add asynchronous events
2013-03-19 00:30:03 +00:00
Alex Ray
66317770d3 cutils: trace: add asynchronous events
Change-Id: Ia09d34cbc6c8c85fb3d0f1a7e95de53d1b79e998
2013-03-18 13:33:38 -07:00
Alex Ray
f90fd9eeb3 cutils: bitops: Add Hamming weight to bitmask
Change-Id: I5c6b7adf711007edfffcb4fdf8e05b04bcffef54
2013-02-22 14:27:37 -08:00
Nick Kralevich
21291f1ac5 Revert "property_get: do argument checking."
This reverts commit 75cc88546b.
2013-02-04 09:49:13 -08:00
Nick Kralevich
91e63efeef Revert "Fix win_sdk build."
This reverts commit 941daef629.

Change-Id: I6b509492964baf535e0eeb1a731bf70c91715942
2013-02-04 09:48:54 -08:00
Nick Kralevich
941daef629 Fix win_sdk build.
Don't depend on sys/cdefs.h, which doesn't exist when building
for the host.Don't try to compile property_len() checking code
in mingw32, it doesn't work.

Change-Id: I6a56b759bd4e8d30d6ca136e43d6515bf7408cc6
2013-02-02 17:26:38 -08:00
Ian Rogers
80c3b278fd Inline ldrex/strex for thumb2, remove ARMv5 remnants.
We assume ARMv7 which with thumb2 has ldrex/strex operations that may be
inlined if -mthumb is defined.
Remove remnants of ARMv5 support.

Change-Id: I9bb9525ae6ff4816ba391115019d841f63c12348
2013-02-01 11:30:31 -08:00
Nick Kralevich
75cc88546b property_get: do argument checking.
Try to verify, at compile time, that the supplied
value buffer is large enough.

There's more we can do here, but this is a good first
pass.

Change-Id: Iac8153826c89114b2755735032423c6744f7a61b
2013-01-31 15:20:14 -08:00
Nick Kralevich
b94fd1abcb cutils: remove dead code.
The last caller of this code was removed in
dalvik commit eb1703442f3fc0577b3395b7eb4d55300b4125db
(https://android-review.googlesource.com/50689)

Change-Id: I3f4865c02092752a13369a3b2c3289fc9a4f6a62
2013-01-29 13:19:20 -08:00
Elliott Hughes
def8d6a706 The localtime_tz and mktime_tz extensions are now in bionic.
(cherry-pick of d03072ffde. This change
was originally committed to AOSP, is in internal master, but was somehow
lost from AOSP.)

Bug: 7012465

Conflicts:

	libcutils/Android.mk

Change-Id: I08ee8eb9b8ce5d3f9d8f2e67437d653e08697bc1
2013-01-15 11:34:08 -08:00
Alex Ray
60efde774d Merge "cutils: add simple reference counter" 2013-01-11 13:25:34 -08:00
Alex Ray
d874cc8bb9 cutils: add simple reference counter
Change-Id: Iefb34abc864cb4ca2da2f1c85c45f89af8c7fe8b
2013-01-10 15:23:55 -08:00
Alex Ray
81ec96df4f cutils: bitops: add include for bool
Change-Id: I3eca5a7c1f5ec66ded1229ccb6ca1dbb5d608ffd
2013-01-07 16:58:01 -08:00
Alex Ray
2111bc7b28 cutils: Add bitmask utilities to bitops
Bitmask utils handle resource tracking using a (multi-word) bitmask.

Change-Id: I2ae45df1ac8c665c29ea9cae32a757168686b96c
2013-01-07 13:02:28 -08:00
Wink Saville
bf866aeda1 Merge "Add RLOGx" 2012-12-12 08:22:02 -08:00
Ben Cheng
26f447f5da am 7f692fe6: am 523e21d3: Merge "Fail-proof the inline directives for SMP atomic operations."
* commit '7f692fe6448049dca2795d7d648615a2dc7a500c':
  Fail-proof the inline directives for SMP atomic operations.
2012-12-07 14:37:04 -08:00
Ben Cheng
5206d59712 Fail-proof the inline directives for SMP atomic operations.
The various atomic operations are declared as inline in the header files
to cut the function call overhead. However, the plain inline keyword is
just a suggestion to the compiler which makes its own decision on whether
to inline them or not. Worst, if they are not inlined, the
-fvisibility-inlines-hidden compiler flag will render them as hidden
symbols in the object file. If they are picked up by the linker over the
ones supplied in libcutils.so the following warning will be reported:

warning: hidden symbol 'android_atomic_inc' in foo.o is referenced by
DSO bar.so

One way is to add __attribute__((visibility("default"))) to those inline
functions to suppress the linker warnings. A better way is to force
inlining as with this patch.

Change-Id: Ie4fcfdfaaf06f42d351619a0d89671a9df15ca2f
2012-12-07 11:07:10 -08:00
Wink Saville
9d7ad45eff Add RLOGx
This will eventually allow us to remove the code in
logd_write.c#__android_log_write which uses the tag
to direct logs to the radio buffer.

Change-Id: Ic992c0b8d1cf000b1814dc7786d2a40becf75eaf
2012-12-06 10:20:27 -08:00
Alex Ray
448f76a1c4 cutils: trace: use ANDROID_SMP to switch atomics
With inline atomics, trace functions have no non-inline function calls
in the fast (tracing off) path.  To enable this, ANDROID_SMP must be
defined for the project.  Otherwise, normal (non-inline) atomics are
used.

Change-Id: Id1f75bdf7db2f5d319a389ad411f55073d78c48c
2012-11-30 19:40:58 -08:00
Alex Ray
e7bb7bca4f cutils: trace: add atrace_update_tags()
Adds a function to read the current trace system property value, and
sets the trace tags to it, do be used as a sysprop change callback.

Change-Id: Ia6336652173aa5b07188898736c2c795a69fe79a
2012-11-28 13:56:49 -08:00