Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1386245ybi; Thu, 30 May 2019 16:54:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxD15Nv1h2CJdlWQeXTNHPT0XY/jUqumOTQPxVScL8FjYzEYBqbNcnSaHdUdSGjyxXz1TOA X-Received: by 2002:a63:191b:: with SMTP id z27mr5936426pgl.327.1559260460178; Thu, 30 May 2019 16:54:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559260460; cv=none; d=google.com; s=arc-20160816; b=Pl2Q14gVgD0D/LkHo7hEI3JBrjIBFjixt1e41UNkEEmprnyWzlS0KSZoErZnZVET5P /uuYOk1K2rYIFdKB/0xdCdeLbmbf82maSxwBB+YWkZLSoYRhCCcqDVsd1jVp+MSnJG5l EGD7xhVWfphzGB2wA2xln/7Wl3mWGmQ53TSzk30X/ErSfuSOKH7MDGI5ZtyUSn9QsGuy ngOkfZsLhfBAz6LxJBy25DZsHp+n6eFIwjUEjUcZO1/Dpcb2WbqNZq5jfrIw5LCYSD6C FAtF5Lkf0zAAjp/Z4XQpUg7FQK0lzDNNjeei+GxzFLoPDX+Z566LSwTTPTJY51X1Iw8y 2xaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=eP6jqgXidwDyhUxYZNRdU0ehOBe80dwhWMAuJ2LKJCQ=; b=QwPj9bp8nynip68JwVpjpvVgXvMrBX0YrISRT4Fw1+Ti1/jroDn+D4cU0FI3AfVpow xQgp8yLOthHbD62IE/YKDYYheE35ckAiEhmfdWZSfpv1/S391Pc16E23y7499E18QhNr 6bzRwM3ymBHBorA4cGb/9m9bsCMaB47aR+gMwxUkHS0xUtSawUUmn6mC1rPbD5cGmn0p u04dYoA3I3XEisjhOAbKtKrWB68c5ys3zJy2BiUn80na35F6u6EbpnFi9+UpRbJhUqcW rLQn9iomGbLLMpYD1stiVAZafbL0k0B+S5A4YygOwk+VbuHHz9htBsTMsshx8hyeN2q1 NPww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f62si4111180plf.88.2019.05.30.16.54.04; Thu, 30 May 2019 16:54:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726649AbfE3XwW (ORCPT + 99 others); Thu, 30 May 2019 19:52:22 -0400 Received: from ex13-edg-ou-001.vmware.com ([208.91.0.189]:34378 "EHLO EX13-EDG-OU-001.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbfE3XwV (ORCPT ); Thu, 30 May 2019 19:52:21 -0400 Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-001.vmware.com (10.113.208.155) with Microsoft SMTP Server id 15.0.1156.6; Thu, 30 May 2019 16:52:01 -0700 Received: from localhost (unknown [10.129.221.179]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 4B4FA4154D; Thu, 30 May 2019 16:52:20 -0700 (PDT) Date: Thu, 30 May 2019 16:52:19 -0700 From: Matt Helsley To: Josh Poimboeuf CC: Peter Zijlstra , LKML , Ingo Molnar , Steven Rostedt Subject: Re: [RFC][PATCH 00/13] Cleanup recordmcount and begin objtool conversion Message-ID: <20190530235219.GB63275@rlwimi.vmware.com> Mail-Followup-To: Matt Helsley , Josh Poimboeuf , Peter Zijlstra , LKML , Ingo Molnar , Steven Rostedt References: <20190528144328.6wygc2ofk5oaggaf@treble> <20190529134152.GX2623@hirez.programming.kicks-ass.net> <20190529141145.4tycu25a3os3fpgr@treble> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190529141145.4tycu25a3os3fpgr@treble> User-Agent: Mutt/1.11.3 (2019-02-01) Received-SPF: None (EX13-EDG-OU-001.vmware.com: mhelsley@vmware.com does not designate permitted sender hosts) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 29, 2019 at 09:11:45AM -0500, Josh Poimboeuf wrote: > On Wed, May 29, 2019 at 03:41:52PM +0200, Peter Zijlstra wrote: > > On Tue, May 28, 2019 at 09:43:28AM -0500, Josh Poimboeuf wrote: > > > Would it be feasible to eventually combine subcommands so that objtool > > > could do both ORC and mcount generation in a single invocation? I > > > wonder what what the interface would look like. I think it'll be feasible. I've done a bit of investigation but don't have patches for it yet. > > > > objtool orc+mcount ? > > > > That is, have '+' be a separator for cmd thingies. That would of course > > require all other arguments to be shared between all commands, which is > > currently already so, but I've not checked the mcount patches. > > The problem is that you have to combine "orc generate" with "mcount > record". Because even the subcommands have subcommands ;-) > > And also sharing arguments between all subcommands isn't ideal. > > Maybe could do: > > objtool orc generate [orc options] + mcount record [mcount options] I think that makes more sense; it'll be easier to construct Make recipes this way. I was thinking '+' would be something like the getopt handling of the '--' argument where it stops argument parsing so someting else can consume the remainder. The really interesting part is deciding which file to operate on is specified by the arguments to the first subcommand and subsequent subcmds would then operate on the same object file. For example: objtool orc generate [orc opts] foo.o + mcount record [mcount opts] Would it be clearer what's going on if the object file(s) were specified first and then the passes to run and their arguments came afterwards? I'm thinking it'd go somewhat like this: objtool foo.o [bar.o] -- check [check opts] + \ orc generate [orc opts] + \ mcount record [mcount opts] Then objtool would iterate over the object file(s) to open, hand off the ELF data structures into each successive pass, and finally write any accumulated changes back. Cheers, -Matt