public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Milian Wolff <mail@milianw.de>
To: Mark Wielaard <mark@klomp.org>
Cc: "Frank Ch. Eigler" <fche@redhat.com>, elfutils-devel@sourceware.org
Subject: Re: caching failed lookups of debuginfo?
Date: Fri, 08 Apr 2022 23:08:03 +0200	[thread overview]
Message-ID: <19455068.ZVunK98tCv@milian-workstation> (raw)
In-Reply-To: <YlCiS5wJMlXWopjw@wildebeest.org>

[-- Attachment #1: Type: text/plain, Size: 2977 bytes --]

On Freitag, 8. April 2022 22:59:55 CEST Mark Wielaard wrote:
> Hi Milian,
> 
> On Fri, Apr 08, 2022 at 10:45:10PM +0200, Milian Wolff wrote:
> > In the off-CPU flame graphs I clearly see this callchain when
> > DEBUGINFOD_URLS is set:
> > 
> > ```
> > dwfl_standard_find_debuginfo > debuginfod_query_server > curl_multi_wait
> > ```
> > 
> > This accounts for ~2.5s of off-CPU time in my case. If you are saying that
> > negative lookups are cached, then what is this? Why would a second run of
> > the same dwfl-using application with the same input data keep querying
> > the server?
>
> That is certainly not what should happen once the cache is filled.
> Could you run with DEBUGINFOD_VERBOSE=1 to see what is being fetched and
> why?

My first mail showed this already. But here is one such block:

```
debuginfod_find_debuginfo 85766e9d8458b16e9c7ce6e07c712c02b8471dbc
server urls "https://debuginfod.archlinux.org/"
checking build-id
checking cache dir /home/milian/.cache/debuginfod_client
using timeout 90
init server 0 https://debuginfod.archlinux.org/buildid
url 0 https://debuginfod.archlinux.org/buildid/
85766e9d8458b16e9c7ce6e07c712c02b8471dbc/debuginfo
query 1 urls in parallel
server response HTTP response code said error
url 0 The requested URL returned error: 404
not found No such file or directory (err=-2)
```

I see this repeated multiple times - both for different files and for the same 
file. I.e.:

```
$ /home/milian/projects/compiled/other/lib/heaptrack/libexec/
heaptrack_interpret < heaptrack.kate.52068.raw |& egrep "^url 0 https" | sort 
| uniq -c | sort -n
```

Produces this output here locally for me: https://invent.kde.org/-/snippets/
2153

I can reproduce it now suddenly with debuginfod-find too:

```
$
debuginfod-find debuginfo 85766e9d8458b16e9c7ce6e07c712c02b8471dbc
debuginfod_find_debuginfo 85766e9d8458b16e9c7ce6e07c712c02b8471dbc
server urls "https://debuginfod.archlinux.org/"
checking build-id
checking cache dir /home/milian/.cache/debuginfod_client
using timeout 90
init server 0 https://debuginfod.archlinux.org/buildid
url 0 https://debuginfod.archlinux.org/buildid/
85766e9d8458b16e9c7ce6e07c712c02b8471dbc/debuginfo
query 1 urls in parallel
server response HTTP response code said error
url 0 The requested URL returned error: 404
not found No such file or directory (err=-2)
Server query failed: No such file or directory
```

I do see an empty `/home/milian/.cache/debuginfod_client/
85766e9d8458b16e9c7ce6e07c712c02b8471dbc/debuginfo` file. But the server is 
still queried (i.e. rerunning the above command always produces the same 
output for me). The lookup is costly too at ~70ms overall:

```
$ perf stat -r 5 debuginfod-find debuginfo 
85766e9d8458b16e9c7ce6e07c712c02b8471dbc
              7.83 msec task-clock                #    0.114 CPUs utilized            
( +-  4.75% )
...
           0.06857 +- 0.00187 seconds time elapsed  ( +-  2.73% )

```

Thanks
-- 
Milian Wolff
mail@milianw.de
http://milianw.de

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-04-08 21:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08 19:58 Milian Wolff
2022-04-08 20:05 ` Frank Ch. Eigler
2022-04-08 20:45   ` Milian Wolff
2022-04-08 20:59     ` Mark Wielaard
2022-04-08 21:08       ` Milian Wolff [this message]
2022-04-08 21:34         ` Aaron Merey
2022-04-08 21:56           ` Milian Wolff
2022-04-08 22:21             ` Mark Wielaard
2022-04-08 22:23             ` Milian Wolff
2022-04-08 22:40               ` Mark Wielaard
2022-04-08 22:54                 ` Aaron Merey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19455068.ZVunK98tCv@milian-workstation \
    --to=mail@milianw.de \
    --cc=elfutils-devel@sourceware.org \
    --cc=fche@redhat.com \
    --cc=mark@klomp.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).