Skip to content

Draft: server: Add support to fetch the process name of wayland clients

Use case:

Lets take the case of Weston where the protocol logs are generated (using weston-debug proto) as following

[2022-12-09 01:00:15.033][proto] client 0x226d3640 (PID 5650) rq wl_surface@9.frame(new id wl_callback@17)
[2022-12-09 01:00:15.033][proto] client 0x226d3640 (PID 5650) rq wl_surface@9.attach(wl_buffer@4278190080, 0, 0)
[2022-12-09 01:00:15.033][proto] client 0x226d3640 (PID 5650) rq wl_surface@9.damage(0, 0, 250, 250)
[2022-12-09 01:00:15.033][proto] client 0x226d3640 (PID 5650) rq wl_surface@9.commit()

It is difficult to read through the logs if there is no mapping available between pids and process names to the user.

The readability could be improved if we print the process name along with the pid.

[2022-12-09 01:00:15.033][proto] client 0x226d3640 (weston-simple-egl PID 5650) rq wl_surface@9.frame(new id wl_callback@17)
[2022-12-09 01:00:15.033][proto] client 0x226d3640 (weston-simple-egl PID 5650) rq wl_surface@9.attach(wl_buffer@4278190080, 0, 0)
[2022-12-09 01:00:15.033][proto] client 0x226d3640 (weston-simple-egl PID 5650) rq wl_surface@9.damage(0, 0, 250, 250)
[2022-12-09 01:00:15.033][proto] client 0x226d3640 (weston-simple-egl PID 5650) rq wl_surface@9.commit()

Proposal:

  • store the name of process which connects to the wayland display
  • introduce an API to retrive the process name

Could you kindly check the use-case to see if it is relevant/make sense

Merge request reports