libweston: Rename weston_debug_scope_ to weston_log_scope_
Rename also the functions which work on weston_log_scope. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
committed by
Daniel Stone
parent
5d5e335845
commit
7e4db95373
@@ -114,7 +114,7 @@
|
||||
* possible type and use a matching format specifier.
|
||||
*/
|
||||
#define drm_debug(b, ...) \
|
||||
weston_debug_scope_printf((b)->debug, __VA_ARGS__)
|
||||
weston_log_scope_printf((b)->debug, __VA_ARGS__)
|
||||
|
||||
#define MAX_CLONED_CONNECTORS 4
|
||||
|
||||
@@ -3199,7 +3199,7 @@ drm_repaint_begin(struct weston_compositor *compositor)
|
||||
ret = drm_pending_state_alloc(b);
|
||||
b->repaint_data = ret;
|
||||
|
||||
if (weston_debug_scope_is_enabled(b->debug)) {
|
||||
if (weston_log_scope_is_enabled(b->debug)) {
|
||||
char *dbg = weston_compositor_print_scene_graph(compositor);
|
||||
drm_debug(b, "[repaint] Beginning repaint; pending_state %p\n",
|
||||
ret);
|
||||
@@ -6769,7 +6769,7 @@ drm_destroy(struct weston_compositor *ec)
|
||||
|
||||
destroy_sprites(b);
|
||||
|
||||
weston_debug_scope_destroy(b->debug);
|
||||
weston_compositor_log_scope_destroy(b->debug);
|
||||
b->debug = NULL;
|
||||
weston_compositor_shutdown(ec);
|
||||
|
||||
@@ -7499,10 +7499,10 @@ drm_backend_create(struct weston_compositor *compositor,
|
||||
b->pageflip_timeout = config->pageflip_timeout;
|
||||
b->use_pixman_shadow = config->use_pixman_shadow;
|
||||
|
||||
b->debug = weston_compositor_add_debug_scope(compositor->weston_log_ctx,
|
||||
"drm-backend",
|
||||
"Debug messages from DRM/KMS backend\n",
|
||||
NULL, NULL);
|
||||
b->debug = weston_compositor_add_log_scope(compositor->weston_log_ctx,
|
||||
"drm-backend",
|
||||
"Debug messages from DRM/KMS backend\n",
|
||||
NULL, NULL);
|
||||
|
||||
compositor->backend = &b->base;
|
||||
|
||||
|
||||
@@ -6889,10 +6889,10 @@ weston_compositor_create(struct wl_display *display,
|
||||
timeline_key_binding_handler, ec);
|
||||
|
||||
ec->debug_scene =
|
||||
weston_compositor_add_debug_scope(ec->weston_log_ctx, "scene-graph",
|
||||
"Scene graph details\n",
|
||||
debug_scene_graph_cb,
|
||||
ec);
|
||||
weston_compositor_add_log_scope(ec->weston_log_ctx, "scene-graph",
|
||||
"Scene graph details\n",
|
||||
debug_scene_graph_cb,
|
||||
ec);
|
||||
|
||||
return ec;
|
||||
|
||||
@@ -7194,7 +7194,7 @@ weston_compositor_destroy(struct weston_compositor *compositor)
|
||||
if (compositor->heads_changed_source)
|
||||
wl_event_source_remove(compositor->heads_changed_source);
|
||||
|
||||
weston_debug_scope_destroy(compositor->debug_scene);
|
||||
weston_compositor_log_scope_destroy(compositor->debug_scene);
|
||||
compositor->debug_scene = NULL;
|
||||
weston_log_ctx_compositor_destroy(compositor);
|
||||
|
||||
|
||||
+25
-25
@@ -54,8 +54,8 @@ struct weston_log_context {
|
||||
|
||||
/** weston-log message scope
|
||||
*
|
||||
* This is used for scoping debugging messages. Clients can subscribe to
|
||||
* only the scopes they are interested in. A scope is identified by its name
|
||||
* This is used for scoping logging/debugging messages. Clients can subscribe
|
||||
* to only the scopes they are interested in. A scope is identified by its name
|
||||
* (also referred to as debug stream name).
|
||||
*/
|
||||
struct weston_log_scope {
|
||||
@@ -371,7 +371,7 @@ weston_compositor_is_debug_protocol_enabled(struct weston_compositor *wc)
|
||||
return wc->weston_log_ctx->global != NULL;
|
||||
}
|
||||
|
||||
/** Register a new debug stream name, creating a debug scope
|
||||
/** Register a new debug stream name, creating a log scope
|
||||
*
|
||||
* \param log_ctx The weston_log_context where to add.
|
||||
* \param name The debug stream/scope name; must not be NULL.
|
||||
@@ -406,11 +406,11 @@ weston_compositor_is_debug_protocol_enabled(struct weston_compositor *wc)
|
||||
* \sa weston_debug_stream, weston_log_scope_cb
|
||||
*/
|
||||
WL_EXPORT struct weston_log_scope *
|
||||
weston_compositor_add_debug_scope(struct weston_log_context *log_ctx,
|
||||
const char *name,
|
||||
const char *description,
|
||||
weston_log_scope_cb begin_cb,
|
||||
void *user_data)
|
||||
weston_compositor_add_log_scope(struct weston_log_context *log_ctx,
|
||||
const char *name,
|
||||
const char *description,
|
||||
weston_log_scope_cb begin_cb,
|
||||
void *user_data)
|
||||
{
|
||||
struct weston_log_scope *scope;
|
||||
|
||||
@@ -468,7 +468,7 @@ weston_compositor_add_debug_scope(struct weston_log_context *log_ctx,
|
||||
* \memberof weston_log_scope
|
||||
*/
|
||||
WL_EXPORT void
|
||||
weston_debug_scope_destroy(struct weston_log_scope *scope)
|
||||
weston_compositor_log_scope_destroy(struct weston_log_scope *scope)
|
||||
{
|
||||
struct weston_debug_stream *stream;
|
||||
|
||||
@@ -490,7 +490,7 @@ weston_debug_scope_destroy(struct weston_log_scope *scope)
|
||||
|
||||
/** Are there any active subscriptions to the scope?
|
||||
*
|
||||
* \param scope The debug scope to check; may be NULL.
|
||||
* \param scope The log scope to check; may be NULL.
|
||||
* \return True if any streams are open for this scope, false otherwise.
|
||||
*
|
||||
* As printing some debugging messages may be relatively expensive, one
|
||||
@@ -510,7 +510,7 @@ weston_debug_scope_destroy(struct weston_log_scope *scope)
|
||||
* \memberof weston_log_scope
|
||||
*/
|
||||
WL_EXPORT bool
|
||||
weston_debug_scope_is_enabled(struct weston_log_scope *scope)
|
||||
weston_log_scope_is_enabled(struct weston_log_scope *scope)
|
||||
{
|
||||
if (!scope)
|
||||
return false;
|
||||
@@ -626,7 +626,7 @@ weston_debug_stream_complete(struct weston_debug_stream *stream)
|
||||
weston_debug_stream_v1_send_complete(stream->resource);
|
||||
}
|
||||
|
||||
/** Write debug data for a scope
|
||||
/** Write log data for a scope
|
||||
*
|
||||
* \param scope The debug scope to write for; may be NULL, in which case
|
||||
* nothing will be written.
|
||||
@@ -641,8 +641,8 @@ weston_debug_stream_complete(struct weston_debug_stream *stream)
|
||||
* \memberof weston_log_scope
|
||||
*/
|
||||
WL_EXPORT void
|
||||
weston_debug_scope_write(struct weston_log_scope *scope,
|
||||
const char *data, size_t len)
|
||||
weston_log_scope_write(struct weston_log_scope *scope,
|
||||
const char *data, size_t len)
|
||||
{
|
||||
struct weston_debug_stream *stream;
|
||||
|
||||
@@ -655,7 +655,7 @@ weston_debug_scope_write(struct weston_log_scope *scope,
|
||||
|
||||
/** Write a formatted string for a scope (varargs)
|
||||
*
|
||||
* \param scope The debug scope to write for; may be NULL, in which case
|
||||
* \param scope The log scope to write for; may be NULL, in which case
|
||||
* nothing will be written.
|
||||
* \param fmt Printf-style format string.
|
||||
* \param ap Formatting arguments.
|
||||
@@ -668,28 +668,28 @@ weston_debug_scope_write(struct weston_log_scope *scope,
|
||||
* \memberof weston_log_scope
|
||||
*/
|
||||
WL_EXPORT void
|
||||
weston_debug_scope_vprintf(struct weston_log_scope *scope,
|
||||
const char *fmt, va_list ap)
|
||||
weston_log_scope_vprintf(struct weston_log_scope *scope,
|
||||
const char *fmt, va_list ap)
|
||||
{
|
||||
static const char oom[] = "Out of memory";
|
||||
char *str;
|
||||
int len;
|
||||
|
||||
if (!weston_debug_scope_is_enabled(scope))
|
||||
if (!weston_log_scope_is_enabled(scope))
|
||||
return;
|
||||
|
||||
len = vasprintf(&str, fmt, ap);
|
||||
if (len >= 0) {
|
||||
weston_debug_scope_write(scope, str, len);
|
||||
weston_log_scope_write(scope, str, len);
|
||||
free(str);
|
||||
} else {
|
||||
weston_debug_scope_write(scope, oom, sizeof oom - 1);
|
||||
weston_log_scope_write(scope, oom, sizeof oom - 1);
|
||||
}
|
||||
}
|
||||
|
||||
/** Write a formatted string for a scope
|
||||
*
|
||||
* \param scope The debug scope to write for; may be NULL, in which case
|
||||
* \param scope The log scope to write for; may be NULL, in which case
|
||||
* nothing will be written.
|
||||
* \param fmt Printf-style format string and arguments.
|
||||
*
|
||||
@@ -701,13 +701,13 @@ weston_debug_scope_vprintf(struct weston_log_scope *scope,
|
||||
* \memberof weston_log_scope
|
||||
*/
|
||||
WL_EXPORT void
|
||||
weston_debug_scope_printf(struct weston_log_scope *scope,
|
||||
weston_log_scope_printf(struct weston_log_scope *scope,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
weston_debug_scope_vprintf(scope, fmt, ap);
|
||||
weston_log_scope_vprintf(scope, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
@@ -723,8 +723,8 @@ weston_debug_scope_printf(struct weston_log_scope *scope,
|
||||
* The string is NUL-terminated, even if truncated.
|
||||
*/
|
||||
WL_EXPORT char *
|
||||
weston_debug_scope_timestamp(struct weston_log_scope *scope,
|
||||
char *buf, size_t len)
|
||||
weston_log_scope_timestamp(struct weston_log_scope *scope,
|
||||
char *buf, size_t len)
|
||||
{
|
||||
struct timeval tv;
|
||||
struct tm *bdt;
|
||||
|
||||
@@ -51,7 +51,7 @@ struct weston_debug_stream;
|
||||
*
|
||||
* \param stream The debug stream.
|
||||
* \param user_data The \c user_data argument given to
|
||||
* weston_compositor_add_debug_scope()
|
||||
* weston_compositor_add_log_scope()
|
||||
*
|
||||
* \memberof weston_log_scope
|
||||
* \sa weston_debug_stream
|
||||
@@ -60,28 +60,28 @@ typedef void (*weston_log_scope_cb)(struct weston_debug_stream *stream,
|
||||
void *user_data);
|
||||
|
||||
struct weston_log_scope *
|
||||
weston_compositor_add_debug_scope(struct weston_log_context *compositor,
|
||||
weston_compositor_add_log_scope(struct weston_log_context *compositor,
|
||||
const char *name,
|
||||
const char *description,
|
||||
weston_log_scope_cb begin_cb,
|
||||
void *user_data);
|
||||
|
||||
void
|
||||
weston_debug_scope_destroy(struct weston_log_scope *scope);
|
||||
weston_compositor_log_scope_destroy(struct weston_log_scope *scope);
|
||||
|
||||
bool
|
||||
weston_debug_scope_is_enabled(struct weston_log_scope *scope);
|
||||
weston_log_scope_is_enabled(struct weston_log_scope *scope);
|
||||
|
||||
void
|
||||
weston_debug_scope_write(struct weston_log_scope *scope,
|
||||
weston_log_scope_write(struct weston_log_scope *scope,
|
||||
const char *data, size_t len);
|
||||
|
||||
void
|
||||
weston_debug_scope_vprintf(struct weston_log_scope *scope,
|
||||
weston_log_scope_vprintf(struct weston_log_scope *scope,
|
||||
const char *fmt, va_list ap);
|
||||
|
||||
void
|
||||
weston_debug_scope_printf(struct weston_log_scope *scope,
|
||||
weston_log_scope_printf(struct weston_log_scope *scope,
|
||||
const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
|
||||
@@ -102,7 +102,7 @@ void
|
||||
weston_debug_stream_complete(struct weston_debug_stream *stream);
|
||||
|
||||
char *
|
||||
weston_debug_scope_timestamp(struct weston_log_scope *scope,
|
||||
weston_log_scope_timestamp(struct weston_log_scope *scope,
|
||||
char *buf, size_t len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user