Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp4264302pxb; Tue, 19 Apr 2022 22:21:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgKiUmMFEuliyvlmc3alhUgKU7pI/uOREtjg31zAewxJvXXztWAAA3YXNdRbMvTT2WjgTq X-Received: by 2002:a17:907:7d8b:b0:6ef:f0c9:9498 with SMTP id oz11-20020a1709077d8b00b006eff0c99498mr3939162ejc.706.1650432081247; Tue, 19 Apr 2022 22:21:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650432081; cv=none; d=google.com; s=arc-20160816; b=XCzAqREYWZTQ/5CN8lGDNEj2ild1DRwja0/1rP+rgRDNaAAEqLgZWt2h3yuJNKsGeX phaimLjG927XIu0jrafPbOb4X1udBtm4rT9mjl5j1OOf5oOMs1z4x9WG4/6ovNcnnUd5 sDXFbYavXLHtt2/RTcl9+szJvMRafg14aIncYCjyd/GzCRUnGQw5YIQ0Srt6PRgDqz6g 43OgRJ0N53GAYR850ehl5WQ0jukCGn3ltL4x4C0k8tRlukepzXEjdQHR/SNJoThYNsdY plRJkpTxlljM9aW+jS/tnYUKXdk6ZDVoLWYpdeGBF5aJNu43l6yS3OvnAvnUCOo3JaBR +jWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+T7NqF6/cRpeqLTjnKQGsYUj/qWAJ0JiGzVJuAqgZKc=; b=RlrS9U+DRsZQ77paY4Gpbclfvb7GUEU4+JgbYtngJacZ+mOm8mq6d15YrgjFEn42ix rX4yF/wjmcmCrSJB8clj40WT1l9hW42pA3dX2c53vy1g03s/WZUqcgFwnlEv+V/0LaFE NkvslIVwhgC/I8V8J+mRMTnYp7OPj2366d/06oebhWhO4WHzb90YYoLUX0S4btjcOZ+v +at/RhBcUIDNQWRvUAfGRPY6+IHYbULCnsLTMGtPJ9vCK9wd5Htjsz07jWapVnxzMDP0 yw4OCdHYpfh5CbpguPU+PVdMIrajw33IQouwb4kDdWZaDJLTITJY5xNjL5yTIH7V7jHC UsoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=NLM0J+iu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b13-20020aa7df8d000000b0041d72e519e6si606089edy.629.2022.04.19.22.20.56; Tue, 19 Apr 2022 22:21:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=NLM0J+iu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350937AbiDSLSr (ORCPT + 99 others); Tue, 19 Apr 2022 07:18:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240937AbiDSLSq (ORCPT ); Tue, 19 Apr 2022 07:18:46 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A41CB15813 for ; Tue, 19 Apr 2022 04:16:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=+T7NqF6/cRpeqLTjnKQGsYUj/qWAJ0JiGzVJuAqgZKc=; b=NLM0J+iuLWHKNpKCGCeEkDju3W PDkQdkbLIlBXas0Nakn3n7fSu48s5ZDUW6QpOBpQ6DdbQnS19dC9nv8GF14cw5CS13mZ5qjd7dK60 8w7HFmptfY6DZ9Va/WAG6CzJUVpVeQKJ1Rgx0Z4q6njNtL1jTXYEJhSvOjt634deH72Kw/UbZXmgu VZpe3Rlf8E7pJvdyyRuIQLuU8q1x5A118h1rUTeAoLMTGt6ZyP/VOCFZZPujBtsq3WNC8K9vG6abi MkFWdAAID7AWh+CaFqYcwr2N+807tAUYKQrYBSrBlWwztjAcy0NN9WBQrObTgZfb0mtr9FV9wVIT0 CLTLh7Zg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nglpt-006nyQ-BA; Tue, 19 Apr 2022 11:15:57 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 36DC7986195; Tue, 19 Apr 2022 13:15:55 +0200 (CEST) Date: Tue, 19 Apr 2022 13:15:55 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Miroslav Benes Subject: Re: [PATCH v2 13/25] scripts: Create objdump-func helper script Message-ID: <20220419111555.GR2731@worktop.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 18, 2022 at 09:50:32AM -0700, Josh Poimboeuf wrote: > Add a simple script which disassembles a single function from an object > file. Comes in handy for objtool warnings and kernel stack traces. > > Originally-by: Peter Zijlstra > Signed-off-by: Josh Poimboeuf > --- > scripts/objdump-func | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > create mode 100755 scripts/objdump-func > > diff --git a/scripts/objdump-func b/scripts/objdump-func > new file mode 100755 > index 000000000000..140646c456fc > --- /dev/null > +++ b/scripts/objdump-func > @@ -0,0 +1,18 @@ > +#!/bin/bash > +# SPDX-License-Identifier: GPL-2.0 > +# > +# Disassemble a single function. > +# > +# usage: objdump-func > + > +set -o errexit > +set -o nounset > + > +OBJDUMP="${CROSS_COMPILE:-}objdump" > + > +command -v awk >/dev/null 2>&1 || die "awk isn't installed" > + > +OBJ=$1; shift > +FUNC=$1; shift > + > +${OBJDUMP} -wdr $@ $OBJ | awk "/^\$/ { P=0; } /$FUNC[^>]*>:\$/ { P=1; O=strtonum(\"0x\" \$1); } { if (P) { o=strtonum(\"0x\" \$1); printf(\"%04x \", o-O); print \$0; } }" > -- > 2.34.1 > This might rely on awk being gawk, I'm never very careful about those things.