Commit graph

13 commits

Author SHA1 Message Date
Steven Moreland
066e625b6b libutils: use log/log.h internally
utils/Log.h is one less file we need if we're
splitting up this library for binder.

Bug: 302720583
Test: build
Change-Id: Ibc7ec5402df342627f465354d7cf59e98f450a31
2023-10-07 00:29:44 +00:00
Suprabh Shukla
a55ef96ea7 Add uptimeNanos to SystemClock
Test: system/core/libutils/SystemClock_test.cpp

Bug: 162791194
Change-Id: I0e3ea2004146eb7442c89bb35a9f3a2171d9c4b8
2020-08-07 14:36:07 -07:00
Jiyong Park
bab16584ce Don't rely on transitively included headers
One must explicitly include what it need.
time.h for clock_gettime

Bug: 37629934
Test: build
Change-Id: I992eac637f373b204aa161b0b26f5563e952c27e
2017-09-06 13:04:57 +09:00
Mathias Agopian
22dbf3947f clean-up libutils includes
moved Foo.h as first include of Foo.cpp, and
removed redundant includes.

Made NativeHandle non virtual.


Test: run & compile
Bug: n/a

Change-Id: I37fa746cd42c9ba23aba181f84cb6c619386406a
2017-03-03 14:47:47 -08:00
Greg Hackmann
e94c92cd48 SystemClock: elapsedRealtimeNano() should use clock_gettime() on Linux
We've removed the Android alarm driver from our supported kernels.
clock_gettime(CLOCK_BOOTTIME) has been a viable option since 2.6.39, so
there's no need for the legacy code path anymore.

We can use this on Linux hosts too, since no one should be building
Android on hosts with kernels that old.

Bug: 28357356

Change-Id: I0aa164383c95e77c53d2c85883d83f85d4abc7b1
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2016-05-02 14:00:02 -07:00
Elliott Hughes
ad19af7132 Remove debugging code for a fixed 3.6 kernel bug.
Change-Id: If17d41d6151cd7b81677afc5d341d7aa788170e4
2016-04-04 16:06:53 -07:00
Elliott Hughes
9b828adfad Use __ANDROID__ instead of HAVE_ANDROID_OS.
Change-Id: I9967f3fd758c2a5b40be5b60ae72be7e2fb75136
2015-07-30 09:33:43 -07:00
Elliott Hughes
6ed68cc412 Consistently use strerror in libutils.
It's easier for people to debug, and side-steps the problem that errno
values differ between architectures.

Bug: http://b/17458391
Change-Id: I1db9b2cbb653839d3936b91e37e5cff02671318a
2015-06-30 10:41:15 -07:00
Elliott Hughes
22a40e6a7a Use __arm__ instead of ARCH_ARM.
Change-Id: I777da5757f01d8328d5475e654d56d81dc802655
2014-12-04 14:17:26 -08:00
Mark Salyzyn
5bed803664 libutils: turn on -Werror
- Deal with some -Wunused issues
- Override PRI macros (windows)
- Revert use of PRI macros on off64_t (linux)
- Deal with a gnu++11 complaince issue

Change-Id: Ie66751293bd84477a5a6dfd8a57e700a16e36964
2014-06-02 15:57:50 -07:00
Greg Hackmann
64289760a2 SystemClock: use clock_gettime() on devices without /dev/alarm
On devices with an up-to-date kernel, the back-in-time bug affecting
clock_gettime() has been fixed and it can safely be used as an
alternative to the ANDROID_ALARM_GET_TIME ioctl.  To ensure consistent
behavior on existing devices, make clock_gettime() a fallback for when
the alarm driver isn't available.

Change-Id: I384af5e7ec9e73e0bad4b6b0f987a8ea4583cba6
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2013-12-17 14:45:39 -08:00
Ben Cheng
5cd118178e Disable timestamp logging.
The kernel problem has been fixed long time ago and the ad-hoc logging
mechanism is not thread safe and can flood the log with spurious
messages.

BUG: 10899829
Change-Id: I63278db51295e744eed3e47dc8d4cfe621c0d8f7
2013-09-23 22:39:15 -07:00
Alex Ray
d98e07fdf9 move libs/utils to libutils
Change-Id: I6cf4268599460791414882f91eeb88a992fbd29d
2013-08-02 14:40:08 -07:00
Renamed from libs/utils/SystemClock.cpp (Browse further)