Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4535862ybb; Tue, 14 Apr 2020 09:09:33 -0700 (PDT) X-Google-Smtp-Source: APiQypKxby1bQT6yfsBD2Yylv0pKMvpRUc1hboij/RPtH6VcqNqlOfCKpHRwaXT1E7PZF8Wj080G X-Received: by 2002:a17:906:2b89:: with SMTP id m9mr856577ejg.302.1586880573661; Tue, 14 Apr 2020 09:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586880573; cv=none; d=google.com; s=arc-20160816; b=DLa/xiVdUD5FZtUc6suZD7Hz5BGswvJPymQgG7XAiAAIfVrsuCsH2ZYGH11/mzeob/ jbHf34KMVvNgVnxNazqHgNqLHzNfrjSEioKC1DDkXpfUI6uHOP0Ko5x1oTNtAweUJMWc dHfoRskDax3bSufjmbRDKfWlquyRZX2Yi1yo8taF2POgLfnP9BIc/onwZV8dgy4nvfmG UdDiDuIqK2U/mxQmJf21N6JxQvvsgtJzeqUmHmo4xrsi/a3TRxn7jdsok2kgeCw7jC00 379XfvlzAIUTEcqLuFAJYwdb1kzy6RnVBscq7kOEyZeh+MNz1sO9/jp0LITBYCV4SCdk 1eIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=5QHCeqfyaSTGSDpETLFfXGP1uAtSb/Pgabn5X7MN5Pk=; b=QQ0kJl21a8m1xIQ91YvUyz3AJWAl1NkEmtG8YfL6QLbtUw6TW2r5UQZthyMqClET/R qz8kWZkfFQO9RuekS4cwfTbkbSanhFSlr1WcLrDQiOm22FfRfn9lXGyIRERUpaFDp9Rj yfA84Z5+1kf6wqpExSg/Fpvi1IY3uSQfVSqA3csm6whu28K2ZFkyWFcd/+D+b744JW1C eyReX6H51acze/EB/NNvjYUjbYwdw41/IEvO3q69eg/hUs5MjX02Y3ox1KHM7FN87yR2 epAMCa9nEMJyaluJlKjdz4ZmpLzwkJfqh/er0wGt1DKur9udzOqk9J4Voy4k2i6hPSJp /8Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P4U8A6tI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x8si9266603edr.548.2020.04.14.09.09.10; Tue, 14 Apr 2020 09:09:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P4U8A6tI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389370AbgDNORw (ORCPT + 99 others); Tue, 14 Apr 2020 10:17:52 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:47131 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389221AbgDNORq (ORCPT ); Tue, 14 Apr 2020 10:17:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586873864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5QHCeqfyaSTGSDpETLFfXGP1uAtSb/Pgabn5X7MN5Pk=; b=P4U8A6tI8EwFQfn1hpmYUJ1yVciVxWLMKfcN99rOFuBzsWgPVg0AL6ADGHNxX1/q1lQKKG w1/UShY1959/VP3lK4LfclqBFJ4JthBBx266yJ+lug9vEAH0h9+84J7rAspNHvX2cI+qGo U6eYOMz1D/j5eQBd0/LKqyifbpPYrrI= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-375-Jlm4Y5WyOaymaL1KWDTuAw-1; Tue, 14 Apr 2020 10:17:43 -0400 X-MC-Unique: Jlm4Y5WyOaymaL1KWDTuAw-1 Received: by mail-wm1-f72.google.com with SMTP id q5so2427276wmc.9 for ; Tue, 14 Apr 2020 07:17:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5QHCeqfyaSTGSDpETLFfXGP1uAtSb/Pgabn5X7MN5Pk=; b=A/W1Ya9eh25KI/yfV7f2a0uvBtRQVTmyIm4xtFiGjZs1Rp0U7CgX4P7fDTZJDyTIgo YDtNlaVzeAvGB+xgYyWwpzCQ3+ZI7mdXN1XNLmOO0q7KtOz3UjQnoRnrPLHlN4QK8bln HZbQgThX/DNc8xtkLI44bzcJ6nfOtlvhrW3BEx27qsSZXbgLMaFUR2S2Gr2k9xdrtvK8 00xrk2zkXpSYOGmki8FRLmR5B4MMMc9LSMNOL5Smsa2gX5xcqt3tfBYaFM5iwIfb37jM MDbKOnHfEBNK2fI5+wgjJ9ZzMJzJxaPv+hcKjaUFfwwTB1b0A6iFaC/HhtBLdUUw5kUw rx/w== X-Gm-Message-State: AGi0Pua3ARON/sXQrxvpjFSFcbfsuHakXtAvS+Nir5wJSGGzc+F5VKdZ XyW0WjSXseogoKuz+491ku8WgvgajSjK9+cU1oZx88+2G4S/f+cw0WzVqlHeE/38mvYscINwj7g /MDm/sBGDlDlK3fAPDLmgvyJA X-Received: by 2002:adf:fdc6:: with SMTP id i6mr24657323wrs.252.1586873861747; Tue, 14 Apr 2020 07:17:41 -0700 (PDT) X-Received: by 2002:adf:fdc6:: with SMTP id i6mr24657307wrs.252.1586873861531; Tue, 14 Apr 2020 07:17:41 -0700 (PDT) Received: from ?IPv6:2a01:cb14:58d:8400:ecf6:58e2:9c06:a308? ([2a01:cb14:58d:8400:ecf6:58e2:9c06:a308]) by smtp.gmail.com with ESMTPSA id a10sm19252822wrm.87.2020.04.14.07.17.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Apr 2020 07:17:40 -0700 (PDT) Subject: Re: [RFC][PATCH 00/36] objtool: Make recordmcount a subcommand To: Steven Rostedt Cc: Matt Helsley , linux-kernel@vger.kernel.org, Josh Poimboeuf , Peter Zijlstra , Ingo Molnar , Miroslav Benes References: <3a3f70df-07b0-91d9-33e1-e997e72b0c5c@redhat.com> <20200414093506.7b91bbbb@gandalf.local.home> From: Julien Thierry Message-ID: <064f41bd-0dfe-e875-df7c-214184c29fa7@redhat.com> Date: Tue, 14 Apr 2020 15:17:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200414093506.7b91bbbb@gandalf.local.home> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/14/20 2:35 PM, Steven Rostedt wrote: > On Tue, 14 Apr 2020 08:24:15 +0100 > Julien Thierry wrote: > >> If all you need from objtool it the elf parsing code, wouldn't it make >> more sense to move that out of objtool, as a utility library that both >> objtool and recordmcount could use (and perhaps other tools in the future?) >> >> In patch 3 you seem to mention that other tools already have their own >> code to parse elf. So instead of converting everything as an objtool >> subcommand, maybe just have the library with the required functionality. >> >> Any opinions on the above? What do people prefer? > > I think we discussed this before (and originally that was the plan), but I > believe one of the goals for bringing recordmcount into objtool is to speed > up the processing. Instead of having to read the elf sections for each use > case, we do it once, and then execute all the necessary operations for that > build. > > If we just have a elf parsing library, then each object file is going to > have that read redundantly for each operation that is done on it. > > I was hoping to have objtool handle all the operations needed that required > reading elf headers. > That makes sense, however, having each operation as an objtool subcommand doesn't solve that issue, right? Each invocation of objtool will re-read the elf object. I guess having all the relevant code in objtool as subcommand would be a first step towards that goal. > But if that's not what objtool maintainers want, then we can certainly go > back to looking at pulling out the elf headers, and have each tool be a > standalone again. > I'm no maintainer nor know their feeling about this and I haven't been part of the initial discussion. My main concern was about the approach of moving existing subcommand code to arch specific folders. Thanks for the explanations. Cheers, -- Julien Thierry