Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2495177rwl; Thu, 13 Apr 2023 07:13:40 -0700 (PDT) X-Google-Smtp-Source: AKy350aNMWgJOU+oTpnfiHKY9SEVWoAST6I6dRFXvoNVOjxwY6WnYwQHoza7hdsXpI13V3xz1p3p X-Received: by 2002:a92:cf0f:0:b0:328:f8c5:bf9f with SMTP id c15-20020a92cf0f000000b00328f8c5bf9fmr1340764ilo.29.1681395219990; Thu, 13 Apr 2023 07:13:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681395219; cv=none; d=google.com; s=arc-20160816; b=jG4yjRM3Wdg5jxn+ezpeOuF7puVufMa7ogK1ldL6xj8A5BFMaRhAafiHZsYhhE6N3f VRf3F3a75RCcvuzqW9FovguO7N7GWPa+xdZfHYKPnigR3ZiJfkKgw/SI1mJcd/sK8VX7 EJGIJHLISp3kep9cI8NyBleWlGHrw61YGSs9WOjGw4lywCT8664Xplp4DxgpQzMeUqOs oL68HfJnuS/NHuDjZQnbrnu9AWlmbFq/agpzFQrCwBYGvQVq/sG9/Am7wizXY8kZAAf5 3Yjw3+n5cF6GczR1IOczJxxrxy7sA5+LZEQtvuY9VEssryKyRTj+sXqzttaTmxCR+j7I RBuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature:dkim-signature; bh=gSysC1iAzrWGzyyRkvP7TdkdCMQSjDJKYzQiTnEL8xs=; b=zbCbqA1nqK2kB3de7Iq2A5/z3GJCTxfyBabZtmPtgctfJykNuy/9Axgn5tOSsuVpFK F7vHk6yUw5obxk4uaCEYQzCnuwXk6s0d4mbhRjKyNOAbEi53Ghw5nfTg56gMInKNp9XW oGC/qxgmD2KZzjOelXBktx7nP0EZ7X6+dC1ct0V8zOOPMAirBV7XDq/P1fp09I61BwAy if45/4zrd4QJTvtg4gE/PKhfB3CnIRh14/bvH1/pNUljfdwl1FppvxctXMGvsEvLrGK0 Zl8pydFtQgZSc/r1par1PWxAnxyJ1awhhCk+w0UwXAWA3hk28BiGmtmtHxSRbJ7Sw+nb 1n1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=hjNfDkxR; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=VHD5w2E1; 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 d13-20020a92874d000000b00329633f2433si1451237ilm.58.2023.04.13.07.13.24; Thu, 13 Apr 2023 07:13:39 -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=@suse.cz header.s=susede2_rsa header.b=hjNfDkxR; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=VHD5w2E1; 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 S229746AbjDMODU (ORCPT + 99 others); Thu, 13 Apr 2023 10:03:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbjDMODR (ORCPT ); Thu, 13 Apr 2023 10:03:17 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B95DD1FFC for ; Thu, 13 Apr 2023 07:03:09 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 3F4A3218BB; Thu, 13 Apr 2023 14:03:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1681394588; h=from:from:reply-to: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=gSysC1iAzrWGzyyRkvP7TdkdCMQSjDJKYzQiTnEL8xs=; b=hjNfDkxRnbjBXxB5yx1yncszZS0UOSfH47dmzy+BOfnnBCv0a2+yhyKO4q50oeefi1vk4i 8+pVWIX1gkZ3wIYdH8QveEf16WkQHQDfwJ1rpdkX1i/GROWcGyHYTznWK+ga1qskni1KLd sQeC4kbZgL6nGWI34+4sXlNvHtfwRQw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1681394588; h=from:from:reply-to: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=gSysC1iAzrWGzyyRkvP7TdkdCMQSjDJKYzQiTnEL8xs=; b=VHD5w2E1hEmYe7reKXo10J3EZhVfFEeQLAOvUwCDniSAElGJMSJtAAA9uOVmiEwCv46wjR nYMCz+IA4FYSJ4Bg== Received: from pobox.suse.cz (pobox.suse.cz [10.100.2.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 22C1F2C143; Thu, 13 Apr 2023 14:03:07 +0000 (UTC) Date: Thu, 13 Apr 2023 16:03:07 +0200 (CEST) From: Miroslav Benes To: Peter Zijlstra cc: Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 5/9] objtool: Add verbose option for disassembling affected functions In-Reply-To: <20230413080822.GH4253@hirez.programming.kicks-ass.net> Message-ID: References: <4cadacc719db1e792c335309056960ca6f71139e.1681325924.git.jpoimboe@kernel.org> <20230413080822.GH4253@hirez.programming.kicks-ass.net> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_SOFTFAIL,URIBL_BLOCKED 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 Thu, 13 Apr 2023, Peter Zijlstra wrote: > On Wed, Apr 12, 2023 at 12:03:20PM -0700, Josh Poimboeuf wrote: > > + objdump_str = "%sobjdump -wdr %s | gawk -M -v _funcs='%s' '" > > + "BEGIN { split(_funcs, funcs); }" > > + "/^$/ { func_match = 0; }" > > + "/<.*>:/ { " > > + "f = gensub(/.*<(.*)>:/, \"\\\\1\", 1);" > > + "for (i in funcs) {" > > + "if (funcs[i] == f) {" > > + "func_match = 1;" > > + "base = strtonum(\"0x\" $1);" > > + "break;" > > + "}" > > + "}" > > + "}" > > + "{" > > + "if (func_match) {" > > + "addr = strtonum(\"0x\" $1);" > > + "printf(\"%%04x \", addr - base);" > > + "print;" > > + "}" > > + "}' 1>&2"; > > Do we want to have scripts/objdump-func.awk and use that to avoid the > duplication and eventual divergence of these awk thingies? I vote for that as well. To keep everything in sync can be a nightmare. Miroslav