Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3116843pxk; Mon, 7 Sep 2020 03:49:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxN7nlfY/fTfIpAtaokkzCptgbBvZReWbBT4o/YEwLFCsvoBQI1e4ms2NGShlfJ3Tm6Z8yw X-Received: by 2002:a17:907:20e5:: with SMTP id rh5mr20302590ejb.267.1599475790483; Mon, 07 Sep 2020 03:49:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599475790; cv=none; d=google.com; s=arc-20160816; b=W7dk9VuWeW1I/8mC6HKqEZ2E+kvh/fiZFF8cuYq6HviF85IVBEPDL4gAQ01HiVmZ6y 5HPc0ybutYLO1nAsdsj19BsPmdzR4MSE5omKur4l92ZxryzM2Bg7vF6c8vEnkoXuojNI ZaI07mleaxcDyWfXV0EdDIjMYb6cXPYXZXzaY5FB+/fSPq/2I2JGW6mPLW4s9A7nZ/oV VuuhN1ytTDH7JQiiPxWKMV/BbproLOJHJE6jikczBAXpTXoIHyxcMat0ZmdLUowsVyrr 7gOXIVfgUevesKns5rwZzvCHBK4MUMXCZImBNwKdy0As+tit4ijW+iMRb6kxN/y2WKzs Kvng== 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:message-id:subject:cc :to:from:date; bh=rkDHgPONIHNSh+g44rPN6IwCqrgNre/+ixvkxEhbPkw=; b=UMMzuNgeR3omvuPNcKnRJic/iO5VQqbVjRQPApw5OR5Wq08QT+HsRhiWfuW/zTvqJl diQH/a+7fh0Nn1oC0q7eCxvPYNBVDl2QGNTrxvHCV6E6cXzEzhoAvT5MBei7SSWGQ6wn cB5abxTq9aWsGiO9UKuAI3cnDva/Ilsz+WbzSBcDuEFyunduCsljwH4zoGyyjVY3dfnx 2RWZWmQajDyMM9Mw/mvGAPaWo899AcWQbGnikdZ7i+/+fwbYtvd8NPJmXNFcCHMjaov2 LgXkBQv9HzYg8otday+ohCXH4VlxIv1syfExldfn35ONMzDieBzH4Y8N47vgtL5TRoG2 ZKrw== 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 cz6si626639edb.142.2020.09.07.03.49.28; Mon, 07 Sep 2020 03:49:50 -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 S1728867AbgIGKsu (ORCPT + 99 others); Mon, 7 Sep 2020 06:48:50 -0400 Received: from foss.arm.com ([217.140.110.172]:60746 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728395AbgIGKst (ORCPT ); Mon, 7 Sep 2020 06:48:49 -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 07318106F; Mon, 7 Sep 2020 03:48:49 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E146D3F66E; Mon, 7 Sep 2020 03:48:47 -0700 (PDT) Date: Mon, 7 Sep 2020 11:48:45 +0100 From: Qais Yousef To: Dietmar Eggemann Cc: vincent.donnefort@arm.com, mingo@redhat.com, peterz@infradead.org, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org, valentin.schneider@arm.com, Phil Auld Subject: Re: [PATCH v2] sched/debug: Add new tracepoint to track cpu_capacity Message-ID: <20200907104845.6rust2lf2o3d5gmq@e107158-lin.cambridge.arm.com> References: <1598605249-72651-1-git-send-email-vincent.donnefort@arm.com> <20200828102724.wmng7p6je2pkc33n@e107158-lin.cambridge.arm.com> <1e806d48-fd54-fd86-5b3a-372d9876f360@arm.com> <20200828172658.dxygk7j672gho4ax@e107158-lin.cambridge.arm.com> <58f5d2e8-493b-7ce1-6abd-57705e5ab437@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <58f5d2e8-493b-7ce1-6abd-57705e5ab437@arm.com> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dietmar On 09/02/20 12:44, Dietmar Eggemann wrote: > + Phil Auld > > On 28/08/2020 19:26, Qais Yousef wrote: > > On 08/28/20 19:10, Dietmar Eggemann wrote: > >> On 28/08/2020 12:27, Qais Yousef wrote: > >>> On 08/28/20 10:00, vincent.donnefort@arm.com wrote: > >>>> From: Vincent Donnefort > > [...] > > >> Can you remind me why we have all these helper functions like > >> sched_trace_rq_cpu_capacity? > > > > struct rq is defined in kernel/sched/sched.h. It's not exported. Exporting > > these helper functions was the agreement to help modules trace internal info. > > By passing generic info you decouple the tracepoint from giving specific info > > and allow the modules to extract all the info they need from the same > > tracepoint. IE: if you need more than just cpu_capacity from this tracepoint, > > you can get that without having to continuously add extra arguments everytime > > you need an extra piece of info. Unless this info is not in the rq of course. > > I think this decoupling is not necessary. The natural place for those > scheduler trace_event based on trace_points extension files is > kernel/sched/ and here the internal sched.h can just be included. > > If someone really wants to build this as an out-of-tree module there is > an easy way to make kernel/sched/sched.h visible. > > CFLAGS_sched_tp.o := -I$KERNEL_SRC/kernel/sched > > all: > make -C $KERNEL_SRC M=$(PWD) modules Sorry for the late response. Was on holiday. IMHO the above is a hack. Out-of-tree modules should rely on public headers and exported functions only. What you propose means that people who want to use these tracepoints in meaningful way must have a prebuilt kernel handy. Which is maybe true for us who work in the embedded world. But users who run normal distro kernels (desktop/servers) will fail to build against `/lib/modules/$(uname -r)/build` where that internal header file is not exported. IOW, we're putting extra hoops for a large class of users here to be able to access these internal data. They have to maintain their out-of-tree definition of these structures. FWIW, I did raise this concern with Peter in 2019 OSPM and he was okay with the exports as it's still not a contract and they can disappear anytime we want. Migrating to using BTF is the right way forward IMO. I don't think what we have here is out-of-control yet. Though I agree they're annoying. Cheers -- Qais Yousef