Re: how to add some log in mutter?



additonal information
1. on my x86 pc, it is Ubuntu18.04, the software version is lower than that on device with fc30
2. with WAYLAND_DEBUG=1, some log as below
(create_window,826)#############1############
(create_dmabuf_buffer,686)dmabuf_fd: 8, stride: 1024, modifier: 0
(create_dmabuf_buffer,687)display->dmabuf: 0x5569f9d5f0
[3526048.648]  -> zwp_linux_dmabuf_v1@6.create_params(new id zwp_linux_buffer_params_v1@10)
(create_dmabuf_buffer, 689)
[3526048.665]  -> zwp_linux_buffer_params_v1 10 add(fd 9, 0, 0, 1024, 0, 0)
(create_dmabuf_buffer, 698)
(create_dmabuf_buffer, 711)
(create_dmabuf_buffer,723)format: XR24, width: 256, height: 256, flags: 0x0
[3526048.700]  -> zwp_linux_buffer_params_v1@10.create(256, 256, 875713112, 0)
(create_window,826)#############2############
(create_dmabuf_buffer,686)dmabuf_fd: 11, stride: 1024, modifier: 0
(create_dmabuf_buffer,687)display->dmabuf: 0x5569f9d5f0
[3526048.867]  -> zwp_linux_dmabuf_v1@6.create_params(new id zwp_linux_buffer_params_v1@11)
(create_dmabuf_buffer, 689)
[3526048.883]  -> zwp_linux_buffer_params_v1 11 add(fd 12, 0, 0, 1024, 0, 0)
(create_dmabuf_buffer, 698)
(create_dmabuf_buffer, 711)
(create_dmabuf_buffer,723)format: XR24, width: 256, height: 256, flags: 0x0
[3526048.918]  -> zwp_linux_buffer_params_v1@11.create(256, 256, 875713112, 0)
[3526048.945]  -> wl_display 1 sync(new id wl_callback@12)
[3526062.264] wl_display@1.delete_id(12)
[3526062.345] xdg_toplevel@8.configure(0, 0, array)
[3526062.365] xdg_surface@7.configure(165)
[3526062.418]  -> xdg_surface@7.ack_configure(165)
[3526062.442] zwp_linux_buffer_params_v1@9.failed()
[3526062.467]  -> zwp_linux_buffer_params_v1@9.destroy()
Error: zwp_linux_buffer_params.create failed.
[3526062.502] zwp_linux_buffer_params_v1@10.failed()
[3526062.526]  -> zwp_linux_buffer_params_v1@10.destroy()
Error: zwp_linux_buffer_params.create failed.
[3526062.557] zwp_linux_buffer_params_v1@11.failed()
[3526062.581]  -> zwp_linux_buffer_params_v1@11.destroy()
Error: zwp_linux_buffer_params.create failed.
[3526062.612] wl_callback 12 done(165)

Halley Zhao <aihua halley zhao gmail com> 于2019年10月12日周六 上午7:57写道:
on my test device, the wayland connection runs smoothly before create a wl_buffer (in weston simple-dmabuf-drm.c zwp_linux_buffer_params_v1_create()).
I do get the response from wayland server and bind zwp_linux_dmabuf_v1_interface, and received dmabuf_listener callback in dmabuf_format() for the supported color format.
(a little curious here is: it is not callback in dmabuf_modifiers() but the legacy dmabuf_format()).

for graphics part, there is mesa, as well as mali ddk. i don't know more detail about it.



Jonas Ådahl <jadahl gmail com> 于2019年10月11日周五 下午10:07写道:
On Fri, Oct 11, 2019 at 08:33:03PM +0800, Halley Zhao wrote:
> I gave some try;
> log shows on my desktop pc, but not on my test device.
> I'm curious why dma_buf_bind () isn't triggered on my device; from client
> side, I do see wayland server( mutter ) reports the supported color format.
> is there any other place to handle dmabuf interface bind?

Could it be that your test device doesn't use DMA-BUF? On your desktop,
I assume you're using mesa, which will use the Wayland DMA-BUF if you
have a new enough version, but is your test device also using the same
mesa version?

Assuming your test device is also running mutter or gnome-shell, it
should only bind via the dma_buf_bind() function in
meta-wayland-dma-buf.c; there is no other entry point.

Do you have complete WAYLAND_DEBUG=1 logs from your test device?


Jonas

>
>
> Jonas Ådahl <jadahl gmail com> 于2019年10月11日周五 下午7:49写道:
>
> > On Fri, Oct 11, 2019 at 06:55:42PM +0800, Halley Zhao via gnome-shell-list
> > wrote:
> > > 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?
> >
> > You should be able to use e.g.
> >
> >     fprintf (stderr, "Log this message\n");
> >
> > ,
> >
> >     g_message ("Log this message");
> >
> > or
> >
> >     g_warning ("Log this warning");
> >
> > If you run gnome-shell or mutter from GDM, the log entries will end up
> > in the journal. You can look in the journal with for example
> >
> >     journalctl -e $(which gnome-shell)
> >
> > If you run mutter or gnome-shell manually from a tty, it's easiest to
> > run and reroute stdout and stderr directly to a file, e.g mutter >&
> > mutter.log.
> >
> > If your added log entries doesn't show up even though you are sure the
> > functions where you added your log entries were called, then double
> > check that the libmutter you compiled yourself is the one used by the
> > executable when you run.
> >
> >
> > Jonas
> >
> >
> > > 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);
> > > }
> >
> > > _______________________________________________
> > > gnome-shell-list mailing list
> > > gnome-shell-list gnome org
> > > https://mail.gnome.org/mailman/listinfo/gnome-shell-list
> >
> >


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]