threedeyes / qthaikuplugins

Qt5 plugins for haiku platform
GNU General Public License v3.0
13 stars 4 forks source link

Qt Creator and other apps poll the filesystem for changes #7

Closed waddlesplash closed 4 years ago

waddlesplash commented 6 years ago

I noticed that when Qt apps were open, lots of messages like these appear in the syslog:

KERN: bfs: bfs_access:1525: Permission denied

So I ran an strace on Qt Creator, and found that it does a lot of stuff like this, every second or so:

[   997] _kern_access(0xffffffff, "/boot/home/Desktop/haiku/3rdparty/qtcreator/freebsd_network.files", 0x4, false) = 0x0 No error (5 us)
[   997] _kern_access(0xffffffff, "/boot/home/Desktop/haiku/3rdparty/qtcreator/freebsd_network.files", 0x2, false) = 0x0 No error (5 us)
[   997] _kern_access(0xffffffff, "/boot/home/Desktop/haiku/3rdparty/qtcreator/freebsd_network.files", 0x1, false) = 0x80000002 Permission denied (6 us)
[   997] _kern_get_timezone((nil), 0x7fb74a160850, 0x100) = 0x0 No error (0 us)
[   997] _kern_get_timezone((nil), 0x7fb74a160830, 0x100) = 0x0 No error (0 us)
[   997] _kern_get_timezone((nil), 0x7fb74a160670, 0x100) = 0x0 No error (0 us)
[   997] _kern_get_timezone((nil), 0x7fb74a1606c0, 0x100) = 0x0 No error (1 us)
[   997] _kern_access(0xffffffff, "/boot/home/Desktop/haiku/3rdparty/qtcreator/freebsd_network.includes", 0x0, false) = 0x0 No error (7 us)
[   997] _kern_read_stat(0xffffffff, "/boot/home/Desktop/haiku/3rdparty/qtcreator/freebsd_network.includes", true, 0x7fb74a160a30, 0x80) = 0x0 No error (6 us)
[   997] _kern_read_stat(0xffffffff, "/boot/home/Desktop/haiku/3rdparty/qtcreator/freebsd_network.includes", true, 0x7fb74a160a30, 0x80) = 0x0 No error (6 us)
[   997] _kern_access(0xffffffff, "/boot/home/Desktop/haiku/3rdparty/qtcreator/freebsd_network.includes", 0x4, false) = 0x0 No error (16 us)
[   997] _kern_access(0xffffffff, "/boot/home/Desktop/haiku/3rdparty/qtcreator/freebsd_network.includes", 0x2, false) = 0x0 No error (7 us)
[   997] _kern_access(0xffffffff, "/boot/home/Desktop/haiku/3rdparty/qtcreator/freebsd_network.includes", 0x1, false) = 0x80000002 Permission denied (10 us)
[   997] _kern_get_timezone((nil), 0x7fb74a160850, 0x100) = 0x0 No error (0 us)
[   997] _kern_get_timezone((nil), 0x7fb74a160830, 0x100) = 0x0 No error (1 us)
[   997] _kern_get_timezone((nil), 0x7fb74a160670, 0x100) = 0x0 No error (1 us)
[   997] _kern_get_timezone((nil), 0x7fb74a1606c0, 0x100) = 0x0 No error (0 us)

It looks like it's repeatedly polling the filesystem for time changes. Perhaps this is QFileSystemWatcher? But I know that at least for the older QPA plugin that was upstreamed, we implemented QFileSystemWatcher properly using Haiku-native path watching. Is that not preserved here?

threedeyes commented 4 years ago

Fixed in https://github.com/haikuports/haikuports/commit/89040aaa92c4de99825aa24d429689f26a1d26d5#diff-2b35b18b19ef61315f1ac8a12297a097