tuxedocomputers / tuxedo-control-center

A tool to help you control performance, energy, fan and comfort settings on TUXEDO laptops.
GNU General Public License v3.0
522 stars 69 forks source link

TCCD makes write I/O operations without stopping #314

Closed itsvit-vlasov-y closed 1 year ago

itsvit-vlasov-y commented 1 year ago

tccd process makes 3.8 K/s write operations, while it should do nothing. What it does?

# sudo /opt/tuxedo-control-center/resources/dist/tuxedo-control-center/data/service/tccd --version
TUXEDO Control Center v2.0.7 node: v14.20.0 arch:x64
# upower --version
UPower client version 1.90.2
UPower daemon version 1.90.2

image

I have started with strace.

Output of sudo strace -p <my_process_pid> -v -s 128 2>&1 | grep -A5 -B5 write

read(16, "\1\0\0\0\0\0\0\0", 1024)      = 8
futex(0x290bccc, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x290bce0, FUTEX_WAKE_PRIVATE, 1) = 1
epoll_wait(13, [{events=EPOLLIN, data={u32=16, u64=16}}], 1024, 0) = 1
read(16, "\1\0\0\0\0\0\0\0", 1024)      = 8
write(19, "l\1\0\1\0\0\0\0\364W\0\0\207\0\0\0\1\1o\0\27\0\0\0/org/freedesktop/UPower\0\2\1s\0#\0\0\0org.freedesktop.DBus.Introspectable\0\0\0\0\0\3\1s\0\n\0\0\0Introspect\0\0\0\0\0\0\6\1s\0\26\0\0\0"..., 152) = 152
epoll_wait(13, [], 1024, 0)             = 0
epoll_wait(13, [{events=EPOLLIN, data={u32=19, u64=19}}], 1024, 99) = 1
read(19, "l\2\1\1\210\t\0\0\332[\0\0.\0\0\0\6\1s\0\5\0\0\0:1.12\0\0\0\10\1g\0\1s\0\0\5\1u\0\364W\0\0\7\1s\0\5\0\0\0:1.14\0\0\0\203\t\0\0<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Intr"..., 65536) = 2504
write(19, "l\1\0\1,\0\0\0\365W\0\0\200\0\0\0\1\1o\0\27\0\0\0/org/freedesktop/UPower\0\2\1s\0\37\0\0\0org.freedesktop.DBus.Properties\0\3\1s\0\3\0\0\0Get\0\0\0\0\0\6\1s\0\26\0\0\0org.freedesktop."..., 188) = 188
epoll_wait(13, [], 1024, 0)             = 0
epoll_wait(13, [{events=EPOLLIN, data={u32=19, u64=19}}], 1024, 98) = 1
read(19, "l\2\1\1\10\0\0\0\333[\0\0.\0\0\0\6\1s\0\5\0\0\0:1.12\0\0\0\10\1g\0\1v\0\0\5\1u\0\365W\0\0\7\1s\0\5\0\0\0:1.14\0\0\0\1b\0\0\0\0\0\0", 65536) = 72
futex(0x290bccc, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x290bce0, FUTEX_WAKE_PRIVATE, 1) = 0
--
ioctl(21, _IOC(_IOC_READ, 0xed, 0x11, 0x8), 0x7ffcd9830a18) = 0
ioctl(21, _IOC(_IOC_WRITE, 0xee, 0x10, 0x8), 0x7ffcd9830a14) = 0
close(21)                               = 0
epoll_wait(13, [{events=EPOLLIN, data={u32=20, u64=20}}], 1024, 0) = 1
read(20, "l\1\0\1\0\0\0\0[\5\0\0\247\0\0\0\1\1o\0\31\0\0\0/com/tuxedocomputers/tccd\0\0\0\0\0\0\0\2\1s\0\30\0\0\0com.tuxedocomputers.tccd\0\0\0\0\0\0\0\0\3\1s\0\22\0\0\0TuxedoWmiAvailable\0\0\0\0\0\0"..., 65536) = 184
write(20, "l\2\0\1\4\0\0\0\253\322\0\0\37\0\0\0\5\1u\0[\5\0\0\6\1s\0\6\0\0\0:1.770\0\0\10\1g\0\1b\0\0\1\0\0\0", 52) = 52
openat(AT_FDCWD, "/sys/class/backlight", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 21
newfstatat(21, "", {st_dev=makedev(0, 0x15), st_ino=5026, st_mode=S_IFDIR|0755, st_nlink=2, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, st_size=0, st_atime=1690977470 /* 2023-08-02T14:57:50.401965308+0300 */, st_atime_nsec=401965308, st_mtime=1690977468 /* 2023-08-02T14:57:48.913333333+0300 */, st_mtime_nsec=913333333, st_ctime=1690977468 /* 2023-08-02T14:57:48.913333333+0300 */, st_ctime_nsec=913333333}, AT_EMPTY_PATH) = 0
getdents64(21, [{d_ino=5026, d_off=1, d_reclen=24, d_type=DT_DIR, d_name="."}, {d_ino=10, d_off=692118608, d_reclen=24, d_type=DT_DIR, d_name=".."}, {d_ino=45473, d_off=2147483647, d_reclen=40, d_type=DT_LNK, d_name="intel_backlight"}], 32768) = 88
getdents64(21, [], 32768)               = 0
close(21)                               = 0
--
read(21, "48000\n", 4096)               = 6
read(21, "", 4090)                      = 0
close(21)                               = 0
epoll_wait(13, [{events=EPOLLIN, data={u32=20, u64=20}}], 1024, 0) = 1
read(20, "l\1\0\1\0\0\0\0\\\5\0\0\247\0\0\0\1\1o\0\31\0\0\0/com/tuxedocomputers/tccd\0\0\0\0\0\0\0\2\1s\0\30\0\0\0com.tuxedocomputers.tccd\0\0\0\0\0\0\0\0\3\1s\0\24\0\0\0GetActiveProfileJSON\0\0\0\0"..., 65536) = 184
write(20, "l\2\0\1\3\2\0\0\254\322\0\0\37\0\0\0\5\1u\0\\\5\0\0\6\1s\0\6\0\0\0:1.770\0\0\10\1g\0\1s\0\0\376\1\0\0{\"id\":\"__legacy_default__\",\"name\":\"Default\",\"description\":\"\",\"display\":{\"bri"..., 563) = 563
epoll_wait(13, [], 1024, 0)             = 0
epoll_wait(13, [{events=EPOLLIN, data={u32=20, u64=20}}], 1024, 607) = 1
read(20, "l\1\0\1\0\0\0\0]\5\0\0\247\0\0\0\1\1o\0\31\0\0\0/com/tuxedocomputers/tccd\0\0\0\0\0\0\0\2\1s\0\30\0\0\0com.tuxedocomputers.tccd\0\0\0\0\0\0\0\0\3\1s\0\22\0\0\0TuxedoWmiAvailable\0\0\0\0\0\0"..., 65536) = 184
write(20, "l\2\0\1\4\0\0\0\255\322\0\0\37\0\0\0\5\1u\0]\5\0\0\6\1s\0\6\0\0\0:1.770\0\0\10\1g\0\1b\0\0\1\0\0\0", 52) = 52
epoll_wait(13, [], 1024, 0)             = 0
epoll_wait(13, [{events=EPOLLIN, data={u32=20, u64=20}}], 1024, 606) = 1
read(20, "l\1\0\1\0\0\0\0^\5\0\0\237\0\0\0\1\1o\0\31\0\0\0/com/tuxedocomputers/tccd\0\0\0\0\0\0\0\2\1s\0\30\0\0\0com.tuxedocomputers.tccd\0\0\0\0\0\0\0\0\3\1s\0\17\0\0\0GetProfilesJSON\0\6\1s\0\30\0\0\0"..., 65536) = 176
write(20, "l\2\0\1\201\10\0\0\256\322\0\0\37\0\0\0\5\1u\0^\5\0\0\6\1s\0\6\0\0\0:1.770\0\0\10\1g\0\1s\0\0|\10\0\0[{\"id\":\"__legacy_default__\",\"name\":\"Default\",\"description\":\"\",\"display\":{\"br"..., 2225) = 2225
epoll_wait(13, [], 1024, 0)             = 0

Looks like that it writes to file descriptors 19 and 20 every second.
Output of sudo ls -lah /proc/<my_process_id>/fd

total 0
dr-x------ 2 root root 21 Aug  2 11:58 .
dr-xr-xr-x 9 root root  0 Aug  2 11:58 ..
lr-x------ 1 root root 64 Aug  2 12:11 0 -> /dev/null
lrwx------ 1 root root 64 Aug  2 12:11 1 -> 'socket:[28210]'
lr-x------ 1 root root 64 Aug  2 12:11 10 -> 'pipe:[22840]'
l-wx------ 1 root root 64 Aug  2 12:11 11 -> 'pipe:[22840]'
lrwx------ 1 root root 64 Aug  2 12:11 12 -> 'anon_inode:[eventfd]'
lrwx------ 1 root root 64 Aug  2 12:11 13 -> 'anon_inode:[eventpoll]'
lr-x------ 1 root root 64 Aug  2 12:11 14 -> 'pipe:[28216]'
l-wx------ 1 root root 64 Aug  2 12:11 15 -> 'pipe:[28216]'
lrwx------ 1 root root 64 Aug  2 12:11 16 -> 'anon_inode:[eventfd]'
lr-x------ 1 root root 64 Aug  2 12:11 17 -> /opt/tuxedo-control-center/resources/dist/tuxedo-control-center/data/service/tccd
lr-x------ 1 root root 64 Aug  2 12:11 18 -> /dev/null
lrwx------ 1 root root 64 Aug  2 12:11 19 -> 'socket:[28218]'
lrwx------ 1 root root 64 Aug  2 12:11 2 -> 'socket:[28210]'
lrwx------ 1 root root 64 Aug  2 12:11 20 -> 'socket:[28219]'
lrwx------ 1 root root 64 Aug  2 11:58 3 -> 'anon_inode:[eventpoll]'
lr-x------ 1 root root 64 Aug  2 12:11 4 -> 'pipe:[28214]'
l-wx------ 1 root root 64 Aug  2 12:11 5 -> 'pipe:[28214]'
lr-x------ 1 root root 64 Aug  2 12:11 6 -> 'pipe:[28215]'
l-wx------ 1 root root 64 Aug  2 12:11 7 -> 'pipe:[28215]'
lrwx------ 1 root root 64 Aug  2 12:11 8 -> 'anon_inode:[eventfd]'
lrwx------ 1 root root 64 Aug  2 12:11 9 -> 'anon_inode:[eventpoll]'

19 and 20 are some sockets, but why there are write operations if I change nothing? LED on the laptop does not stop blinking it irritates me. Does that make operations to my SSD and this stub operations waste my hardware resource?

itsvit-vlasov-y commented 1 year ago

Sorry, figured out that disk activity was caused by different application.