Commit graph

6211 commits

Author SHA1 Message Date
Alex Ray
d98e07fdf9 move libs/utils to libutils
Change-Id: I6cf4268599460791414882f91eeb88a992fbd29d
2013-08-02 14:40:08 -07:00
Dmitry Shmidt
be06210c50 libnetutils: Get mtu together with dhcp session results
Change-Id: I517fd1f62d451b07466a21a2b770d9ce389dac19
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2013-08-02 14:09:09 -07:00
Eino-Ville Talvala
b4802413a7 Merge "Window: Add query for consumer usage bits." 2013-08-02 00:23:02 +00:00
Mathias Agopian
ddff623049 minor tweaks to FlattenableUtils
Change-Id: Ibfceec36434baac92c8815a18d902375d3fa1a6d
2013-08-01 12:47:58 -07:00
Dianne Hackborn
0f10d0abf3 Add a new utf8-to-utf16 conversion function.
Change-Id: I957c22fb219596ca4239db7a169473d3894b09eb
2013-07-31 16:04:39 -07:00
Alex Ray
d43eae5e39 Merge remote-tracking branch 'goog/libutils-import' into HEAD 2013-07-31 13:47:17 -07:00
Brian Carlstrom
5189f9a263 Fix BlobCache_test
Change-Id: I5b20aeb4dcff80f1e18e1165b8461d20034dc1ac
2013-07-31 13:41:50 -07:00
Mathias Agopian
6d611a891d Make Flattenable not virtual (libutils)
Making an object Flattenable doesn't force it to
become virtual anymore. For instance, Fence and GraphicBuffer
are now non-virtual classes.

Also change Flatennable protocol a bit so that it updates
its parameters (pointers, sizes) to make it easier
to implement a flattenable in terms of other flattenables.

Change-Id: Ie81dc7637180b3c2cfcbaf644f8987ca804eb891
2013-07-31 13:41:41 -07:00
Eino-Ville Talvala
f88a5b4f88 Window: Add query for consumer usage bits.
Bug: 9592202
Change-Id: Ied2fdb985dc59dd9c0f26c515353abdc37f0eb77
2013-07-30 21:38:13 +00:00
Alex Ray
0d8f3d6c45 libutils: give BasicHashtableImpl a virtual destructor
Change-Id: I4ec590b060d732af5fe525670becbe778684247b
2013-07-30 13:57:01 -07:00
Colin Cross
946003ae64 add static dependency on liblog
Change-Id: Ibf8733142d52e4ffac2e3b26932d7196fb79c5a7
2013-07-30 13:57:01 -07:00
Alex Ray
567ea471ff utils: move thread enums to system/core
Change-Id: Ia97963cc9acf8661d01355786f5e7e7bf54581c2
2013-07-30 13:57:01 -07:00
Michael Wright
d614ee4557 Added bitwise-or and bitwise-and to BitSet
Change-Id: I9bbf41f9d2d4a2593b0e6d7d8be7e283f985bade
2013-07-30 13:57:01 -07:00
Tim Murray
214c701ec6 Make trace macros slightly more robust
Change-Id: I9544eb7b27fc1a971cabadd8d5b4b4b80678febf
2013-07-30 13:57:01 -07:00
Nick Kralevich
e45a9acd63 Remove unnecessary header file.
In b2cac4ff37ed2a3521efb307b807b12f649634b8, the last
reference to property_get was removed, but the include
file remained. Remove it.

This is causing me unrelated problems.

Change-Id: I87bbfbfa5871f6da4a1b00037a225f67bbd75881
2013-07-30 13:57:01 -07:00
Mathias Agopian
8db925f777 remove unused declarations and reformat
Change-Id: I4e168fb62c275e02621c4b6e0c6000d0f006c327
2013-07-30 13:57:01 -07:00
Mathias Agopian
d3d3fceb7c remove reserved virtual slots
these consume small amount of space (plt) in every library that
links against libutils.

Change-Id: I1b6b3dd9098aa5a051243f7a5dbf91cd7dcb8b2c
2013-07-30 13:57:01 -07:00
Mathias Agopian
4485d0d966 new String8, String16 ctors to initialize empty static strings with static linkage
when libutils is statically linked, the ordering of the static
initializer is not guaranteed and therefore it's unsafe to use
empty static strings: e.g.:

static String8 sThisStaticStringIsNotSafe;

instead, this new constructor can be used:

static String8 sThisStaticStringIsSafe(kEmptyString);

Change-Id: Ia3daf1cab1c97d021c0ee9c2b394b5e27e8d6c0d
2013-07-30 13:57:01 -07:00
Mathias Agopian
9eb2a3b1c0 libutils clean-up
Change-Id: I6ff4cfc736751de2912c697f954e45e275f2d386
2013-07-30 13:57:01 -07:00
Dianne Hackborn
19159f9002 Add new Looper API to check whether the looper is idle.
This is just to support the watchdog to give it a faster
way to determine if a thread is deadlocked without having
to post a message to it.

Change-Id: I068dc8b9387caf94fe5811fb4aeb0f9b57b1a080
2013-07-30 13:57:01 -07:00
Todd Poynor
d9ad7d8d73 String8: ensure static init done prior to empty string reference
Avoid NULL deref on static initialization of empty String8 objects prior
to libutils static init.

Change-Id: I3d420041ba62b97ed8c2dfd2532a2dcd72b84ff1
2013-07-30 13:57:01 -07:00
Bjorn Bringert
00c14b4be4 Build a static device libutils
This is needed to make tools such as aapt more compatible when
built for the device.

Change-Id: I1261d47b6e24595f1be547b9202892863f66a1de
2013-07-30 13:57:01 -07:00
Mathias Agopian
d34a8cad1e improved CallStack a bit
- added a ctor that updates and dumps the stack immediately
- added a "logtag" parameter to dump()

Change-Id: Ie51c256071d282591752243bdb4f68cf9ff8829d
2013-07-30 13:57:01 -07:00
Mathias Agopian
da8ec4b634 disable RefBase consistency checks (NDEBUG)
Bug: 8328715
Change-Id: Ib57646ff909fd8744610f37f3b50d90d884dff31
2013-07-30 13:57:01 -07:00
Mathias Agopian
6cd548c715 Fix a crasher with RefBase debugging and vectors of wp<>
background:
we have some code to fix-up the IDs of references when
using RefBase's DEBUG_REFS when those refs are managed by
arrays wp<> or sp<> (this is because wp<> / sp<> don't have
a trivial ctor when DEBUG_REFS is enabled, and Vector
treats them as trivial for obvious performance reasons)

this is complicated by the fact that we don't want to have
to recompile everything when enabling DEBUG_REFs (i.e.: the
Vector code cannot know wheter it's enabled or not for its
template stuff).

problem:
there was a bug in the fix-up code for wp<> which was trying
to access the weakref_impl from the RefBase* however, this was
moronic since RefBase could have been destroyed if there wasn't
any more strong refs -- and this happned. Instead we need to get
the weakref_impl directly from the wp<>

Change-Id: Ie16e334204205fdbff142acb9faff8479a78450b
2013-07-30 13:57:01 -07:00
Mathias Agopian
6d4419d9b1 A few tweaks to RefBase debugging
- stacks are now saved in /data/debug which must be
  created and writable by the user.

- removed "always fatal" DEBUG_REFS option, it wasn't
  really needed.

- DEBUG_REFS_ENABLED_BY_DEFAULT is not the default anymore
  (usually people want to target which refs they're tracking)

Change-Id: I37fae72e9dacde6ce1fa8f7dbe2bc01b1a1b95e5
2013-07-30 13:57:01 -07:00
Jesse Hall
b73559d86c Add Vector::resize()
Bug: 8384764
Change-Id: Icee83d389f3e555eba7d419b64c8d52a9aa21b8b
2013-07-30 13:57:01 -07:00
Dianne Hackborn
a729ab1e3b fix a couple race-conditions in RefBase::promote()
Bug: 8390295
Change-Id: I7a48e3bf5b213cc1da2b8e844c6bb37ee24cb047
2013-07-30 13:57:01 -07:00
Mathias Agopian
8a4cdbcdb9 temporary: enable ASSERTs in RefBase
this is in an attempt to get more data on
bug 8328715.

Change-Id: I9333a67c2d7f67f4d9b2fc5eb1ad8a7b2d1c6dcb
2013-07-30 13:57:01 -07:00
Romain Guy
31ba37f1c8 Add Thread::isRunning and Condition::signal(WakeUpType)
The signal() method is useful to choose whether to wake up one or
all threads.

Change-Id: I062ab6d3ddd306a9fb735549ea140e2a76eed75a
2013-07-30 13:57:01 -07:00
Mathias Agopian
6090df85a8 rename binder services main thread to Binder_*
When a binder service's main thread joins the thread pool
it retains its name (whatever the exec name was), which is
very confusing in systrace.

we now rename that thread just like its friends in the
thread pool.

Change-Id: Ibb3b6ff07304b247cfc6fb1694e72350c579513e
2013-07-30 13:57:01 -07:00
Mathias Agopian
769828d2d4 Fix RefBase debugging. O_CREAT must specify the mode.
Change-Id: I51c6df3cfd59b20ca73c3edee86bc2f74dbde1b1
2013-07-30 13:57:00 -07:00
Naseer Ahmed
ca3e2a276a utils: Allow non android namespaces to use ALOGD_IF_SLOW
Change-Id: I9207b64954fae2f56cc5f6aa5796a2e737400623
2013-07-30 13:57:00 -07:00
Nick Kralevich
d30884aa0c Revert "try to fix win_sdk build."
A better change was checked into system/core. See commit
941daef629

This reverts commit fa99d30ec773c5f9653d96570fb8961426bfe966.
2013-07-30 13:57:00 -07:00
Nick Kralevich
0656c9764a try to fix win_sdk build.
Change-Id: I55e78e339874a6d6a3381c2550556b65c7ec1ca0
2013-07-30 13:57:00 -07:00
Marco Nelissen
99ec303e45 Add NULL check to CallStack::toString
CallStack::toString() has a 0 default argument, which ends up getting
passed to strlen(), resulting in a crash.

Change-Id: If706aff8c400983670f49cdbb66e11191ac76e0e
2013-07-30 13:57:00 -07:00
Chris Craik
551fcf4fe3 Add LinearAllocator
Moving from external/webkit/Source/WebCore/platform/graphics/android/utils/

Change-Id: If91830aa9b207dbc8692b2ca7c4a0b76778addd5
2013-07-30 13:57:00 -07:00
Igor Murashkin
a27c1e0839 utils: fix warnings for unused parameters
Change-Id: Ibfb755a30ba2923669060fe0aed019beecbe38a1
2013-07-30 13:57:00 -07:00
Alex Ray
fcb349ff75 utils: clarify scoped tracing functionality
ScopedTrace objects were being used in place of ATRACE_NAME because of a
misunderstanding of it's function.  Cleared up documentation for usage.

Also explicitly use global namespace for sysprop callback.

Change-Id: I7c248b486b614ccdb841659ca0dcfc644fda670a
2013-07-30 13:57:00 -07:00
Chad Jones
0a19c906f2 Remove copy of atrace imported to wrong location 2013-07-30 13:57:00 -07:00
Alex Ray
5b2d36e38a utils: Use cutils tracing functionality.
Tracing functionality has moved to cutils.

Change-Id: Ie78ccc1d59dd5178f5058fbc3858a37f9adce552
2013-07-30 13:57:00 -07:00
Romain Guy
5ca402a4e2 Add LruCache::Iterator
Required by libhwui

Change-Id: I164b9a4a82d89d132da01a56535c0df084de86f7
2013-07-30 13:57:00 -07:00
Romain Guy
bdce9baa88 Add another ifndef and a couple of methods to LruCache
The new methods on LruCache are needed by libhwui to manage
the cache of paths.

Change-Id: If54fa325c54e2b04e7fe5dfe6dad66066c40127c
2013-07-30 13:57:00 -07:00
Romain Guy
b3176acd5f Add #ifndef to prevent multiple definitions
Change-Id: Ib861eee0f333fe29290437b7e67623622d8dabd0
2013-07-30 13:57:00 -07:00
Andy McFadden
45ad8f44d0 Reduce emulator logspam
The emulator doesn't support systrace, but we should point that out
at most once per process.

Bug 7436352

Change-Id: I06b2c1ea0df6c02c11cd2496423c337f8d7c62a1
2013-07-30 13:57:00 -07:00
Raph Levien
b6ea175b6b Add an LRU cache plus hashing primitives
This patch adds a hashtable-based LRU cache. This should be
significantly higher performance than the GenerationCache it is intended
to replace. It is a large part of the fix for bug 7271109
TextLayoutCache low-level performance issues.

We added a new method to BasicHashtable to detect when rehashing is
needed, because the internal linked list pointers would get invalidated
by that rehashing.

Also, the hash_type specialized to pointers had a small flaw.

Change-Id: I950c2083f96519777b851dbe157100e0a334caec
2013-07-30 13:57:00 -07:00
Glenn Kasten
fe34e45c21 Continue removing property debug.sys.noschedgroups
Also 0 means gettid() for get_sched_policy() and set_sched_policy().

Change-Id: Ic12edc3df6c9b3e99eae5cffaf9f6fe56cf14043
2013-07-30 13:57:00 -07:00
Jason Simmons
61db1669f4 Ensure that Vector::erase() returns a valid iterator
Vector::erase may reallocate the Vector's storage while removing an element.
However, erase() calls begin() before calling removeItemsAt(), thus caching
a pointer the the Vector's old storage.  If the storage is reallocated,
the iterator returned by erase() will be based on the old storage pointer
and will thus be invalid.

Change-Id: I2450c55fd418e6b1c558a4ca7c024573abbaa098
2013-07-30 13:57:00 -07:00
Dave Burke
d49555291a Revert "Revert "put back the unused virtuals in Vector<>""
This reverts commit 225c66a48cdc3acef21ee380dc134449749d3cb3

Change-Id: If31a04b81052cbc7dd7bf237c07107c33066d03d
2013-07-30 13:57:00 -07:00
Romain Guy
3fc49adfd2 Add runtime debugging capabilities to OpenGL
The shell property debug.egl.trace can now be set to:

0
  disables tracing
1
  logs all GL calls
error
  checks glGetError after every GL call, logs a stack trace on error
systrace
  logs each GL call to systrace

Change-Id: I34a2a2d4e19c373fd9eaa1b0cd93e67c87378996
2013-07-30 13:57:00 -07:00