<div dir="ltr"><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><span id="gmail-docs-internal-guid-559f5955-7fff-d080-395d-75ad2e94efc9"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Debuginfod is a simple </span><a href="https://sourceware.org/elfutils/Debuginfod.html" style="text-decoration-line:none"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">protocol</span></a><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> allowing a client to fetch debug information about a stripped binary from a server by supplying its build-id. We would like to add debuginfod support to LLVM to make it easier for users to debug stripped binaries.</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">In summary, we would like to:</span></p><ol style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Build an LLVM debuginfod client library in LLVM.</span></p></li><li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Integrate the client library into llvm-symbolizer and other tools.</span></p></li><li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Build a simple LLVM debuginfod server library for local development use.</span></p></li></ol><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">The client and server tasks are separate and we have already begun work on the client side. The server is nothing more than a simple web server that serves static content associated with the build_id in the URL. We are eager to get feedback and advice from the community.</span></p><h3 dir="ltr" style="line-height:1.38;margin-top:16pt;margin-bottom:4pt"><span style="font-size:14pt;font-family:"Google Sans",sans-serif;color:rgb(67,67,67);background-color:transparent;font-weight:400;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">HTTP Client</span></h3><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">The debuginfod client library will require an HTTP client, which should be fully featured to maximize compatibility across various network configurations and debuginfo server implementations. </span><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">We were leaning towards </span><a href="https://curl.se/libcurl/" style="text-decoration-line:none"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">libcurl</span></a><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> which is widely available.</span></p><h3 dir="ltr" style="line-height:1.38;margin-top:16pt;margin-bottom:4pt"><span style="font-size:14pt;font-family:"Google Sans",sans-serif;color:rgb(67,67,67);background-color:transparent;font-weight:400;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">HTTP Server</span></h3><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">The debuginfod server is essentially a static file server using HTTP over TCP/IP. We propose to use the TCPSocket library from </span><a href="https://lldb.llvm.org/use/remote.html" style="text-decoration-line:none"><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">lldb-server</span></a><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> and build a very small HTTP file server on top using </span><a href="https://llvm.org/doxygen/classllvm_1_1Regex.html" style="text-decoration-line:none"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">LLVM regular expressions</span></a><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">. We built a proof-of-concept, more details can be found below under </span><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-style:italic;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">HTTP Server Benchmarks</span><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">. This would require a refactor of the LLDB IOObject hierarchy into LLVM as described in our </span><a href="https://groups.google.com/g/llvm-dev/c/IbvheetpGKs" style="text-decoration-line:none"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">previous RFC</span></a><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">.</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">As a short-term solution, since the refactor may take some time, we propose to use the lightweight cpp-httplib library to get a server up and running.</span></p><h3 dir="ltr" style="line-height:1.38;margin-top:16pt;margin-bottom:4pt"><span style="font-size:14pt;font-family:"Google Sans",sans-serif;color:rgb(67,67,67);background-color:transparent;font-weight:400;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Database</span></h3><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Debuginfod needs to run key-value lookup queries to serve requests. Specifically, it must implement these logical mappings:</span></p><ul style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:11pt;font-family:Consolas,sans-serif;color:rgb(13,144,79);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">build_id -> executable_path</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:11pt;font-family:Consolas,sans-serif;color:rgb(13,144,79);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">(build_id, source_path) -> source_path</span></p></li></ul><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">In pursuit of a mechanism to perform these lookups, we can draw inspiration from </span><a href="https://clangd.llvm.org/design/indexing.html" style="text-decoration-line:none"><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">clangd's indexing scheme</span></a><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> and Apple’s </span><a href="https://docs.google.com/document/d/1cH2sTpgSnJZCkZtJl1aY-rzy4uGPcrI-6RrUpdATO2Q/edit" style="text-decoration-line:none"><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">index-while-building feature</span></a><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">. Both of these implementations ultimately solve the same problem, supporting fast lookups of e.g. symbol occurrences in source code, but they take different approaches. Clangd produces indexes in memory and then writes them to disk in a way that enables efficient queries on-demand. Apple’s index-while-building libraries instead dump unindexed record and unit files to a directory using the LLVM bitstream file format. These files must then be indexed into lookup tables to answer queries on-demand – a task left to other tooling. For example, Apple’s </span><a href="https://github.com/apple/indexstore-db" style="text-decoration-line:none"><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">IndexStoreDB</span></a><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> tool ingests the record and unit files to produce key-value tables stored on-disk with </span><a href="http://www.lmdb.tech/doc/" style="text-decoration-line:none"><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">LMDB</span></a><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">To estimate the size of the database needed for a local debuginfo server, we indexed the binaries of the LLVM project (compiled with standard Debug mode options) using elfutils-debuginfod. The resulting SQLite database occupied just 35MB on disk, which could easily fit in a typical developer’s RAM. Of course, production debuginfo servers may index far more binaries, and the database could easily reach several GB.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Based on the small size required for a local debuginfod database, we think it should be fine to take the clangd-style approach out-of-the-box, while providing an interface compatible with LMDB (or LevelDB, etc.) to assist with production debuginfod servers. Specifically, when built without LMDB, llvm-debuginfod would index debuginfo using a few in-memory hash tables, then atomically serialize them to LLVM’s </span><a href="https://github.com/llvm/llvm-project/blob/d480f968ad8b56d3ee4a6b6df5532d485b0ad01e/llvm/include/llvm/Support/OnDiskHashTable.h" style="text-decoration-line:none"><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">OnDiskHashTable</span></a><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> (or subclasses). We would leave LMDB libraries as an </span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-style:italic;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">optional dependency</span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> that could be used for production debuginfod servers.</span></p><h3 dir="ltr" style="line-height:1.38;margin-top:16pt;margin-bottom:4pt"><span style="font-size:14pt;font-family:"Google Sans",sans-serif;color:rgb(67,67,67);background-color:transparent;font-weight:400;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Build system integration</span></h3><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">llvm-debuginfod would be built as an implicit project similar to llvm-objdump and located at ./llvm/tools/llvm-debuginfod.</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">The client introduces a mandatory dependency on libcurl. This could be handled similarly to libxml in the llvm/CMakeLists.txt.</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">At first, the server will introduce a mandatory dependency on cpp-httplib until we can complete the refactor to move LLDB’s TCPSocket into LLVM. After the refactor the server will have no additional mandatory dependencies. The server will have optional dependencies on both cpp-httplib (or another HTTP server library) and LMDB. These optional dependencies would be intended for production debuginfod servers.</span></p><h3 dir="ltr" style="line-height:1.38;margin-top:16pt;margin-bottom:4pt"><span style="font-size:14pt;font-family:"Google Sans",sans-serif;color:rgb(67,67,67);background-color:transparent;font-weight:400;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Client integration with other LLVM tools</span></h3><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">The </span><span style="font-size:11pt;font-family:Consolas,sans-serif;color:rgb(13,144,79);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">llvm-debuginfod</span><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> server itself will require client functionality provided by a </span><span style="font-size:11pt;font-family:Consolas,sans-serif;color:rgb(13,144,79);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">llvm-libdebuginfod-client</span><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> library for federation to other debuginfo servers. We would wrap this library with a thin </span><span style="font-size:11pt;font-family:Consolas,sans-serif;color:rgb(13,144,79);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">llvm-debuginfod-find</span><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> tool in the same source directory with functionality similar to the </span><span style="font-size:11pt;font-family:Consolas,sans-serif;color:rgb(13,144,79);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">debuginfod-find</span><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> tool in elfutils. The library will make it simpler to bring the fetch capabilities to other tools like llvm-symbolizer in a nearly-uniform way. Specifically, the </span><span style="font-size:11pt;font-family:Consolas,sans-serif;color:rgb(13,144,79);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">llvm-libdebuginfod-client</span><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> library code will query the servers in the </span><span style="font-size:11pt;font-family:Consolas,sans-serif;color:rgb(13,144,79);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">DEBUGINFOD_URLS</span><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> environment variable for a given </span><span style="font-size:11pt;font-family:Consolas,sans-serif;color:rgb(13,144,79);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">build_id</span><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">. This client would be invoked from tools like </span><span style="font-size:11pt;font-family:Consolas,sans-serif;color:rgb(13,144,79);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">llvm-symbolizer</span><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> by adding a small (~10 line) change to the tool. The needed changes may be slightly different for each tool due to the different ways that debuginfo are found and handled. This makes it less of a “black-box” replacement than </span><a href="https://github.com/edolstra/dwarffs" style="text-decoration-line:none"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">FUSE-based approaches</span></a><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">, but leaves tool designers more flexibility to select if / when / how debuginfod servers are queried.</span></p><h3 dir="ltr" style="line-height:1.38;margin-top:16pt;margin-bottom:4pt"><span style="font-size:14pt;font-family:Arial;color:rgb(67,67,67);background-color:transparent;font-weight:400;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Implementation Schedule</span></h3><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">We propose to split the implementation of llvm-debuginfod into 4 patches. </span></p><ul style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Patch 1 will add the HTTP client dependency (libcurl) to the build system.</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Patch 2 will create the client library </span><span style="font-size:11pt;font-family:Consolas,sans-serif;color:rgb(13,144,79);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">llvm-debuginfod-client</span><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> and implement </span><span style="font-size:11pt;font-family:Consolas,sans-serif;color:rgb(13,144,79);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">llvm-debuginfod-find</span><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">. Public debuginfo servers and/or a local python http.server (f.k.a. SimpleHTTPServer) could be used for the initial test suite.</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Patch 3 will make the changes to llvm-symbolizer needed for it to use the debuginfod-find library.</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Patch 4 will implement debuginfod (the server).</span></p></li></ul><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">These patches have the following logical dependencies:</span></p><div dir="ltr" style="margin-left:0pt" align="left"><table style="border:none;border-collapse:collapse"><colgroup></colgroup><tbody><tr style="height:0pt"><td style="border-width:1pt;border-style:solid;border-color:rgb(224,224,224);vertical-align:top;background-color:rgb(250,250,250);padding:5pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Consolas,sans-serif;color:rgb(197,57,41);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">1</span><span style="font-size:10pt;font-family:Consolas,sans-serif;color:rgb(97,97,97);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">--></span><span style="font-size:10pt;font-family:Consolas,sans-serif;color:rgb(197,57,41);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">2</span><span style="font-size:10pt;font-family:Consolas,sans-serif;color:rgb(97,97,97);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">--></span><span style="font-size:10pt;font-family:Consolas,sans-serif;color:rgb(197,57,41);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">3</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Consolas,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">     </span><span style="font-size:10pt;font-family:Consolas,sans-serif;color:rgb(97,97,97);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">\</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Consolas,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">      </span><span style="font-size:10pt;font-family:Consolas,sans-serif;color:rgb(97,97,97);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">-></span><span style="font-size:10pt;font-family:Consolas,sans-serif;color:rgb(197,57,41);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">4</span></p></td></tr></tbody></table></div><br><h3 dir="ltr" style="line-height:1.38;margin-top:16pt;margin-bottom:4pt"><span style="font-size:14pt;font-family:"Google Sans",sans-serif;color:rgb(67,67,67);background-color:transparent;font-weight:400;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Why another implementation of debuginfod?</span></h3><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Beyond the licensing aspect, there are benefits of multiple cross-compatible implementations of the debuginfo client and server., There is also an opportunity to optimize performance and add new features beyond elfutils’ debuginfod. For example, we could wrap the client with LLVM’s FS caching, fix issues such as infinite traversal when following symlinks, and extend support to Mach-O and other binary formats.</span></p><br><h3 dir="ltr" style="line-height:1.38;margin-top:16pt;margin-bottom:4pt"><span style="font-size:14pt;font-family:"Google Sans",sans-serif;color:rgb(67,67,67);background-color:transparent;font-weight:400;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">HTTP Server Benchmarks</span></h3><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">The debuginfod HTTP server is essentially a static file server. We expect that users who run production debuginfo servers will implement some advanced / customized configuration with load balancing etc. We wish to target developers who will want something simple that works “out of the box” on their local machine. With this user in mind, we should minimize dependencies and maintain good perf for even large (say, 5GB) debuginfo.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">To help pick an HTTP server, I have run preliminary tests comparing the following:</span></p><ol style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><a href="https://www.gnu.org/software/libmicrohttpd/" style="text-decoration-line:none"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">libmicrohttpd</span></a></p></li><li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><a href="https://github.com/nginx/nginx" style="text-decoration-line:none"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">nginx</span></a></p></li><li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><a href="https://github.com/h2o/h2o" style="text-decoration-line:none"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">h2o</span></a></p></li><li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><a href="https://github.com/yhirose/cpp-httplib" style="text-decoration-line:none"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">cpp-httplib</span></a></p></li><li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">“</span><a href="https://user.git.corp.google.com/shutty/llvm-http/" style="text-decoration-line:none"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">llvm-httpd</span></a><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">”, explained below.</span></p></li></ol><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">These servers were chosen to provide representatives from across the spectrum of candidate libraries. nginx and h2o are highly-optimized and fully-featured configurable standalone webservers. libmicrohttpd is a GNU library used by elfutils-debuginfod. cpp-httplib is a small single-header client-server library. Finally, “llvm-httpd” is a custom barebones 100-line HTTP fileserver using the posix socket and extended regex interfaces. This is intended as a stand-in for a small custom solution built on the LLDB TCPSocket library and LLVM regex library.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">In the benchmarking test, a single 5.1GB randomly generated file is fetched using curl sequentially 100 times from localhost. h2o was configured to serve static files from a directory. cpp-httplib was configured with a custom file streaming response handler that I wrote because the library’s default static file serving code is not optimized for large files.</span></p><br><div dir="ltr" style="margin-left:0pt" align="left"><table style="border:none;border-collapse:collapse"><colgroup><col width="101"><col width="105"><col width="105"><col width="105"><col width="102"><col width="105"></colgroup><tbody><tr style="height:48pt"><td style="border-width:0.75pt;border-style:solid;border-color:rgb(204,204,204);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">time (s) to download 5.1GB file, 100 trials</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(204,204,204) rgb(204,204,204) rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">libmicrohttpd</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(204,204,204) rgb(204,204,204) rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">nginx</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(204,204,204) rgb(204,204,204) rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">h2o</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(204,204,204) rgb(204,204,204) rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">cpp-httplib</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(204,204,204) rgb(204,204,204) rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">custom llvm-httpd</span></p></td></tr><tr style="height:15.75pt"><td style="border-width:0.75pt;border-style:solid;border-color:rgb(204,204,204) rgb(0,0,0) rgb(204,204,204) rgb(204,204,204);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">average</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">2.210117216</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">2.309044575</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">2.554523523</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">2.934914591</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">2.941232402</span></p></td></tr><tr style="height:15.75pt"><td style="border-width:0.75pt;border-style:solid;border-color:rgb(204,204,204) rgb(0,0,0) rgb(204,204,204) rgb(204,204,204);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">max</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">2.581766925</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">2.555327036</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">2.68060518</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">3.820860995</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">3.133437672</span></p></td></tr><tr style="height:15.75pt"><td style="border-width:0.75pt;border-style:solid;border-color:rgb(204,204,204) rgb(0,0,0) rgb(204,204,204) rgb(204,204,204);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">min</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">2.076668873</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">2.217972741</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">2.472362859</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">2.729681188</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">2.787481511</span></p></td></tr><tr style="height:27.75pt"><td style="border-width:0.75pt;border-style:solid;border-color:rgb(204,204,204) rgb(0,0,0) rgb(204,204,204) rgb(204,204,204);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">standard deviation</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">0.1216443211</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">0.04583248288</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">0.03125102196</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">0.1737419678</span></p></td><td style="border-width:0.75pt;border-style:solid;border-color:rgb(0,0,0);vertical-align:bottom;padding:2pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;text-align:right;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">0.09295689991</span></p></td></tr></tbody></table></div><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">As you can see from the table above, the custom ‘llvm-httpd’ is only 33% slower on average than the fastest server, libmicrohttpd.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Based on this outcome, we propose to proceed as follows:</span></p><ul style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Move the LLDB IOObject hierarchy code to LLVM itself as explained in the </span><a href="https://groups.google.com/g/llvm-dev/c/IbvheetpGKs" style="text-decoration-line:none"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">previous RFC</span></a><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">.</span></p></li><ul style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">We note that Clangd remote is being built on gRPC, which provides a TCP server and HTTP 2.0 client / server library. However we do not plan to use the gRPC protocol so we were thinking it would be better to use the lightweight TCPSocket implementation which is already in the LLDB codebase.</span></p></li></ul><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Implement llvm-debuginfod using cpp-httplib at first, then switch to the LLDB TCPSocket code after the refactor to eliminate cpp-httplib dependency.</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:"Google Sans",sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Leave the interface sufficiently modular to enable swapping out with a more featureful HTTP server library if needed.</span></p></li></ul><div><font color="#000000" face="Google Sans, sans-serif"><span style="font-size:14.6667px;white-space:pre-wrap"><br></span></font></div></span><span><div><span style="background-color:transparent;color:rgb(102,102,102);font-family:Roboto,sans-serif;font-size:10pt;white-space:pre-wrap">Noah</span><br></div></span></div></div></div>