I have made an attempt at profiling where the avahi-daemon is getting
stuck. Hopefully this is useful to someone. I downloaded the source
package for avahi-daemon, then rebuilt it and installed the resulting
debug packages. After waiting for the CPU usage to reach around 70% or
so, I attempted to profile where it is executing.
My initial attempt at running `perf record -p 514 -g` failed; when
running `perf report` after, the report was fully blank. As a result, I
decided to go back to my original plan and just break a few times in gdb
to see where it stopped. See the attached log for a full log of that
session. It seemed to be usually in one of two places:
#0 0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at
simple-watch.c:431
#1 0x00007ff3598027ea in avahi_simple_poll_prepare
(s=s@entry=0x558f0b1e5ff0, timeout=timeout@entry=-1) at simple-watch.c:481
#2 0x00007ff359802c69 in avahi_simple_poll_iterate (s=0x558f0b1e5ff0,
timeout=timeout@entry=-1) at simple-watch.c:599
#3 0x0000558f09c929ee in run_server (c=0x558f09cb01e0 <config>) at
main.c:1268
#4 main (argc=<optimized out>, argv=<optimized out>) at main.c:1686
or
#0 0x00007ff35962d3c3 in __GI___poll (fds=0x558f0b1eec90, nfds=10,
timeout=2209504) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x00007ff359802aa1 in avahi_simple_poll_run (s=0x558f0b1e5ff0) at
simple-watch.c:527
#2 avahi_simple_poll_run (s=0x558f0b1e5ff0) at simple-watch.c:518
#3 0x00007ff359802c78 in avahi_simple_poll_iterate (s=0x558f0b1e5ff0,
timeout=timeout@entry=-1) at simple-watch.c:602
#4 0x0000558f09c929ee in run_server (c=0x558f09cb01e0 <config>) at
main.c:1268
#5 main (argc=<optimized out>, argv=<optimized out>) at main.c:1686
Ryan
On 2021-09-11 1:11 p.m., Ryan Armstrong wrote:
I edited my Avahi service to add the --debug flag to see if added
anything useful. It doesn't seem so, but here it is regardless. I've
attached both the full log (gzipped) and an annotated and simplified log.
I may try and attach to the process with GDB in the future to trace
what part of the code it is primarily working in.
Ryan
zerker@zeta:/usr/local/src/avahi-0.8$ sudo gdb /sbin/avahi-daemon 514
GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /sbin/avahi-daemon...
Reading symbols from /usr/lib/debug/.build-id/2c/a2b666d7cae1fdf23610a403cf5134ef53c2bd.debug...
Attaching to program: /usr/sbin/avahi-daemon, process 514
Reading symbols from /lib/x86_64-linux-gnu/libavahi-common.so.3...
Reading symbols from /usr/lib/debug/.build-id/60/1f176178ee6723f5d0435852d0a52c39ce24c4.debug...
Reading symbols from /lib/x86_64-linux-gnu/libavahi-core.so.7...
Reading symbols from /usr/lib/debug/.build-id/6c/940f5569c9768c85408cec9e2aa7a9a8be4489.debug...
Reading symbols from /lib/x86_64-linux-gnu/libdaemon.so.0...
(No debugging symbols found in /lib/x86_64-linux-gnu/libdaemon.so.0)
Reading symbols from /lib/x86_64-linux-gnu/libexpat.so.1...
(No debugging symbols found in /lib/x86_64-linux-gnu/libexpat.so.1)
Reading symbols from /lib/x86_64-linux-gnu/libcap.so.2...
(No debugging symbols found in /lib/x86_64-linux-gnu/libcap.so.2)
Reading symbols from /lib/x86_64-linux-gnu/libdl.so.2...
Reading symbols from /usr/lib/debug/.build-id/11/8b90161526d181807818c459baee841993795b.debug...
Reading symbols from /lib/x86_64-linux-gnu/libdbus-1.so.3...
(No debugging symbols found in /lib/x86_64-linux-gnu/libdbus-1.so.3)
Reading symbols from /lib/x86_64-linux-gnu/libpthread.so.0...
Reading symbols from /usr/lib/debug/.build-id/50/18237bbf012b4094027fd0b96fc22a24496ea4.debug...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Reading symbols from /lib/x86_64-linux-gnu/libc.so.6...
Reading symbols from /usr/lib/debug/.build-id/b7/2adf59ac0a673d1eeb261e662364507cfc8615.debug...
Reading symbols from /lib64/ld-linux-x86-64.so.2...
Reading symbols from /usr/lib/debug/.build-id/32/438eb3b034da54caf58c7a65446639f7cfe274.debug...
Reading symbols from /lib/x86_64-linux-gnu/libsystemd.so.0...
(No debugging symbols found in /lib/x86_64-linux-gnu/libsystemd.so.0)
Reading symbols from /lib/x86_64-linux-gnu/librt.so.1...
Reading symbols from /usr/lib/debug/.build-id/7c/ce5ecadb7bf40c36fdb2834f9321707564fb3c.debug...
Reading symbols from /lib/x86_64-linux-gnu/liblzma.so.5...
(No debugging symbols found in /lib/x86_64-linux-gnu/liblzma.so.5)
Reading symbols from /lib/x86_64-linux-gnu/libzstd.so.1...
(No debugging symbols found in /lib/x86_64-linux-gnu/libzstd.so.1)
Reading symbols from /lib/x86_64-linux-gnu/liblz4.so.1...
(No debugging symbols found in /lib/x86_64-linux-gnu/liblz4.so.1)
--Type <RET> for more, q to quit, c to continue without paging--
Reading symbols from /lib/x86_64-linux-gnu/libgcrypt.so.20...
(No debugging symbols found in /lib/x86_64-linux-gnu/libgcrypt.so.20)
Reading symbols from /lib/x86_64-linux-gnu/libgpg-error.so.0...
(No debugging symbols found in /lib/x86_64-linux-gnu/libgpg-error.so.0)
Reading symbols from /lib/x86_64-linux-gnu/libnss_files.so.2...
Reading symbols from /usr/lib/debug/.build-id/80/57e07b12fc6118d1c723397a05ac902a1908a1.debug...
Reading symbols from /lib/x86_64-linux-gnu/libnss_systemd.so.2...
(No debugging symbols found in /lib/x86_64-linux-gnu/libnss_systemd.so.2)
0x00007ff35962d3c3 in __GI___poll (fds=0x558f0b1eec90, nfds=10, timeout=2420284) at ../sysdeps/unix/sysv/linux/poll.c:29
29 ../sysdeps/unix/sysv/linux/poll.c: No such file or directory.
(gdb) bt
#0 0x00007ff35962d3c3 in __GI___poll (fds=0x558f0b1eec90, nfds=10, timeout=2420284) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x00007ff359802aa1 in avahi_simple_poll_run (s=0x558f0b1e5ff0) at simple-watch.c:527
#2 avahi_simple_poll_run (s=0x558f0b1e5ff0) at simple-watch.c:518
#3 0x00007ff359802c78 in avahi_simple_poll_iterate (s=0x558f0b1e5ff0, timeout=timeout@entry=-1) at simple-watch.c:602
#4 0x0000558f09c929ee in run_server (c=0x558f09cb01e0 <config>) at main.c:1268
#5 main (argc=<optimized out>, argv=<optimized out>) at main.c:1686
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at simple-watch.c:431
431 if (t->dead || !t->enabled)
(gdb) bt
#0 0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at simple-watch.c:431
#1 0x00007ff3598027ea in avahi_simple_poll_prepare (s=s@entry=0x558f0b1e5ff0, timeout=timeout@entry=-1) at simple-watch.c:481
#2 0x00007ff359802c69 in avahi_simple_poll_iterate (s=0x558f0b1e5ff0, timeout=timeout@entry=-1) at simple-watch.c:599
#3 0x0000558f09c929ee in run_server (c=0x558f09cb01e0 <config>) at main.c:1268
#4 main (argc=<optimized out>, argv=<optimized out>) at main.c:1686
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at simple-watch.c:431
431 if (t->dead || !t->enabled)
(gdb) bt
#0 0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at simple-watch.c:431
#1 0x00007ff359802b4e in avahi_simple_poll_dispatch (s=0x558f0b1e5ff0) at simple-watch.c:558
#2 0x00007ff359802c85 in avahi_simple_poll_iterate (timeout=-1, s=<optimized out>) at simple-watch.c:605
#3 0x0000558f09c929ee in run_server (c=0x558f09cb01e0 <config>) at main.c:1268
#4 main (argc=<optimized out>, argv=<optimized out>) at main.c:1686
(gdb) Quit
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x00007ff35962d3c3 in __GI___poll (fds=0x558f0b1eec90, nfds=10, timeout=2209504) at ../sysdeps/unix/sysv/linux/poll.c:29
29 ../sysdeps/unix/sysv/linux/poll.c: No such file or directory.
(gdb) bt
#0 0x00007ff35962d3c3 in __GI___poll (fds=0x558f0b1eec90, nfds=10, timeout=2209504) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x00007ff359802aa1 in avahi_simple_poll_run (s=0x558f0b1e5ff0) at simple-watch.c:527
#2 avahi_simple_poll_run (s=0x558f0b1e5ff0) at simple-watch.c:518
#3 0x00007ff359802c78 in avahi_simple_poll_iterate (s=0x558f0b1e5ff0, timeout=timeout@entry=-1) at simple-watch.c:602
#4 0x0000558f09c929ee in run_server (c=0x558f09cb01e0 <config>) at main.c:1268
#5 main (argc=<optimized out>, argv=<optimized out>) at main.c:1686
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at simple-watch.c:431
431 if (t->dead || !t->enabled)
(gdb) bt
#0 0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at simple-watch.c:431
#1 0x00007ff3598027ea in avahi_simple_poll_prepare (s=s@entry=0x558f0b1e5ff0, timeout=timeout@entry=-1) at simple-watch.c:481
#2 0x00007ff359802c69 in avahi_simple_poll_iterate (s=0x558f0b1e5ff0, timeout=timeout@entry=-1) at simple-watch.c:599
#3 0x0000558f09c929ee in run_server (c=0x558f09cb01e0 <config>) at main.c:1268
#4 main (argc=<optimized out>, argv=<optimized out>) at main.c:1686
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at simple-watch.c:431
431 if (t->dead || !t->enabled)
(gdb) bt
#0 0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at simple-watch.c:431
#1 0x00007ff359802b4e in avahi_simple_poll_dispatch (s=0x558f0b1e5ff0) at simple-watch.c:558
#2 0x00007ff359802c85 in avahi_simple_poll_iterate (timeout=-1, s=<optimized out>) at simple-watch.c:605
#3 0x0000558f09c929ee in run_server (c=0x558f09cb01e0 <config>) at main.c:1268
#4 main (argc=<optimized out>, argv=<optimized out>) at main.c:1686
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x00007ff35962d3c3 in __GI___poll (fds=0x558f0b1eec90, nfds=10, timeout=2174303) at ../sysdeps/unix/sysv/linux/poll.c:29
29 ../sysdeps/unix/sysv/linux/poll.c: No such file or directory.
(gdb) bt
#0 0x00007ff35962d3c3 in __GI___poll (fds=0x558f0b1eec90, nfds=10, timeout=2174303) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x00007ff359802aa1 in avahi_simple_poll_run (s=0x558f0b1e5ff0) at simple-watch.c:527
#2 avahi_simple_poll_run (s=0x558f0b1e5ff0) at simple-watch.c:518
#3 0x00007ff359802c78 in avahi_simple_poll_iterate (s=0x558f0b1e5ff0, timeout=timeout@entry=-1) at simple-watch.c:602
#4 0x0000558f09c929ee in run_server (c=0x558f09cb01e0 <config>) at main.c:1268
#5 main (argc=<optimized out>, argv=<optimized out>) at main.c:1686
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at simple-watch.c:431
431 if (t->dead || !t->enabled)
(gdb) bt
#0 0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at simple-watch.c:431
#1 0x00007ff359802b4e in avahi_simple_poll_dispatch (s=0x558f0b1e5ff0) at simple-watch.c:558
#2 0x00007ff359802c85 in avahi_simple_poll_iterate (timeout=-1, s=<optimized out>) at simple-watch.c:605
#3 0x0000558f09c929ee in run_server (c=0x558f09cb01e0 <config>) at main.c:1268
#4 main (argc=<optimized out>, argv=<optimized out>) at main.c:1686
(gdb) Quit
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at simple-watch.c:431
431 if (t->dead || !t->enabled)
(gdb) bt
#0 0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at simple-watch.c:431
#1 0x00007ff3598027ea in avahi_simple_poll_prepare (s=s@entry=0x558f0b1e5ff0, timeout=timeout@entry=-1) at simple-watch.c:481
#2 0x00007ff359802c69 in avahi_simple_poll_iterate (s=0x558f0b1e5ff0, timeout=timeout@entry=-1) at simple-watch.c:599
#3 0x0000558f09c929ee in run_server (c=0x558f09cb01e0 <config>) at main.c:1268
#4 main (argc=<optimized out>, argv=<optimized out>) at main.c:1686
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at simple-watch.c:431
431 if (t->dead || !t->enabled)
(gdb) bt
#0 0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at simple-watch.c:431
#1 0x00007ff3598027ea in avahi_simple_poll_prepare (s=s@entry=0x558f0b1e5ff0, timeout=timeout@entry=-1) at simple-watch.c:481
#2 0x00007ff359802c69 in avahi_simple_poll_iterate (s=0x558f0b1e5ff0, timeout=timeout@entry=-1) at simple-watch.c:599
#3 0x0000558f09c929ee in run_server (c=0x558f09cb01e0 <config>) at main.c:1268
#4 main (argc=<optimized out>, argv=<optimized out>) at main.c:1686
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at simple-watch.c:431
431 if (t->dead || !t->enabled)
(gdb) bt
#0 0x00007ff359801fb0 in find_next_timeout (s=<optimized out>) at simple-watch.c:431
#1 0x00007ff3598027ea in avahi_simple_poll_prepare (s=s@entry=0x558f0b1e5ff0, timeout=timeout@entry=-1) at simple-watch.c:481
#2 0x00007ff359802c69 in avahi_simple_poll_iterate (s=0x558f0b1e5ff0, timeout=timeout@entry=-1) at simple-watch.c:599
#3 0x0000558f09c929ee in run_server (c=0x558f09cb01e0 <config>) at main.c:1268
#4 main (argc=<optimized out>, argv=<optimized out>) at main.c:1686
_______________________________________________
Pkg-utopia-maintainers mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-utopia-maintainers