Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3576251pxf; Mon, 22 Mar 2021 09:35:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvFIttBkucPR+RMQaZGq7Saq3eAaYBQwO3eIOx6+4PPdEGE/Vm0rFuvBmrN24Z3CsKbOgu X-Received: by 2002:a17:907:1c1e:: with SMTP id nc30mr714051ejc.34.1616430902799; Mon, 22 Mar 2021 09:35:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616430902; cv=none; d=google.com; s=arc-20160816; b=hotL6be2QH9AYg+TbNV7l9MwyUENakPoDUxn/ms3U4ExIxsDltq2ZWWMJg5HrKIa4N zE4ptugJYDnQRnp+1vYv/RFhRep8nIZTpmjSRrtrxL4CzE67/1t56/fpmcXtGeuKy2wm uubYS9roAURO8rex1GMJ7ESWrhN9YbY/8B17w01Y0d1vXozVmv/085rvE0VKXfm4tQAc V0j3kNCGaxOJZjVQVwsIJXv5H1i8nM3TvZJHUKMVT5AwdFTYqeGrWyErPMfpzSDi9zFC En8Hc5stGv2S15mSo1KS0ynnuQNU8dHl8PMER8egLksw8tBiHidvE5Xq0DJA9IS39zCo qE6g== 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; bh=mxYSt9tsyr9CHjmigQT8Oa2HJ47JqNJaCkgEY4LYlwk=; b=NFY1srQRu+PWi1BRJ7nQNr/VhT79vDONr7nu3id+6sseUH+0T4bCDVWV0ZVm2CkEfl DXLfHTKKP+bBi6FiCnHaPGXjoZlKtvWYIr8d2X21LryVcFF4O1BvfoY0Hn8G/W+3qFJ0 0z1BDiVcG88p1QGFKttYgM/8xUaRy7NPUQW8UUAMwyJ/Opaq8LczmVD2tFtUvtw8mc00 BKT8xi1HUIBZGfOojIUEONo7KxdGm63W/YSPLI5NeWrovhrcJVIpn8X6uj+xuYzQELgV zMq9Pxg7fdcO8FHMm1ASOjpe/jCtchqj1k+F4r3wViFu4ipMgRGSajdnoo8KLYSrLzPR 0xEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h26si11359228edq.453.2021.03.22.09.34.39; Mon, 22 Mar 2021 09:35:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231817AbhCVQdQ (ORCPT + 99 others); Mon, 22 Mar 2021 12:33:16 -0400 Received: from foss.arm.com ([217.140.110.172]:34914 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbhCVQcx (ORCPT ); Mon, 22 Mar 2021 12:32:53 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8EA3D1042; Mon, 22 Mar 2021 09:32:52 -0700 (PDT) Received: from e107158-lin (unknown [10.1.195.57]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 58F993F719; Mon, 22 Mar 2021 09:32:51 -0700 (PDT) Date: Mon, 22 Mar 2021 16:32:48 +0000 From: Qais Yousef To: Steven Rostedt Cc: Alexander Sverdlin , Ingo Molnar , Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ard Biesheuvel , Linus Walleij , Florian Fainelli Subject: Re: [PATCH v7 2/2] ARM: ftrace: Add MODULE_PLTS support Message-ID: <20210322163248.id7qplbk6och6kuw@e107158-lin> References: <0c122390-6e76-f773-86e9-8c085f4384f2@nokia.com> <20210309174201.n53za7mw33dqyleh@e107158-lin.cambridge.arm.com> <3eecf51d-b189-9e8b-f19d-a49d0764aae5@nokia.com> <05608bc8-f44d-5f91-15ab-af00c59b53e6@gmail.com> <20210312172401.36awjh4hmj4cs6ot@e107158-lin.cambridge.arm.com> <134e1a2c-daac-7b00-c170-bcca434d08df@gmail.com> <20210314220217.4mexdide7sqjfved@e107158-lin> <20210321190611.d6a3hbqabts3qq5v@e107158-lin> <20210322110106.2bed3d50@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210322110106.2bed3d50@gandalf.local.home> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/22/21 11:01, Steven Rostedt wrote: > On Sun, 21 Mar 2021 19:06:11 +0000 > Qais Yousef wrote: > > > #ifdef CONFIG_DYNAMIC_FTRACE > > struct dyn_arch_ftrace { > > -#ifdef CONFIG_ARM_MODULE_PLTS > > struct module *mod; > > -#endif > > }; > > > > I know you want to reduce the "ifdefery", but please note that the > dyn_arch_ftrace is defined once for every function that can be traced. If > you have 40,000 functions that can be traced, that pointer is created > 40,000 times. Thus, you really only want fields in the struct > dyn_arch_ftrace if you really need them, otherwise, that's a lot of memory > that is wasted. Yes you're right. I was a bit optimistic on CONFIG_DYNAMIC_FTRACE will imply CONFIG_ARM_MODULE_PLTS is enabled too. It only has an impact on reducing ifdefery when calling ftrace_call_replace_mod(rec->arch.mod, ...) Should be easy to wrap rec->arch.mod with its own accessor that will return NULL if !CONFIG_ARM_MODULE_PLTS or just ifdef the functions. Up to Alexander to pick what he prefers :-) Thanks -- Qais Yousef