From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id C6544385E006 for ; Fri, 27 Mar 2020 14:45:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C6544385E006 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mark@klomp.org Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id A185D3000735; Fri, 27 Mar 2020 15:44:59 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 3F682401443C; Fri, 27 Mar 2020 15:44:59 +0100 (CET) Message-ID: <41210680ae8394d22ec7f56013fccf96dce20db6.camel@klomp.org> Subject: Re: patch PR25722: /path/name based debuginfod-find & API lookups From: Mark Wielaard To: "Frank Ch. Eigler" , elfutils-devel@sourceware.org Date: Fri, 27 Mar 2020 15:44:59 +0100 In-Reply-To: <20200326013928.GB8051@redhat.com> References: <20200326013928.GB8051@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-5.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Mar 2020 14:45:01 -0000 Hi Frank, On Wed, 2020-03-25 at 21:39 -0400, Frank Ch. Eigler via Elfutils-devel wrot= e: > commit b27d38f7eed6d99715fd1cc8a70b0a6a2b04f0ce (HEAD -> fche/pr25722) > Author: Frank Ch. Eigler > Date: Wed Mar 25 21:36:51 2020 -0400 >=20 > PR25722: debuginfod client api: accept /path/names in place of buildi= d hex > =20 > As a convenience, this extends the debuginfod find functions (and thu= s > debuginfod-find) to accept a /path/name to an ELF binary as an > alternative to a hexadecimal string for buildid. Doc & testing incl. I like the functionality for debuginfod-find, but think it is not really appropriate for the debuginfod client API. It is a little hacky. The user code has to know that it has to call elf_version () first. The interface using path names is somewhat awkward since users probably already have an file descriptor or ELF handle open for the file. It adds a dependency on libelf and libdw for two convenience function calls that the user could do themselves. And it only handles the main build-id in the file, e.g. you cannot easily use it for fetching the multi/alt-file. I think we should move the functionality as is just into debuginfo-find=20 and experiment a bit with it before adding it as a public API to the debuginfod-client API. In debuginfod-find the code would also be slightly simpler since it doesn't have to convert to a hex-string first, it can just pass the build-id bytes as is. Cheers, Mark