Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5286568iog; Wed, 22 Jun 2022 16:32:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t8RkIjNGRl5nSS4PQrlScKgDugoj7f4D1cMIudWBx+Fdn5oeXZ4qinX44aD00i6K3tSIuc X-Received: by 2002:a63:751b:0:b0:40c:9c39:c890 with SMTP id q27-20020a63751b000000b0040c9c39c890mr5011593pgc.302.1655940756969; Wed, 22 Jun 2022 16:32:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655940756; cv=none; d=google.com; s=arc-20160816; b=D6WxM9O05ACouOeAkVSbW0U/hUkPreqWd2KhEcAyrdnzlX9ADGpIIRo2BsGjEjnQyb 0QN7++j8uFmxLEte5W3laRtMgZSmmmqohCSjIodyTep6iUyGvYY/p8sWhVd5rnWGcI6n ml0O97gCHZXc2fzSW8g4tRwiNiocWQJJcNWFELV7/69JNYoQvy8h8j5A2RoLnivIA8Pa Zkzi8/JWCSG1QOd5tyouiFfOWutUEuGigKUpd2+rDTE3/CjJ/LdF1ptwUdF9qbS3eHgL ohR5O0TObqP+lTJtHDztYeDpsFnnGL1/2QgM96bknXaHDI569aGwCjo8Qn7Tu+fKHyVO 0Zkw== 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:feedback-id :dkim-signature:dkim-signature; bh=zObwhBmn5VRZQhkN+fOHap5f7+dJvPSHPdfpoTMXBqo=; b=Bze636LqpJ1ln6+s2CwzbaEeGD6R/ZJ72ezpuiyWAOG0n5kfRV4DQLoa89zu58/JRn bUjwjs799KXyqqqW1cMUVgLUrSqZwotsMPYHLE/gFdZSpTv57KBy/1SXc4c0Bcx5WKyM 2RKQ17q5qgpzZRKzoVVK0jx9FmcfGESrVo5aR6xXoJ+m7F7czejaImKSgVuWO697+A+r Jiut/EQvQHvfuJwWQLgLbjMNdoTj/JZ7yLUpHQVwiZy3M6bges8gTGR7r9ExNINhFbCw peQZgyVJYt1c3fRwfC1BZk+gUiVzNNj81zkLeSMBX4ldjlolo76Ky2eGwrQ6MlMAUqVJ wT4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@anarazel.de header.s=fm2 header.b=Uadwy22Q; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=XkpsJ1g+; 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 d70-20020a636849000000b0040d3fd7ddbdsi2299857pgc.334.2022.06.22.16.32.23; Wed, 22 Jun 2022 16:32:36 -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=@anarazel.de header.s=fm2 header.b=Uadwy22Q; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=XkpsJ1g+; 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 S1358274AbiFVXQt (ORCPT + 99 others); Wed, 22 Jun 2022 19:16:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377128AbiFVXQl (ORCPT ); Wed, 22 Jun 2022 19:16:41 -0400 Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B506A41F9D; Wed, 22 Jun 2022 16:16:28 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 2342E3200564; Wed, 22 Jun 2022 19:16:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 22 Jun 2022 19:16:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1655939785; x=1656026185; bh=zObwhBmn5V RZQhkN+fOHap5f7+dJvPSHPdfpoTMXBqo=; b=Uadwy22QHZ5Zza1m0x2J1u6xkk 9IyYmOPRBeHqH93r7Tt2EcJvOOz5gF+Sp5tn/2dlBsUzNunGEpksWJxxdEaiTo+6 ydqW+ADPtCWA2INADQcJq4ySnQof99E4w6OgQUo01fwtUY5P+56i/tlY7LGVpp2O bTqi+6xe6VMsRywO489lFgXl5U7COMpjQFCX/SAbTaSz7T7ZRco/ff2aKnIr7WNJ TxeirXij9NOg5818MV2nQubMsYuqdQ1jyewR2s4D4RbMrKMtgglXoZ4P1gg6iIHA IeuaSAfGuQDSnoCME/ya6QPK80+Hrw+BcFgm7OQOD0rIkepn0e8DVvnLNX2Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1655939785; x=1656026185; bh=zObwhBmn5VRZQhkN+fOHap5f7+dJ vPSHPdfpoTMXBqo=; b=XkpsJ1g+PBFOJbsZE3VfVl1Vn6L/ZwLtJeZuBeqyIt1K 8PvBdBV80Hb9jOPyCflrSP0Dpo1skHpP4rhp38TmsjgchStOHl5RRzZCc7GZu+8U WDGszuHAomf8fuGwfuqc0CXGrxN5g/BO/fjwdf01vojlutLXEUl3OKO6OTiMH+IF 5MNveS+D5kWxd3jqmhjbWgrjCgRfUlJyA77pEG4e9gIs8ow/6EmxPe7b4S3AL3pC HeJ5nvRzy6LHPFMktwKNSQb9DyyGNiY1U8x+ukgHWwUZLMDCXMAASBsqUx20wYwH Z34Csdy9oDpvSU3ZB9LgDw/u3M57K8tz3H64EAEPPg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudefiedgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepueelhedvkeehvddvgeevleektefhteefueefhefhteeigffgtdegkeek geeigeeunecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghl rdguvg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Jun 2022 19:16:25 -0400 (EDT) Date: Wed, 22 Jun 2022 16:16:24 -0700 From: Andres Freund To: Quentin Monnet Cc: open list , bpf , Arnaldo Carvalho de Melo , Andrew Burgess Subject: Re: init_disassemble_info() signature changes causes compile failures Message-ID: <20220622231624.t63bkmkzphqvh3kx@alap3.anarazel.de> References: <20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,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 Hi, On 2022-06-22 23:53:58 +0100, Quentin Monnet wrote: > Too bad the libbfd API is changing again :/ Yea, not great. Particularly odd that /* For compatibility with existing code. */ #define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC, FPRINTF_STYLED_FUNC) \ was changed. Leaving the "For compatibility with existing code." around, despite obviously not providing compatibility... CCed the author of that commit, maybe worth fixing? Given that disassemble_set_printf() was added, it seems like it'd have been easy to not change init_disassemble_info() / INIT_DISASSEMBLE_INFO() and require disassemble_set_printf() to be called to get styled printf support. > > The fix is easy enough, add a wrapper around fprintf() that conforms to the > > new signature. > > > > However I assume the necessary feature test and wrapper should only be added > > once? I don't know the kernel stuff well enough to choose the right structure > > here. > > We can probably find a common header for the wrapper under > tools/include/. One possibility could be a new header under > tools/include/tools/, like for libc_compat.h. Although personally I > don't mind too much about redefining the wrapper several times given > how short it is, and because maybe some tools could redefine it anyway > to use colour output in the future. I'm more bothered by duplicating the necessary ifdefery than duplicating the short fprintf wrapper... > The feature test would better be shared, it would probably be similar > to what was done in the following commit to accommodate for a previous > change in libbfd: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fb982666e380c1632a74495b68b3c33a66e76430 Ah, beautiful hand-rolled feature tests :) > > Attached is my local fix for perf. Obviously would need work to be a real > > solution. > > Thanks a lot! Would you be willing to submit a patch for the feature > detection and wrapper? I'll give it a go, albeit probably not today. Greetings, Andres Freund