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 util: rename PIPE_ARCH_*_ENDIAN to UTIL_ARCH_*_ENDIAN 2019-11-05 16:39:55 +00:00
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 util/anon_file: const string param 2019-08-08 22:02:54 +01:00
bigmath.h util: Add a simple big math library 2018-10-10 13:13:12 -05:00
bitscan.c util: only allow _BitScanReverse64 on 64-bit cpus 2019-09-02 12:45:45 +00:00
bitscan.h util: only allow _BitScanReverse64 on 64-bit cpus 2019-09-02 12:45:45 +00:00
bitset.h util: add BITSET_LAST_BIT() helper 2020-06-03 10:34:22 +00:00
bitset_test.cpp util/tests: add basic unit tests for bitset 2019-05-03 15:23:04 +10:00
blob.c util: stop including files from mesa/main 2020-03-27 21:00:09 +00:00
blob.h util/blob: Add overwrite function for uint8 2020-03-20 17:25:25 +00:00
blob_test.c Move blob from compiler/ to util/ 2019-09-19 19:56:22 +00:00
build_id.c
build_id.h util: add missing extern C 2020-09-25 20:09:08 +00:00
compiler.h Move compiler.h and imports.h/c from src/mesa/main into src/util 2020-03-27 21:00:09 +00:00
crc32.c
crc32.h
dag.c util: Add a DAG datastructure. 2019-03-11 13:13:52 -07:00
dag.h util: Add a DAG datastructure. 2019-03-11 13:13:52 -07:00
debug.c util: stop including files from mesa/main 2020-03-27 21:00:09 +00:00
debug.h nir: check NIR_SKIP to skip passes by name 2019-01-18 12:31:49 -08:00
detect_os.h util: introduce detect_os.h 2019-08-02 18:38:52 +01:00
disk_cache.c android: Disable trying to read/write to the disk cache. 2020-09-22 20:41:25 +00:00
disk_cache.h util/disk_cache: add fallback for disk_cache_get_function_identifier 2020-06-11 06:05:28 +10:00
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 util: add fp64 -> fp32 conversion support for RTNE and RTZ rounding modes 2019-09-17 23:39:18 +03:00
double.h util: add fp64 -> fp32 conversion support for RTNE and RTZ rounding modes 2019-09-17 23:39:18 +03:00
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 util: Use uint64_t for shifting left in sign_extend and strunc 2019-10-24 16:21:01 +02:00
fast_idiv_by_const.h util: document a limitation of util_fast_udiv32 2018-10-17 12:27:58 -04:00
fast_urem_by_const.h util: Add a helper for faster remainders 2019-05-31 19:14:27 +02:00
format_r11g11b10f.h
format_rgb9e5.h
format_srgb.h
format_srgb.py util: initialize float-array with float-literals 2020-01-14 12:00:27 +01:00
futex.h util: futex fixes for OpenBSD 2020-08-31 09:14:57 +00:00
half_float.c util: add float to float16 conversions with RTZ and RTNE 2019-09-17 23:39:18 +03:00
half_float.h glsl: Add ir_constant constructor for fp16 2020-03-09 16:31:08 +00:00
hash_table.c util/hash_table: replace fnv1a hash function with xxhash 2020-05-25 19:41:09 +00:00
hash_table.h util: delete fnv1a hash function 2020-05-25 19:41:09 +00:00
list.h util/list: Add list_foreach_entry_from_safe 2020-05-13 23:36:44 +00:00
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 util/os_memory: never use os_memory_debug.h 2020-05-07 13:34:30 +00:00
os_memory_aligned.h util: Add an aligned realloc function 2020-04-21 11:09:03 -07:00
os_memory_debug.h util: move debug_memory_{begin,end} to os_memory_debug.h 2020-02-24 23:07:57 +00:00
os_memory_stdc.h util: Add an aligned realloc function 2020-04-21 11:09:03 -07:00
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 util/os_socket: fix header unavailable on windows 2020-02-04 17:33:49 +00:00
os_time.c util/os_time: use detect_os.h to uncouple from gallium 2019-08-02 18:38:52 +01:00
os_time.h
process_test.c Fix util/process test on Cygwin 2020-04-15 21:10:11 +00:00
ralloc.c util/ralloc: fix ralloc alignment. 2020-08-21 18:22:21 +00:00
ralloc.h util/ralloc: Add helpers for growing zero-initialized memory 2019-05-14 12:30:22 -05:00
rand_xor.c util/rand_xor: extend the urandom path to all non-Windows platforms 2020-05-16 12:05:37 +00:00
rand_xor.h util/rand_xor: make it clear that {,s_}rand_xorshift128plus take *exactly 2* uint64_t 2020-05-16 12:05:37 +00:00
rb_tree.c
rb_tree.h util/rb_tree: Stop relying on &iter->field != NULL 2019-09-26 20:36:41 +00:00
rb_tree_test.c util/rb_tree: Also test _safe iterators 2019-09-26 20:36:41 +00:00
register_allocate.c util/ra: Add [de]serialization support 2020-05-13 23:36:44 +00:00
register_allocate.h util/ra: Add [de]serialization support 2020-05-13 23:36:44 +00:00
rgtc.c
rgtc.h
roundeven_test.c
rounding.h replace IROUND with util functions 2020-04-21 11:09:03 -07:00
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 Change a few frequented uses of DEBUG to !NDEBUG 2019-05-29 21:13:35 -04:00
slab.h util/slab: Rename slab_mempool typed parameters to mempool 2018-12-14 07:36:05 -08:00
softfloat.c src/util: Remove out-of-range comparison 2020-05-26 12:46:18 -07:00
softfloat.h util: add softfloat functions to operate with doubles and floats 2019-09-17 23:39:18 +03:00
sparse_array.c util/sparse_free_list: manipulate node pointers using atomic primitives 2020-04-18 12:18:03 +00:00
sparse_array.h util/sparse_array: Stash the node level in the node pointer 2020-03-20 15:31:10 -05:00
string_buffer.c util: use standard name for vsnprintf() 2019-07-19 22:39:38 +01:00
string_buffer.h
strndup.h
strtod.c
strtod.h
texcompress_rgtc_tmp.h
timespec.h util/timespec: use unsigned 64 bit integers for nsec values 2019-08-22 09:35:57 +02:00
u_atomic.c
u_atomic.h util/atomic: fix return type of p_atomic_add_return() fallback 2020-01-22 21:42:52 +00:00
u_atomic_test.c
u_cpu_detect.c util: don't include p_defines.h and u_pointer.h from gallium 2020-03-27 21:00:10 +00:00
u_cpu_detect.h util: drop final reference to p_compiler.h 2019-08-09 22:59:43 +03:00
u_debug.c util: drop final reference to p_compiler.h 2019-08-09 22:59:43 +03:00
u_debug.h util: don't include p_defines.h and u_pointer.h from gallium 2020-03-27 21:00:10 +00:00
u_debug_memory.c util: move debug_memory_{begin,end} to os_memory_debug.h 2020-02-24 23:07:57 +00:00
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 util: Add a drm_find_modifier helper 2019-03-14 22:41:08 +00:00
u_dynarray.h u_dynarray: turn util_dynarray_{grow, resize} into element-oriented macros 2019-06-12 18:30:25 -04:00
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 util: u_math: drop p_compiler.h include 2019-08-09 22:59:43 +03:00
u_math.h util: Add SATURATE macro 2020-05-26 22:31:31 +00:00
u_memory.h util: Add an aligned realloc function 2020-04-21 11:09:03 -07:00
u_memset.h gallium/llvmpipe: add an optimised 32-bit memset 2020-04-01 20:58:23 +00:00
u_mm.c util: don't include p_defines.h and u_pointer.h from gallium 2020-03-27 21:00:10 +00:00
u_mm.h mesa/main/util: moving gallium u_mm to util, remove main/mm 2019-12-02 13:59:28 +01:00
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 util/u_process: add util_get_process_exec_path 2020-03-24 08:30:34 +01:00
u_queue.c Linux: Change minimum priority threads from SCHED_IDLE to nice 19 SCHED_BATCH. 2020-05-08 10:14:40 +00:00
u_queue.h util: enable futex usage on BSDs after 7dc2f47882 2020-06-16 21:44:35 +00:00
u_string.h move windows strtok_r define to u_string 2020-04-21 11:09:03 -07:00
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 util/vector: Fix u_vector_foreach when head rolls over 2020-01-17 22:21:00 +00:00
vma.c util/vma: Add a debug print helper 2020-05-13 23:36:44 +00:00
vma.h util/vma: Add a debug print helper 2020-05-13 23:36:44 +00:00
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