File: README.md

package info (click to toggle)
upower 1.91.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,660 kB
  • sloc: ansic: 13,134; python: 5,310; xml: 1,636; sh: 33; makefile: 26
file content (65 lines) | stat: -rw-r--r-- 2,075 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# UPower

Requirements:

```text
  glib-2.0             >= 2.66.0
  gio-2.0              >= 2.16.1
  gudev-1.0            >= 235    (Linux)
  libimobiledevice-1.0 >= 0.9.7  (optional)
  polkit-gobject-1     >= 124
```

UPower is an abstraction for enumerating power devices,
listening to device events and querying history and statistics.
Any application or service on the system can access the
org.freedesktop.UPower service via the system message bus.

## Debugging

When doing bug reports, the following information can be useful:

- `grep . /sys/class/power_supply/*/*`  
  This includes the current kernel view of all power supplies in the
  system. It is always a good idea to include this information.
- `udevadm info -e`  
  This shows the hardware configuration and is relevant when e.g. the
  type of an external device is misdetected.
- `upower -d`  
  Shows upower's view of the state
- `upower --monitor-detail`  
  Dumps device information every time that a change happens. This helps
  with debugging dynamic issues.
- `udevadm monitor`  
  Dumps the udev/kernel reported hardware changes (and addition/removal).
  This is helpful when debugging dynamic issues, in particular if it is
  not clear whether the issue is coming from the kernel or upower.

In addition, it can also be useful to run upower in debug mode and post the
logs. There are two ways of doing so:

- Run upower daemon manually, you can do so using:
  `sudo /usr/libexec/upowerd -rd`
- Modify the systemd service and restart. This is best done by:
  1. `sudo systemctl edit upower.service`
  2. Adding the two lines:

      ```text
      [Service]
      Environment=G_MESSAGES_DEBUG=all
      ```

  3. `sudo systemctl restart upower.service`
  4. Grab logs using `journalctl -u upower.service` or similar

## Using tartan

[Tartan](https://gitlab.freedesktop.org/tartan/tartan/-/wikis/home) is a LLVM static
analysis plugin built to analyze GLib code. It can be installed and then run using:

```shell
mkdir build
cd build
meson setup ..
SCANBUILD=../contrib/tartan.sh ninja scan-build
```