Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3951029pxu; Tue, 20 Oct 2020 05:01:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0R8EPwopNUZ+wA2iX4I9U8NJAthkDCLriyKaxvfyUGNamutkn2s1SB9/6kplITPhQ7eY9 X-Received: by 2002:a17:907:20d6:: with SMTP id qq22mr2677054ejb.187.1603195296355; Tue, 20 Oct 2020 05:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603195296; cv=none; d=google.com; s=arc-20160816; b=qkclswp2f37MDuF0kBfG4h4kp1rZcX42CDPk7Z/BiHWboJ9/h7or/7qpf20crE4Zhj YMemTw7pJccv6ZRfcZacIf0aqZfByDX0HVy/ybn2q/3sccqAd5p9gapldKNaSs4vpilF LWatpx4auJ5lwSMVroNKIwyy88hkfXQARVpc+SuyCiqQbBq+6R5/jEj7NfZerhzEBS0V iLh7/nqkqSmk7XLzq4AN5viBD7l6bVHJS0eAQxcm8uejVfqFR1QC38mxIao9lq1mTsIJ Rokr0vGqAWVXy0ldU6wQ7pSf3+HFxweBFyIy8JUA0ae6/9hgtYFOK347vdkzy+r4+zvJ +EKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=b7rNBrbJyOklgvXn+EBdIfrcCXs++t44Dp9e/pPGlY8=; b=Ns99UvjiTmYCQdRlucgIe55ORyTsDkIXHfpviZA2ttdeD8nR5MwZfJ76MqqzQIY/Yr LFC0YHvITFTwYiO5IRZraCEoSik/8s/+rO2vRC6TtSJGsi7LPt5gOnFqnrawpXi2e1p2 qYoMuefudpfRTggtBG7pQmqLtpC450SU1Af6UnFRM58J/1uT018X7fDsv3ae2YbP0xdN t47pQTN8laa3mt7kgAOQlOGQsw6aZ7vmJEwvysE5mUwPEmBJKFgH86omQtCWhbgouR+G OjiBNr895kd69hyO2aB9bvly2Q0e7f9MjGgSZhMnsLnX/OlkyVocchmBzGEY4lHrgXuO jQHQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oc24si1062765ejb.530.2020.10.20.05.01.14; Tue, 20 Oct 2020 05:01:36 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393941AbgJTL7s (ORCPT + 99 others); Tue, 20 Oct 2020 07:59:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:39430 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393937AbgJTL7s (ORCPT ); Tue, 20 Oct 2020 07:59:48 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 6ACB0AD82; Tue, 20 Oct 2020 11:59:47 +0000 (UTC) Subject: Re: [PATCH 1/3 v2] tracepoints: Add helper to test if tracepoint is enabled in a header To: Steven Rostedt , linux-kernel@vger.kernel.org Cc: Yafang Shao , Axel Rasmussen , Andrew Morton , Michel Lespinasse , Daniel Jordan , Davidlohr Bueso , Linux MM , Ingo Molnar , Joonsoo Kim References: <20200925211206.423598568@goodmis.org> <20200925211819.767526657@goodmis.org> From: Vlastimil Babka Message-ID: <8b122215-867a-2517-f754-fbe87118f00c@suse.cz> Date: Tue, 20 Oct 2020 13:59:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: <20200925211819.767526657@goodmis.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/25/20 11:12 PM, Steven Rostedt wrote: > From: "Steven Rostedt (VMware)" > > As tracepoints are discouraged from being added in a header because it can > cause side effects if other tracepoints are in headers, as well as bloat the > kernel as the trace_() function is not a small inline, the common > workaround is to add a function call that calls a wrapper function in a > C file that then calls the tracepoint. But as function calls add overhead, > this function should only be called when the tracepoint in question is > enabled. To get around this overhead, a static_branch can be used to only > have the tracepoint wrapper get called when the tracepoint is enabled. > > Add a tracepoint_enabled(tp) macro that gets passed the name of the > tracepoint, and this becomes a static_branch that is enabled when the > tracepoint is enabled and is a nop when the tracepoint is disabled. > > Signed-off-by: Steven Rostedt (VMware) Nice! I'm late here, but you mentioned a v3, so FWIW: Acked-by: Vlastimil Babka