Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2234379yba; Mon, 6 May 2019 02:10:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxi55Y2kjTmxxsDX9rwmBd+cNbFGe4QbghuicB2TZccSL90qqc+MqxB6T/QEfcc7qf5rX5c X-Received: by 2002:a17:902:b589:: with SMTP id a9mr31320955pls.66.1557133831549; Mon, 06 May 2019 02:10:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557133831; cv=none; d=google.com; s=arc-20160816; b=g+FpeLlm69T2dRyM/OGFLvTYUO2/+XaVEgw0LhMIf8Q0VmR+5iJoZHgoeNSINouZ21 6us0SyBpco+0KvBpVWytRISzFrIsKVxZULVKwWk+JjXBPnxq90D37UBF+cp8YZkUKBfZ utJp0l78uw7D0OCZO+7Oqwgbo3ISUshsAl1KnitZH6XnDe0y8q3NmEJMB34fQ9WooUpZ QAHAacVyVnB+bN6iGeIOPwFMEhpk+UeJ5b4399bb/d3uSiUyHTMTL1hArXf+K7HjMzp3 WQoktO0Um+HNTfvIaHAtb0gijGO9kPfU313Ki1qlUihGoVN5JbTN/jhlonOhQ1aQfve/ O3/A== 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:dkim-signature; bh=YyrAjxgQ6wZlNZ+nR1R9DcRAUSs/j51oPpwN+AtbQYw=; b=kCLWAQuvSOKuDauYOdBLIoM0Tf4pE6vtxLaAs0aeYHNR3WElukrVXe8INVEXAq9vb5 vgzGidEtfO13CnL3HKAUGNqXxcaNJzmDrGgsDcX+1TJIvKKNn4SAMbKpx3iODajwLVxl fjv4OmNKLWxDNbgdpTvFF1i6CQOOGfR95Dohkzz3fC/S0FiwjAPVjraMwSI0n2VIx613 YWKAStiNltkI0Hu8+iRn4PfSSeNB8lLG/ep3eCrXskXOqL8ZQ1b/ZkR8Gzxz6K6JwSIb 5phuqBHqZ8I5XIDigom2lTVTUSEkcQtHcPuTLwvtRNTlhModPqUGUhBi7/5zhsI0GgZ3 MgBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Dhi6pPP5; 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 o16si13675795pgj.392.2019.05.06.02.10.15; Mon, 06 May 2019 02:10:31 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Dhi6pPP5; 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 S1726197AbfEFJJS (ORCPT + 99 others); Mon, 6 May 2019 05:09:18 -0400 Received: from merlin.infradead.org ([205.233.59.134]:52710 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbfEFJJS (ORCPT ); Mon, 6 May 2019 05:09:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=YyrAjxgQ6wZlNZ+nR1R9DcRAUSs/j51oPpwN+AtbQYw=; b=Dhi6pPP5I7t80yBo+iaCaym9z /NW9/6sN20rgT1Ffx6kaertv1hD4m20HL5CV2/42soS7neypQffC6KLCV8ol6yuR+nuNU48RV3LmV Yb5OhS0sfs20evHJvlEnQGiNSEolffLruW7zwq4t11o/F24vaiD3DalSkNHJ5vZ5VGKGOh+3RugM6 Xcz3sMN6hnCYz32aEbydmn8bTOg0/nVC8ZQCB0eB8AgNxHI3uQD+weYqOjOLMKfONQJ5SdercZR7P YTmmwWpTrBuBLH9tuvtr7rM5UjjrqZsGnmBbsy/5NPmRXEp4eN/a5zTuNkamY2GAZqysAVA8NUgi2 NN2TuvNKg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hNZcL-0006Yx-8a; Mon, 06 May 2019 09:09:01 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1A961286AB2A0; Mon, 6 May 2019 11:08:59 +0200 (CEST) Date: Mon, 6 May 2019 11:08:59 +0200 From: Peter Zijlstra To: Qais Yousef Cc: Ingo Molnar , Steven Rostedt , linux-kernel@vger.kernel.org, Pavankumar Kondeti , Sebastian Andrzej Siewior , Uwe Kleine-Konig Subject: Re: [PATCH 4/7] sched: Add sched_load_rq tracepoint Message-ID: <20190506090859.GK2606@hirez.programming.kicks-ass.net> References: <20190505115732.9844-1-qais.yousef@arm.com> <20190505115732.9844-5-qais.yousef@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190505115732.9844-5-qais.yousef@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 05, 2019 at 12:57:29PM +0100, Qais Yousef wrote: > +/* > + * Following tracepoints are not exported in tracefs and provide hooking > + * mechanisms only for testing and debugging purposes. > + */ > +DECLARE_TRACE(sched_load_rq, > + TP_PROTO(int cpu, const char *path, struct sched_avg *avg), > + TP_ARGS(cpu, path, avg)); > + > +DECLARE_TRACE(sched_load_se, > + TP_PROTO(int cpu, const char *path, struct sched_entity *se), > + TP_ARGS(cpu, path, se)); > + > +DECLARE_TRACE(sched_overutilized, > + TP_PROTO(int overutilized), > + TP_ARGS(overutilized)); This doesn't generate any actual userspace because of the lack of DEFINE_EVENT() ? > diff --git a/kernel/sched/sched_tracepoints.h b/kernel/sched/sched_tracepoints.h > new file mode 100644 > index 000000000000..f4ded705118e > --- /dev/null > +++ b/kernel/sched/sched_tracepoints.h > @@ -0,0 +1,39 @@ Like with the other newly introduced header files, this one is lacking the normal include guard. > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * Scheduler tracepoints that are probe-able only and aren't exported ABI in > + * tracefs. > + */ > + > +#include > + > +#define SCHED_TP_PATH_LEN 64 > + > + > +static __always_inline void sched_tp_load_cfs_rq(struct cfs_rq *cfs_rq) > +{ > + if (trace_sched_load_rq_enabled()) { > + int cpu = cpu_of(rq_of(cfs_rq)); > + char path[SCHED_TP_PATH_LEN]; > + > + cfs_rq_tg_path(cfs_rq, path, SCHED_TP_PATH_LEN); > + trace_sched_load_rq(cpu, path, &cfs_rq->avg); > + } > +} > + > +static __always_inline void sched_tp_load_rt_rq(struct rq *rq) > +{ > + if (trace_sched_load_rq_enabled()) { > + int cpu = cpu_of(rq); > + > + trace_sched_load_rq(cpu, NULL, &rq->avg_rt); > + } > +} > + > +static __always_inline void sched_tp_load_dl_rq(struct rq *rq) > +{ > + if (trace_sched_load_rq_enabled()) { > + int cpu = cpu_of(rq); > + > + trace_sched_load_rq(cpu, NULL, &rq->avg_dl); > + } > +} > +static __always_inline void sched_tp_load_se(struct sched_entity *se) > +{ > + if (trace_sched_load_se_enabled()) { > + struct cfs_rq *gcfs_rq = group_cfs_rq(se); > + struct cfs_rq *cfs_rq = cfs_rq_of(se); > + char path[SCHED_TP_PATH_LEN]; > + int cpu = cpu_of(rq_of(cfs_rq)); > + > + cfs_rq_tg_path(gcfs_rq, path, SCHED_TP_PATH_LEN); > + trace_sched_load_se(cpu, path, se); > + } > +} These functions really should be called trace_*() Also; I _really_ hate how fat they are. Why can't we do simple straight forward things like: trace_pelt_cfq(cfq); trace_pelt_rq(rq); trace_pelt_se(se); And then have the thing attached to the event do the fat bits like extract the path and whatnot.