drv: Use __func__ instead of __FILE__
... to avoid needing a basename() which is dropped from string.h
in musl.
Bug: b/328316038
Test: android build
Change-Id: Ib619b9c45a30ce69be30270fe7da0f13421179be
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5352313
Commit-Queue: Dominik Behr <dbehr@chromium.org>
Auto-Submit: Jason Macnak <natsu@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Reviewed-by: Dawn Han <dawnhan@google.com>
diff --git a/drv.c b/drv.c
index 36d6601..ea3bd64 100644
--- a/drv.c
+++ b/drv.c
@@ -765,11 +765,11 @@
out_use_flags);
}
-void drv_log_prefix(enum drv_log_level level, const char *prefix, const char *file, int line,
+void drv_log_prefix(enum drv_log_level level, const char *prefix, const char *func, int line,
const char *format, ...)
{
char buf[50];
- snprintf(buf, sizeof(buf), "[%s:%s(%d)]", prefix, basename(file), line);
+ snprintf(buf, sizeof(buf), "[%s:%s(%d)]", prefix, func, line);
va_list args;
va_start(args, format);
diff --git a/drv.h b/drv.h
index 3dedfd1..b61aedf 100644
--- a/drv.h
+++ b/drv.h
@@ -240,7 +240,7 @@
#define _drv_log(level, format, ...) \
do { \
- drv_log_prefix(level, "minigbm", __FILE__, __LINE__, format, ##__VA_ARGS__); \
+ drv_log_prefix(level, "minigbm", __func__, __LINE__, format, ##__VA_ARGS__); \
} while (0)
#define drv_loge(format, ...) _drv_log(DRV_LOGE, format, ##__VA_ARGS__)