Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3641057yba; Tue, 9 Apr 2019 01:25:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6rEZT+CQaywKUBhEPk/c0GXrZouBOiAzvoym3Hue7h1uz5N7Rk8+tQjF6XUOow6twwTIk X-Received: by 2002:a17:902:f08a:: with SMTP id go10mr34450072plb.121.1554798356665; Tue, 09 Apr 2019 01:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554798356; cv=none; d=google.com; s=arc-20160816; b=ciCW3Y7fnd5boTxCQQ2jQJ1G35wj+7ppdfzIuiRHuBhafzUTonyR2pP3JQ3jjZ7iaa Uiov0RbnfzIDGuVbJjbTpyGTpoDFM0HVHRWgTrxbd2/8m0wik/EvKH59wrxFZnyjeUST k+YVHC3u/47vdXJd9wn11ynSx3fZJKyKkgdrXjLsCB6dnd0MGQ6MQ3uXfDh5HA4KtVmm NNCTaAtfruVpWvLDNcaVk03Y/lVRm8pqVzZSM/xu+h8BimLsZI9hgVKvRJElrw1NNhSC axbqQo3GXJZJ7ofoRsw8C9IY5bor3frMng0UMAlvZto2NxxUA1XUttYgbJZVJVfTvetR g4Mw== 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=1Piw2NRQ46h3DnBTIYveiRWkP+M4NADYOKvuXDxD2g4=; b=ZrONLMX/hBKLgEeldRwSTpRjHQx8n+RNtvPfPlBQqYbHvrH0P/limY7jz7nufPMdsL U180MWUC/lvm6DOLegaS/N+BaI0wm/tTkDOxsQZFGJNG2gRlDE3kZqMAo+KJByGWWbn+ AVXYdp9sNkULsVomCXVC9TJKRGODUv8elnR1YowQJv2Ib9R+7B5/RekI3fttttYxICWs lBej20lZluEpStY43CNy3Stdcr4u+Z6Y80CmOkxKvS54kCKDoYX3rqmRm/u/UKpPLcN0 eGHzO3fBQY6HMMCprh0WYgL/6xN6NkHKFVRHH86u2I0t6utrR7+XN4GB2j32w5/ylcJv 16Xw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j143si27428932pfd.124.2019.04.09.01.25.41; Tue, 09 Apr 2019 01:25:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726756AbfDIIY4 (ORCPT + 99 others); Tue, 9 Apr 2019 04:24:56 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:33408 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726112AbfDIIY4 (ORCPT ); Tue, 9 Apr 2019 04:24:56 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6973AA78; Tue, 9 Apr 2019 01:24:55 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.194.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E286C3F557; Tue, 9 Apr 2019 01:24:53 -0700 (PDT) Date: Tue, 9 Apr 2019 09:24:51 +0100 From: Qais Yousef To: rostedt@goodmis.org, peterz@infradead.org Cc: dietmar.eggemann@arm.com, quentin.perret@arm.com, bristot@redhat.com, juri.lelli@redhat.com, williams@redhat.com, linux-kernel@vger.kernel.org Subject: Re: Tracehooks in scheduler Message-ID: <20190409082450.mkcobfbmohhxqk6k@e107158-lin.cambridge.arm.com> References: <20190407175235.5c2livciovwgq7mm@e107158-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190407175235.5c2livciovwgq7mm@e107158-lin.cambridge.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 (+ LKML) Apologies forgot to CC the list. On 04/07/19 18:52, Qais Yousef wrote: > Hi Steve, Peter > > I know the topic has sprung up in the past but I couldn't find anything that > points into any conclusion. > > As far as I understand new TRACE_EVENTS() in the scheduler (and probably other > subsystems) isn't desirable as it intorduces a sort of ABI that can be painful > to maintain. > > But for us to be able to test various aspect of EAS, we rely on some events > that track load_avg, util_avg and some other metrics in the scheduler. > Example of such patches that are in android and we maintain out of tree can be > found here: > > https://android.googlesource.com/kernel/common/+/42903694913697da88a4ac627a92bbfdf44f0a2e > https://android.googlesource.com/kernel/common/+/6dfaed989ea4ca223f0913dfc11cdafd9664fc1c > > Dietmar and Quentin pointed me to a discussion you guys had with Daniel Bristot > in the last LPC when he had a similar need. So it is something that could > benefit other users as well. > > What is the best way forward to be able to add tracehooks into the scheduler > and any other subsystem for that matters? > > We tried using DECLARE_TRACE() to create a tracepoint which doesn't export > anything in /sys/kernel/debug/tracing/events and hoped that we can use eBPF or > a kernel module to attach to this tracepoint and access the args to inject our > own trace_printks() but this didn't work. The glue logic necessary to attach > to this tracepoint in a similar manner to how RAW_TRACEPOINT() in eBPF works > isn't there AFAICT. > > I can post the full example if the above doesn't make sense. I am still > familiarizing myself with the different aspects of this code as well. There > might be support for what we want but I failed to figure out the magic > combination to get it to work. > > If I got this glue logic done, would this be an acceptable solution? If not, do > you have any suggestions on how to progress? > > Thanks > > -- > Qais Yousef