Re: [PATCH weston v5 03/14] libweston: add weston_debug API and implementation

2018-08-27 Thread Daniel Stone
Hi Pekka,

On Mon, 6 Aug 2018 at 14:05, Pekka Paalanen  wrote:
> On Fri, 20 Jul 2018 20:03:24 +0100 Daniel Stone  wrote:
> > + while (len_ > 0) {
> > + ret = write(stream->fd, data, len_);
> > + e = errno;
> > + if (ret < 0) {
> > + if (e == EINTR)
> > + continue;
> > +
> > + stream_close_on_failure(stream,
> > + "Error writing %zd bytes: %s (%d)",
> > + len_, strerror(e), e);
> > + break;
> > + }
> > +
> > + len_ -= ret;
> > + data += ret;
>
> If write() starts returning zero, we might be in for a very long loop.

I don't think there's much we can do about that to be honest. I guess
we could post an error to the owning client and disconnect it? Else
we're just throwing away data, potentially corrupting the debug
stream, which seems suboptimal.

Currently we just block, and document that your debug client _must_
keep up with the incoming stream.

Cheers,
Daniel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston v5 03/14] libweston: add weston_debug API and implementation

2018-08-27 Thread Daniel Stone
Hi Pekka,

On Fri, 24 Aug 2018 at 09:12, Pekka Paalanen  wrote:
> On Thu, 23 Aug 2018 17:53:07 +0100 Daniel Stone  wrote:
> > The users introduced in this patchset already check if the scope is
> > enabled, which bails out if the scope is NULL. Given that, and that I
> > can't see a sensible behaviour if the scope is NULL, I'm inclined to
> > add an assert(scope) at the top of the function as well as
> > documentation. Does that seem reasonable? Would assert(scope) be
> > better or assert(weston_debug_scope_is_enabled(scope))?
>
> after "compositor: offer logs via weston-debug",
> main.c:custom_handler() will call weston_debug_scope_timestamp()
> unchecked.
>
> Relying on libwayland not logging anything until the debug scope has
> been set up seems a bit too fragile to me.
>
> We could forbid calling weston_debug_scope_timestamp() with NULL scope,
> but I think it would be easier if it just accepted NULL by doing
> whatever non-crashy. That would be easier for developers. It could
> simply replace the scope name with "unknown" for instance. The
> resulting string will probably never be used, so it might just make an
> empty string too.

OK, good point. Generally I hate doing nonsensical/non-helpful things
in unexpected conditions we shouldn't be called, but I don't see an
easy way out of this one for now.

> On another matter, I've been wondering if storing the debug scopes in
> weston_compositor is a good thing. We have the logger initialized
> earlier, and quite a lot might happen before weston_compositor is
> created. Also the idea of a circular buffer for after-the-fact
> reporting might benefit from having debug scopes set up early, and the
> command line argument to enable debug scopes from launch.

Yeah, I think we can definitely rework this to push the scope of the
debug stuff up. As noted in
https://gitlab.freedesktop.org/wayland/weston/issues/133 I think it
would be really good to have all this information as early as
possible, and maybe even outliving the compositor. From a libweston
API point of view, having the same API for general logging as we do
for debug makes a huge amount of sense.

Given how invasive that would be, my suggestion would be that we track
that as a follow-up issue. Once we've got all the functionality in
place we can see for sure what the best API/structure would be.

Cheers,
Daniel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: I've got a question to ask you

2018-08-27 Thread binnan hao
I'm using Busybox root file system, and the default setting on Busybox is
mdev instead of udev.

박성진  于2018年8月28日周二 上午11:58写道:

> Hi,
>
> as weston creates libinput udev context by default, you'd better to
> prepare udev daemon for it.
>
> Otherwise, you can create your own fbdev backend using
> libinput_path_create_context() / libinput_path_add_device().
>
>
>
> Best regards,
>
> Sung-Jin Park
>
>
>
> - *Original Message* -
>
> *Sender* : binnan hao 
>
> *Date* : 2018-08-28 12:35 (GMT+9)
>
> *Title* : I've got a question to ask you
>
>
> I've got a question to ask you. The Linux system I'm using is built on my
> own (Kernel+Busybox), and it does not contain other extra things. Now I
> want to use weston(fbdev-backend.so), but the keyboard and mouse do not
> work and log gives following message:
>
> warning: no input devices on entering weston. possible causes:
> - no permissions to read /dev/input/event*
> - seats misconfigured (weston backend option 'seat', udev device property
> ID_SEAT)
>
> I have root permission and device files can be found in path /dev/input/.
> I do not want to add anything else, as that may lead to a very large size
> system. Do you know any method to let weston use keyboard and mouse on my
> system?
>
> --
> *Hao Binnan*
> *Isoo (Qinhuangdao) software development Co., Ltd. (China)*
> http://www.eassos.com
>
> PGP Public Key: 4096R/9EF21740 / 9678 1E8C B21E 1E60 3997  811D F83B B359
> 9EF2 1740
> haobinnan 
>
> ___
> wayland-devel mailing 
> listwayland-devel@lists.freedesktop.orghttps://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
>
>
>
>


-- 
*Hao Binnan*
*Isoo (Qinhuangdao) software development Co., Ltd. (China)*
http://www.eassos.com

PGP Public Key: 4096R/9EF21740 / 9678 1E8C B21E 1E60 3997  811D F83B B359
9EF2 1740
haobinnan 
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


RE: I've got a question to ask you

2018-08-27 Thread 박성진



Hi,
as weston creates libinput udev context by default, you'd better to prepare udev daemon for it.
Otherwise, you can create your own fbdev backend using libinput_path_create_context() / libinput_path_add_device().
 
Best regards,
Sung-Jin Park
 
- Original Message -
Sender : binnan hao 
Date : 2018-08-28 12:35 (GMT+9)
Title : I've got a question to ask you
 

I've got a question to ask you. The Linux system I'm using is built on my own (Kernel+Busybox), and it does not contain other extra things. Now I want to use weston(fbdev-backend.so), but the keyboard and mouse do not work and log gives following message:

warning: no input devices on entering weston. possible causes:
- no permissions to read /dev/input/event*
- seats misconfigured (weston backend option 'seat', udev device property ID_SEAT)

I have root permission and device files can be found in path /dev/input/. I do not want to add anything else, as that may lead to a very large size system. Do you know any method to let weston use keyboard and mouse on my system?
-- 












Hao Binnan
Isoo (Qinhuangdao) software development Co., Ltd. (China)
http://www.eassos.com

PGP Public Key: 4096R/9EF21740 / 9678 1E8C B21E 1E60 3997  811D F83B B359 9EF2 1740
haobinnan ___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel
 
 
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


I've got a question to ask you

2018-08-27 Thread binnan hao
I've got a question to ask you. The Linux system I'm using is built on my
own (Kernel+Busybox), and it does not contain other extra things. Now I
want to use weston(fbdev-backend.so), but the keyboard and mouse do not
work and log gives following message:

warning: no input devices on entering weston. possible causes:
- no permissions to read /dev/input/event*
- seats misconfigured (weston backend option 'seat', udev device property
ID_SEAT)

I have root permission and device files can be found in path /dev/input/. I
do not want to add anything else, as that may lead to a very large size
system. Do you know any method to let weston use keyboard and mouse on my
system?

-- 
*Hao Binnan*
*Isoo (Qinhuangdao) software development Co., Ltd. (China)*
http://www.eassos.com

PGP Public Key: 4096R/9EF21740 / 9678 1E8C B21E 1E60 3997  811D F83B B359
9EF2 1740
haobinnan 
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel