Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp930620pxb; Fri, 22 Apr 2022 14:38:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzMIkMKgqwXb54uAppPQuxgYUv8O2T2Ij+kruVTtTGhMP7uvsTdXjXCHvVY2fCMizD3B3f X-Received: by 2002:a17:90b:350c:b0:1d2:f2d0:3a58 with SMTP id ls12-20020a17090b350c00b001d2f2d03a58mr18683182pjb.40.1650663486958; Fri, 22 Apr 2022 14:38:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650663486; cv=none; d=google.com; s=arc-20160816; b=JkBnSPVQ+m4eQUl+U/leUgwr6lvzU2uAwmVkfePW2UkrXhDPcnJSUfAXVyCP6a5ljz F3GPDxnyDqTxZapPp18q2/bFTa4bRy71MoP8OQRRxwSkXV3JHpyt3Coi5aSEEB5jfuOt 2z4vTf8shEKly7U8oR09wxFluJzK9YIgoJDPgpxsLvxdQTmNMUoAaR+u3+wQ4wJpxCxB 5wkMwLL0z9SFOuJi9Z8mUsJzEINEn+z/o2HkybheiquxxndA2NxLULM3q0hOjriR+L1a ZimYgOGlFQKUouEfGidJ4+m4rWMEqSiNCf0O/PGenDuGQ7S6cba2IenXQbvlWTfDDXw6 ZoSQ== 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=tRNqBkJETfPubt9Dm0CAyv1GilqtUrQGY4UheZs4bjI=; b=ZCSLi9svvvRp3Xb8K/lxytO1TQZQk40t5QEWEtTLSZ2FbaJBzOwOpZvFRZZxKjdv1s jmnlypjwX7Vm3KL9xNvd1p1rrdzZJLc/p+YtCSl0dhMN5xVO7/Ddejuz0Vn0yPY6pXdP YZDLY6oCMNP6HC6i17PcuGaHp6xEOlB55x+8JapbJfgv/iix4ALJ+FJEUIO13YYSRN6d TpB0+n+roMCzO749xEzG0m0W6UWjhgIzoIqmb0JNT87v7p5qy2oZ2LoKyABT5UV2uWQs RRs3G21JeQHmmj7H4on7m1EsnoL7Pbx9PkU56hJB//PaLSdC7+UTsmtbsCzziSdBtlSu GzTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MmZl+V08; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a38-20020a056a001d2600b005061e548749si9766017pfx.364.2022.04.22.14.38.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 14:38:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MmZl+V08; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5CE4A221699; Fri, 22 Apr 2022 12:45:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390829AbiDURk5 (ORCPT + 99 others); Thu, 21 Apr 2022 13:40:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345437AbiDURk4 (ORCPT ); Thu, 21 Apr 2022 13:40:56 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1683E49F9A for ; Thu, 21 Apr 2022 10:38:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650562685; 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: in-reply-to:in-reply-to:references:references; bh=tRNqBkJETfPubt9Dm0CAyv1GilqtUrQGY4UheZs4bjI=; b=MmZl+V08ejtGVH7lolpoF7Pou6hPsNc34IlLkHADeZgmgGyhqWClXiy35ZYYSgv5ZoBQX7 5CvjDJSCAoAtiGA79MnjRDzM2sbkGKJitXOlJr5SHIIfzHF/9jGZ6iuIqQkbeolHatGGSY JpVbBTqpJ1R847O8XvSIY9lXlS2SqQo= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-564-qUxz6sf_Pkiuanxv5y2oHQ-1; Thu, 21 Apr 2022 13:38:04 -0400 X-MC-Unique: qUxz6sf_Pkiuanxv5y2oHQ-1 Received: by mail-qv1-f71.google.com with SMTP id m16-20020ad45050000000b00446393a7a9fso4533912qvq.6 for ; Thu, 21 Apr 2022 10:38:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=tRNqBkJETfPubt9Dm0CAyv1GilqtUrQGY4UheZs4bjI=; b=AxOLRDl+/ycsD0MO4bJnhkkZERiHzWXhvA5XODwGYx83mJRBLEZrCWK3cacQ0M5HGZ VspQaOJoVXkuRXSRmdDwbeJBTlCn29EZsY6Ms7PieZhui7oXUQhiv73JKXeIZw5vWIts L4sFL5twj4+85MxXXtQe2UUdvQu2k374MNxZdfaNBNn32nAe4RL04yInzxsGouThhnwy Rcgon+jvT6hQhbxIomlKytvjd/nouBuLHZalpIoTBJ4wm/J1333zexwOIPqKNWjbov2C p40bdxvM5n3mne+7SD4rbT0ZTATa83HEZcp1vgw6cbXmhbwUEadAyp9qS7CR8fWW3BiR NUtQ== X-Gm-Message-State: AOAM530BFSGMXGlKwmj/ZBxNl9ji+1IJI+5yU77QiEOXElu947Fgbezs 6J/D0fmNAcH1WTV3NG2gD+dmAD35IeejstLenf04qHcBW/kOzR7XEFymeq8PV5VDHYhWD+JID/R mb9WdtBoZmBVz2FTWxt0YpOcb X-Received: by 2002:a05:620a:2493:b0:69c:4dbf:c75f with SMTP id i19-20020a05620a249300b0069c4dbfc75fmr396360qkn.116.1650562683468; Thu, 21 Apr 2022 10:38:03 -0700 (PDT) X-Received: by 2002:a05:620a:2493:b0:69c:4dbf:c75f with SMTP id i19-20020a05620a249300b0069c4dbfc75fmr396344qkn.116.1650562683232; Thu, 21 Apr 2022 10:38:03 -0700 (PDT) Received: from treble ([2600:1700:6e32:6c00::35]) by smtp.gmail.com with ESMTPSA id p13-20020a05622a048d00b002e1ce0c627csm4056892qtx.58.2022.04.21.10.38.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 10:38:02 -0700 (PDT) Date: Thu, 21 Apr 2022 10:37:59 -0700 From: Josh Poimboeuf To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Miroslav Benes , Borislav Petkov Subject: Re: [PATCH v3] scripts: Create objdump-func helper script Message-ID: <20220421173759.ijvytapqhoqpt22n@treble> References: <4d3ab1f17230f0188698cfbc7ba08696fe1abfe9.1650474927.git.jpoimboe@redhat.com> <20220421085244.GL2731@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220421085244.GL2731@worktop.programming.kicks-ass.net> X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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 Thu, Apr 21, 2022 at 10:52:44AM +0200, Peter Zijlstra wrote: > On Wed, Apr 20, 2022 at 10:16:36AM -0700, Josh Poimboeuf wrote: > > > +${OBJDUMP} -wdr $OBJ | gawk -M -v f=$FUNC '/^$/ { P=0; } $0 ~ "<" f ">:" { P=1; O=strtonum("0x" $1); } { if (P) { o=strtonum("0x" $1); printf("%04x ", o-O); print $0; } }' > > Two noteworthy changes: > > - $@ went missing, I've occasionally abused that to add extra argument > to objdump. Just to clarify, you'd add the extra arg at the end like this, right? objdump-func -Mintel > - you removed the glob after FUNC, I had that so that .cold and > .constprop etc.. variants of the function also show up. Sure, I'll match ".whatever" if there's a period, but not other substring matches, e.g. "put_page" shouldn't match "put_pages_list". {OBJDUMP} -wdr $@ $OBJ | gawk -M -v f=$FUNC '/^$/ { P=0; } $0 ~ "<" f "(\\..*)?>:" { P=1; O=strtonum("0x" $1); } { if (P) { o=strtonum("0x" $1); printf("%04x ", o-O); print $0; } }' -- Josh