how to add some log in mutter?
- From: Halley Zhao <aihua halley zhao gmail com>
- To: gnome-shell-list gnome org
- Subject: how to add some log in mutter?
- Date: Fri, 11 Oct 2019 18:55:42 +0800
Hi experts:
I want to debug somthing in mutter, the question is how to add log in mutter?
the background is:
1.
on my platform(fc30), weston-simple-dmabuf-drm fail to run, it fails after call zwp_linux_buffer_params_v1_create().
after export WAYLAND_DEBUG=1, I don't get clue.
"
(create_dmabuf_buffer, 711)
(create_dmabuf_buffer,723)format: XR24, width: 256, height: 256, flags: 0x0
Error: zwp_linux_buffer_params.create failed.
Error: zwp_linux_buffer_params.create failed.
Error: zwp_linux_buffer_params.create failed.
"
2.
then I decide to add some log in mutter to see where is the fail.
since
libmutter-2.0.so is loaded by gnome-shell in the background, I try to write my debug log to disk file. but when I add some log in dma_buf_bind(), it doesn't take effect. why?
what's the correct way to add log in mutter?
thanks
here are code piece to add log:
static void _my_print_test_log(const char* file_name)
{
FILE* _tmp_fp = NULL;
_tmp_fp = fopen(file_name, "w+");
if (_tmp_fp) {
fprintf(_tmp_fp, "#### my test ####");
fclose(_tmp_fp);
}
}
static void
dma_buf_bind (struct wl_client *client,
void *data,
uint32_t version,
uint32_t id)
{
MetaWaylandCompositor *compositor = data;
struct wl_resource *resource;
PRINT_MARK;
resource = wl_resource_create (client, &zwp_linux_dmabuf_v1_interface,
version, id);
wl_resource_set_implementation (resource, &dma_buf_implementation,
compositor, NULL);
_my_print_test_log("/tmp/my_mutter_001.txt");
send_modifiers (resource, DRM_FORMAT_ARGB8888);
send_modifiers (resource, DRM_FORMAT_XRGB8888);
send_modifiers (resource, DRM_FORMAT_ARGB2101010);
send_modifiers (resource, DRM_FORMAT_RGB565);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]