On Sat, 3 Jun 2017 14:57:02 +0300 Pekka Paalanen <[email protected]> wrote:
> From: Pekka Paalanen <[email protected]> > > Hi, > > this is a little something I wrote while being stuck off-line in a hot place > and not having to care about anyone's priorities one bit. > > Debug printing has usually been ad hoc weston_log() or even fprintf() calls, > often guarded by #ifdefs which require recompiling if you want to enable them. > Once enabled, you needed to recompile again to disable them. That works for > developers somewhat, but becomes a PITA when you need a user to get you that > debug information. I have experienced that particularly with XWM debugs. > > Here's an alternative proposal: let a Wayland client give Weston an open file > descriptor, and Weston will write the debug prints into it on demand. Of > course, this is a risky move, and should not usually be allowed - I added a > command line option to control it. Hi, apropos, I have been entertaining a completely different idea: perf probe. Apparently one can set userspace probing points with 'perf probe' and then record them, which should be less overhead when not used than the weston-debug API. But there are many open questions I have not had the time to chase: - Can we get an ordered printout of every single hit like we get with printf? - Is it flexible enough to relay all the details one might want, like variable values? - Architecture requirements; would it be not feasible or impossible on some CPU architectures? Requiring debug info packages might be too much on embedded? - How to maintain a list of the probe points so it works over several source revisions and builds? Using function names, source line numbers or addresses is no-go. Would need to mark the probe points in the source, but how? - Overhead when enabled? - Postprocessing? - Permissions? I'm skeptical of this idea being useful, but thought I'd mention it just in case. OTOH, the weston-debug proposal is relatively easy to understand and use, and it should be very reliable, debug info or no. However, for something like the timeline debugging, perf probes could be extremely useful as probes in Weston could be combined with probes in the kernel drivers (e.g. GPU jobs and fences). Thanks, pq
pgplvMGS5V5PV.pgp
Description: OpenPGP digital signature
_______________________________________________ wayland-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/wayland-devel
