android_system_core/liblog/tests
Mark Salyzyn fc148f7f33 liblog: add IF_ALOG_RATELIMIT
IF_ALOG_RATELIMIT()
    ALOGE("Only one message globally using IF_ALOG_RATELIMIT()"
          " in the process may appear ever ten seconds,"
          " (%s)", strerror(errno));

static time_t last; /* initial state zero */
IF_ALOG_RATELIMIT_LOCAL(60, &last)
    ALOGE("Only one message locally may appear every minute,"
          " (%s)", strerror(errno));

These new calls are guaranteed not to affect the value of a
non-zero errno to simplify logging of errors.  However, the
ALOGE calls in the above examples may update the errno value
upon their return.

Test: gTest liblog-unit-tests --gtest_filter=liblog.__android_log_ratelimit
Bug: 33535908
Change-Id: Id8cc192fc7d14504ffd418933cf88ae945c089f2
2016-12-21 21:36:14 +00:00
..
Android.mk liblog: CTS test 2016-11-29 08:40:16 -08:00
AndroidTest.xml liblog: CTS test 2016-11-29 08:40:16 -08:00
benchmark.h Fix google-explicit-constructor warnings in system/core. 2016-07-26 11:26:01 -07:00
benchmark_main.cpp Move liblog tests and benchmarks to libc++. 2014-11-12 03:44:16 +00:00
libc_test.cpp liblog: CTS test 2016-11-29 08:40:16 -08:00
liblog_benchmark.cpp liblog: event_tag_map benchmark 2016-11-28 15:15:58 -08:00
liblog_test.cpp liblog: add IF_ALOG_RATELIMIT 2016-12-21 21:36:14 +00:00