Weston debug
weston_debug_v1
这是 Weston 内部的通用调试接口,通过 wl_registry 广告的全局对象。
警告:此接口设计上允许拒绝服务攻击。不应在生产环境中提供,或必须实施适当的授权机制。
其思路是客户端提供一个文件描述符,服务器使用它来打印调试信息。服务器以阻塞写入模式使用文件描述符,这暴露了拒绝服务风险。阻塞模式对于确保所有调试消息可以轻松就地打印是必要的。如果客户端订阅了多个调试流,它还确保消息顺序。
可用的调试功能取决于服务器。
调试流可以是一次性的,服务器打印请求的信息然后关闭它;也可以是连续的,服务器持续打印直到客户端停止它。或介于两者之间的任何方式。
subscribe(name: string, streamfd: fd, stream: new_id<weston_debug_stream_v1>)
参数 | 类型 | 描述 |
|---|---|---|
| name | string允许为空 | debug stream name |
| streamfd | fd | write stream file descriptor |
| stream | new_id<weston_debug_stream_v1> | created debug stream object |
订阅命名的调试流。服务器将开始打印到给定的文件描述符。
如果命名的调试流是一次性转储,服务器将在所有请求的数据打印完毕后发送 weston_debug_stream_v1.complete 事件。否则,服务器将继续流式传输调试打印,直到订阅对象被销毁。
如果服务器不认识调试流名称,服务器将立即响应 weston_debug_stream_v1.failure 事件。
available(name: string, description: string)
参数 | 类型 | 描述 |
|---|---|---|
| name | string允许为空 | debug stream name |
| description | string允许为空 | human-readable description of the debug scope |
广告客户端可能能够绑定的可用调试范围。服务器不会提供有关客户端订阅后该范围提供的调试流中包含的内容的信息。
表示一个已订阅的调试流,通过 weston_debug_v1.subscribe 创建。创建对象时,它与给定的文件描述符关联。服务器将继续写入文件描述符,直到对象被销毁或服务器通过该对象发送事件。
destroy()
销毁对象,这将导致服务器停止写入并在尚未关闭的情况下关闭关联的文件描述符。
如果客户端需要保证文件描述符在继续之前已关闭,请使用 wl_display.sync。
complete()
服务器已成功完成写入并关闭了关联的文件描述符。
此事件仅针对一次性调试流交付,服务器转储一些数据然后停止。对于连续调试流永远不会交付,因为根据定义它们永远不会完成。
合成器支持
Copyright
Copyright © 2017 Pekka Paalanen pq@iki.fi Copyright © 2018 Zodiac Inflight Innovations
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.