mesa/src/util
Eric Anholt 13ea7db760 mesa: Promote Intel's simple logging façade for Android to util/
I'm bringing up freedreno Vulkan on an Android phone, and my pains are
exactly what Chad said when working on Intel's vulkan for Android in
aa716db0f6 ("intel: Add simple logging façade for Android (v2)"):

    On Android, stdio goes to /dev/null. On Android, remote gdb is even
    more painful than the usual remote gdb. On Android, nothing works like
    you expect and debugging is hell. I need logging.

    This patch introduces a small, simple logging API that can easily wrap
    Android's API. On non-Android platforms, this logger does nothing
    fancy.  It follows the time-honored Unix tradition of spewing
    everything to stderr with minimal fuss.

    My goal here is not perfection. My goal is to make a minimal, clean API,
    that people hate merely a little instead of a lot, and that's good
    enough to let me bring up Android Vulkan.  And it needs to be fast,
    which means it must be small. No one wants to their game to miss frames
    while aiming a flaming bow into the jaws of an angry robot t-rex, and
    thus become t-rex breakfast, because some fool had too much fun desiging
    a bloated, ideal logging API.

Compared to trusty fprintf, _mesa_log[ewi]() is actually usable on
Android.  Compared to os_log_message(), this has different error levels
and supports format arguments.

The only code change in the move is wrapping flockfile/funlockfile in
!DETECT_OS_WINDOWS, since mingw32 doesn't have it.  Windows likely wants
different logging code, anyway.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6806>
2020-09-28 09:14:44 -07:00
..
format st/mesa: Don't map all P01X DRM formats to P016 2020-09-09 20:02:03 +00:00
sha1
tests driconf: Use nesting macros for defining options. 2020-09-25 19:36:23 +00:00
00-mesa-defaults.conf radeonsi: set TRUNC_COORD=0 for Total War: WARHAMMER to fix it 2020-09-22 15:58:51 +00:00
Android.mk android: util: fix missing include path 2020-09-06 20:42:56 +02:00
anon_file.c util/anon_file: add OpenBSD shm_mkstemp() path 2020-08-31 09:14:57 +00:00
anon_file.h
bigmath.h
bitscan.c
bitscan.h
bitset.h
bitset_test.cpp
blob.c
blob.h
blob_test.c
build_id.c
build_id.h util: add missing extern C 2020-09-25 20:09:08 +00:00
compiler.h
crc32.c
crc32.h
dag.c
dag.h
debug.c
debug.h
detect_os.h
disk_cache.c android: Disable trying to read/write to the disk cache. 2020-09-22 20:41:25 +00:00
disk_cache.h
disk_cache_os.c disk_cache: Fix filename leak on error path. 2020-09-17 15:42:44 -07:00
disk_cache_os.h disk_cache: move cache item loading code into disk_cache_load_item() helper 2020-09-11 06:03:58 +00:00
double.c
double.h
driconf.h driconf: Use nesting macros for defining options. 2020-09-25 19:36:23 +00:00
enum_operators.h util: add helpers to define bitwise operators on enums for C++ 2020-09-01 17:45:08 +00:00
fast_idiv_by_const.c
fast_idiv_by_const.h
fast_urem_by_const.h
format_r11g11b10f.h
format_rgb9e5.h
format_srgb.h
format_srgb.py
futex.h util: futex fixes for OpenBSD 2020-08-31 09:14:57 +00:00
half_float.c
half_float.h
hash_table.c
hash_table.h
list.h
log.c mesa: Promote Intel's simple logging façade for Android to util/ 2020-09-28 09:14:44 -07:00
log.h mesa: Promote Intel's simple logging façade for Android to util/ 2020-09-28 09:14:44 -07:00
macros.h util: add a alignof() macro 2020-08-20 10:52:19 +00:00
Makefile.sources mesa: Promote Intel's simple logging façade for Android to util/ 2020-09-28 09:14:44 -07:00
mesa-sha1.c
mesa-sha1.h
mesa-sha1_test.c
meson.build mesa: Promote Intel's simple logging façade for Android to util/ 2020-09-28 09:14:44 -07:00
os_file.c util: introduce os_dupfd_cloexec() helper 2020-06-18 02:09:56 +00:00
os_file.h util: introduce os_dupfd_cloexec() helper 2020-06-18 02:09:56 +00:00
os_memory.h
os_memory_aligned.h
os_memory_debug.h
os_memory_stdc.h
os_misc.c util/os_misc: os_get_available_system_memory() for OpenBSD 2020-09-02 12:15:07 +10:00
os_misc.h util/os_misc: add os_get_available_system_memory() 2020-09-02 12:14:56 +10:00
os_socket.c util: fix possible fd leaks in os_socket_listen_abstract 2020-07-30 10:41:00 +00:00
os_socket.h
os_time.c
os_time.h
process_test.c
ralloc.c util/ralloc: fix ralloc alignment. 2020-08-21 18:22:21 +00:00
ralloc.h
rand_xor.c
rand_xor.h
rb_tree.c
rb_tree.h
rb_tree_test.c
register_allocate.c
register_allocate.h
rgtc.c
rgtc.h
roundeven_test.c
rounding.h
SConscript util: Explicitly call the unpack functions from inside bptc pack/unpack. 2020-08-20 05:03:16 +00:00
set.c util/set: add _mesa_set_intersects 2020-08-14 20:35:36 +00:00
set.h util/set: add _mesa_set_intersects 2020-08-14 20:35:36 +00:00
simple_list.h
simple_mtx.h util: enable futex usage on BSDs after 7dc2f47882 2020-06-16 21:44:35 +00:00
slab.c
slab.h
softfloat.c
softfloat.h
sparse_array.c
sparse_array.h
string_buffer.c
string_buffer.h
strndup.h
strtod.c
strtod.h
texcompress_rgtc_tmp.h
timespec.h
u_atomic.c
u_atomic.h
u_atomic_test.c
u_cpu_detect.c
u_cpu_detect.h
u_debug.c
u_debug.h
u_debug_memory.c
u_debug_stack.c util: Move stack debug functions to src/util 2020-08-05 18:08:06 +00:00
u_debug_stack.h gallium/android: Rewrite backtrace helper for android 2020-08-05 18:08:06 +00:00
u_debug_stack_android.cpp gallium/android: Rewrite backtrace helper for android 2020-08-05 18:08:06 +00:00
u_debug_stack_test.cpp u_debug_stack_test: Fix MSVC compiling by using ATTRIBUTE_NOINLINE 2020-08-13 23:18:36 +00:00
u_debug_symbol.c util: Move stack debug functions to src/util 2020-08-05 18:08:06 +00:00
u_debug_symbol.h util: Move stack debug functions to src/util 2020-08-05 18:08:06 +00:00
u_drm.h
u_dynarray.h
u_endian.h util: unbreak endian detection on OpenBSD 2020-08-31 09:14:57 +00:00
u_idalloc.c util/idalloc: add lowest_free_idx to avoid iterating from 0 2020-09-10 09:07:11 +02:00
u_idalloc.h util/idalloc: add lowest_free_idx to avoid iterating from 0 2020-09-10 09:07:11 +02:00
u_math.c
u_math.h
u_memory.h
u_memset.h
u_mm.c
u_mm.h
u_process.c util: fix possible buffer overflow in util_get_process_exec_path 2020-07-30 10:41:00 +00:00
u_process.h
u_queue.c
u_queue.h util: enable futex usage on BSDs after 7dc2f47882 2020-06-16 21:44:35 +00:00
u_string.h
u_thread.h util/u_thread: include pthread_np.h if found 2020-08-31 09:14:57 +00:00
u_vector.c
u_vector.h
vma.c
vma.h
xmlconfig.c driconf: Support selection by Vulkan applicationName. 2020-08-18 20:31:07 +02:00
xmlconfig.h util/xmlconfig: Add a unit test of the code. 2020-09-25 19:36:23 +00:00
xxhash.h util: Avoid strict aliasing bugs in xxhash. 2020-07-03 23:27:06 +00:00