Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp223395ybe; Tue, 3 Sep 2019 21:24:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPy1UiU7NpMu9E485kxvWfg8QplFqbbiE8zfvB0DiIyUH7MawFwxpUTbqg+Za8Y99LE4cO X-Received: by 2002:a17:90a:3b01:: with SMTP id d1mr1514792pjc.81.1567571073676; Tue, 03 Sep 2019 21:24:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567571073; cv=none; d=google.com; s=arc-20160816; b=IYATh8eURcI/NmIH8BFyQQvloKr1HR8Swh6DcsFOh3ql2oB+ZjkHuJRnzBh8FmFvaM RP9CH/nLGvBWcy1y/bHpXIzF+C74q+E1pYlS8euonJ+mtn8mfmobBAjTeZNCEZEF7I34 vk0qjwm6Vdx0hrg86WFU0yC/biJltZf8TOZYc0PBNyE6GUL6xm6nCP74gZUuHLPFe3Zc NxYRtEIxPr/2Lk1u6N78JaoBTWiZUnwIu/hnSzN5LHyMl5iId6jmraBWGIGCv8IZtwpv yvOn1DyuoD6dzQTELkB0WYaXtvlwBim8BrIKwgjHYTvO6cY84DnDjIupLcEYnkThjCjW t/gg== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Vgx/JXR+xsDdowArTuVaRCNwjOEb391A40/id0tFqc4=; b=j4VA12bytHchvHzsVjpTq2kFSftJQNENuAvTwTtqwloOqO3ibSikSsi1rgXFNqzeUB /F0+Zu1m7nDUPyoSQTmVSi9g5kd72gmIkQs7XZ+z9U6XZiyIBRlArdgNVpxFUZrR36ZN Nza5yjCf54ERIIC1LUCnre1rp5nXqzwZ22zt3dSpyeDJkE4tde4B+6dAUR+JFdzYWR+1 Po0SFwsA7dIMnqwoZO4w+e97o7aGub+FXMVI4lP9oh+36S/q9nolOzfNLNyIvgxbr3pl 3RX7TMdmawo1x2IO747NknGgzasoSWRuPGatR7vSnbtftfbx7G+bHki3dkXCZ2IPyk2q S6Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=d7+hNZWo; 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 f19si16693908plr.91.2019.09.03.21.24.18; Tue, 03 Sep 2019 21:24:33 -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=pass header.i=@joelfernandes.org header.s=google header.b=d7+hNZWo; 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 S1727756AbfIDEXM (ORCPT + 99 others); Wed, 4 Sep 2019 00:23:12 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:41748 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725840AbfIDEXM (ORCPT ); Wed, 4 Sep 2019 00:23:12 -0400 Received: by mail-pf1-f194.google.com with SMTP id b13so5744613pfo.8 for ; Tue, 03 Sep 2019 21:23:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Vgx/JXR+xsDdowArTuVaRCNwjOEb391A40/id0tFqc4=; b=d7+hNZWo6qi/Ei1kERkoCd9yUP3jMZTGVpswBCXwELQ+V66Tq9qjqOahSovrSsqtw4 eqmDU/Fkj3aJDbzGf3w359r+7lQ0j3e/XpJzomoS7cMAxP1uBHotGcuG32W9nmnpqEQz csKGqd6Nyjut44kghWQaw9W7wo0gDpKTmPOQ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Vgx/JXR+xsDdowArTuVaRCNwjOEb391A40/id0tFqc4=; b=TR+y+EPl95P/ukTMAHUAOQjEvMFuPeHkBkuFPrsCQdVM2F17PwSRklfkl0lco+G3fU IPn5m6VyqkAI2fdEmF4MSxaddCCMmIk+nGTrR8xSYF+vJ5knVR4sQcXCu3yZ8rXLyGbE byfYxK1oPaBTW+4f+43dtdk/4ReoIuRm5UaNIXSNfwsnnIiNrWLbMjeOTXO6J0M3YsjH PXoNCakntUOQ92H1pM2tjTrA+6lcgRm8yKVnDXn+V7a7af22PjXIjPv42kvEkYIdtoQ5 1qWOEefT7SZCXx3+AzCl0x0AE6p3E8tCzM3Qtvk96W+7jjwrIHlzezuP0VxJq7gk8mxq A1Jw== X-Gm-Message-State: APjAAAVcUQINEaotDYmKLlUZTmgRkcpSexne1ErhkkKosv8jok4r/vHd b1lDYD2p2ZujCrhVFlUqgWolrA== X-Received: by 2002:a62:d4:: with SMTP id 203mr13060737pfa.210.1567570991448; Tue, 03 Sep 2019 21:23:11 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id j128sm17865153pfg.51.2019.09.03.21.23.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2019 21:23:11 -0700 (PDT) Date: Wed, 4 Sep 2019 00:23:10 -0400 From: Joel Fernandes To: Valentin Schneider Cc: Radim =?utf-8?B?S3LEjW3DocWZ?= , linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Borislav Petkov , Dave Hansen , Steven Rostedt , "H. Peter Anvin" , Andy Lutomirski , Jirka =?iso-8859-1?Q?Hladk=FD?= , =?utf-8?B?SmnFmcOtIFZvesOhcg==?= , x86@kernel.org, Qais Yousef Subject: Re: [PATCH 2/2] sched/debug: add sched_update_nr_running tracepoint Message-ID: <20190904042310.GA159235@google.com> References: <20190903154340.860299-1-rkrcmar@redhat.com> <20190903154340.860299-3-rkrcmar@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 Tue, Sep 03, 2019 at 05:05:47PM +0100, Valentin Schneider wrote: > On 03/09/2019 16:43, Radim Krčmář wrote: > > The paper "The Linux Scheduler: a Decade of Wasted Cores" used several > > custom data gathering points to better understand what was going on in > > the scheduler. > > Red Hat adapted one of them for the tracepoint framework and created a > > tool to plot a heatmap of nr_running, where the sched_update_nr_running > > tracepoint is being used for fine grained monitoring of scheduling > > imbalance. > > The tool is available from https://github.com/jirvoz/plot-nr-running. > > > > The best place for the tracepoints is inside the add/sub_nr_running, > > which requires some shenanigans to make it work as they are defined > > inside sched.h. > > The tracepoints have to be included from sched.h, which means that > > CREATE_TRACE_POINTS has to be defined for the whole header and this > > might cause problems if tree-wide headers expose tracepoints in sched.h > > dependencies, but I'd argue it's the other side's misuse of tracepoints. > > > > Moving the import sched.h line lower would require fixes in s390 and ppc > > headers, because they don't include dependecies properly and expect > > sched.h to do it, so it is simpler to keep sched.h there and > > preventively undefine CREATE_TRACE_POINTS right after. > > > > Exports of the pelt tracepoints remain because they don't need to be > > protected by CREATE_TRACE_POINTS and moving them closer would be > > unsightly. > > > > Pure trace events are frowned upon in scheduler world, try going with > trace points. Qais did something very similar recently: > > https://lore.kernel.org/lkml/20190604111459.2862-1-qais.yousef@arm.com/ > > You'll have to implement the associated trace events in a module, which > lets you define your own event format and doesn't form an ABI :). Is that really true? eBPF programs loaded from userspace can access tracepoints through BPF_RAW_TRACEPOINT_OPEN, which is UAPI: https://github.com/torvalds/linux/blob/master/include/uapi/linux/bpf.h#L103 I don't have a strong opinion about considering tracepoints as ABI / API or not, but just want to get the facts straight :) thanks, - Joel