Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp242081ybz; Wed, 15 Apr 2020 07:57:45 -0700 (PDT) X-Google-Smtp-Source: APiQypLNqf7xtQsRFDVzy1cZfWffv0PTVpzzkMZS6513OXEmS0WO2/fY43EK/Xl5lMWdNpvyPHJe X-Received: by 2002:a50:f095:: with SMTP id v21mr17297492edl.103.1586962665290; Wed, 15 Apr 2020 07:57:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586962665; cv=none; d=google.com; s=arc-20160816; b=wzaJY20QCoXcfcCpsdT+UOM/pvOD71AqF9AitnHuPqx0nLzm7cBqr+436l/jzaD0Jq QM99fHuqyDcKjD3ZjONxDnCTYfafgPyBTGG4TlNizhyCbHyuVCWmFctxrRkvQQk2BTQw Duxz1RqNRxW/H/8MmqulQhRHYeE0AWbNU821n3/wAxtbZZckkWxTfzTIosm9nLNEbQVj hN4eEhbw/y8JE0OuGsEWJk7yocWtVN2iciPPt1Y6jZ3jHpG9tZxKNnI8IklJOEPmj/MW JOeueGkrkmaxV1flw3gXJFyMdsaEoBD6+pv6fEDbLqteMqhsaE99AgdmybKmkr12Nl2n e40A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=H+e8CpwuQt3br3adX4sZ+yl+VTUYLq1a36xLLiCUkiE=; b=S8LtZ+SdJTB9UK/GdcVv5o7uQbu3+DRHALmihXCG1WrlY6no1ZEQu+xng+UC/R5nmY //NeGrnt/A0A5XyGUCtWGcuRqeguFTfaHrC8A5Q9gQS4JD6dh9aPGcqIPf9MQ3zagbix FKl4PEWp8Vh4/L6g9uyBreh+6wgfYeKoRwuXpxIb/90fzXqzxljJ4JEszEHEMKz6Y7Cn AuqvbuGrdwq0D3S3raJEt7TA/942+tkk1IB80ZHRDaU0qwT5GG8D5J0tqxh+x3q8YWDu zUL6G6jBrU7jm8vEAX5fQj9ErPh1r2KyzUNd0/FhYfVj0hET5Z1SuQk8BYktvzHjzwyn rJag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="msllIUY/"; spf=pass (google.com: best guess record for 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y90si3890644ede.610.2020.04.15.07.57.21; Wed, 15 Apr 2020 07:57:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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; dkim=pass header.i=@kernel.org header.s=default header.b="msllIUY/"; spf=pass (google.com: best guess record for 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389059AbgDOC7W (ORCPT + 99 others); Tue, 14 Apr 2020 22:59:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:50538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728709AbgDOC5w (ORCPT ); Tue, 14 Apr 2020 22:57:52 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 34EA92072D; Wed, 15 Apr 2020 02:57:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586919469; bh=Yjt5Xq2CfAH7PhBOXhU96HyCZf6QmoQWQKekQwpFeCg=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=msllIUY/kLaFCL4HM+f8aIub1ex1rah0PrYYaz/dyaYD+brlkSekA3MQC3seRRbvE YXfX8FG8V/HfIBAgx0GwdEm4XYTsWCCJPid3Uan7iY2mOS5INPdgBj8PHAjg5NGt48 sSi/0pgRi9WDdAQLCRsVZyOyAi2ir/+RzN2pchz4= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 0721B3522B2F; Tue, 14 Apr 2020 19:57:49 -0700 (PDT) Date: Tue, 14 Apr 2020 19:57:49 -0700 From: "Paul E. McKenney" To: John Stultz Cc: Josh Triplett , Steven Rostedt , lkml , Bjorn Andersson , Saravana Kannan , Todd Kjos , Stephen Boyd Subject: Re: On trace_*_rcuidle functions in modules Message-ID: <20200415025748.GV17661@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 14, 2020 at 07:20:01PM -0700, John Stultz wrote: > Hey folks, > So recently I was looking at converting some drivers to be loadable > modules instead of built-in only, and one of my patches just landed in > -next and started getting build error reports. > > It ends up, recently in the merge window, the driver I was converting > to module switched a trace_*() function to trace_*_rcuidle() to fix a > bug. Now when building as a module, if tracing is configured on, it > can't seem to find the trace_*_rcuidle() symbol. > > This is because, as you are aware, we don't declare trace_*_rcuidle > functions in modules - and haven't for quite some time: > https://lore.kernel.org/lkml/20120905062306.GA14756@leaf/ > > I wanted to better understand the background rationale for that patch, > to understand if not exporting the rcu_idle_exit and rcu_idle_enter, > calls was because they weren't used or if it was a more intentional > decision to avoid allowing modules to use them. > > Would it be reasonable to revisit that patch? Or is there some > recommended alternative solution? I will defer to Steven and Josh on the rationale. (Cowardly of me, I know!) What I do is to maintain a wrapper for tracepoints within a built-in portion of RCU, export the wrapper, and invoke the wrapper from the rcutorture module. Maybe you can do something similar? But why would a module be invoked from the idle loop? Is the module supplying an idle driver or some such? Thanx, Paul