Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2183841ybe; Tue, 3 Sep 2019 09:07:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNbbu6T7e2CXcNXID9T764oNXVTZwb8PdFbG8WozmGdhStVx1qYZj4U3GV+R03EuIyLBs9 X-Received: by 2002:aa7:87d8:: with SMTP id i24mr40645619pfo.88.1567526837041; Tue, 03 Sep 2019 09:07:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567526837; cv=none; d=google.com; s=arc-20160816; b=CLGk0lmKnoZrrsEK+4eSkVEqG9cVAG3EpsJr2A4cckHv8vDtPF5HNDcX0Y0vp/+1A/ uOMyILAutO+Ze2ehJjea0EABgIUBjNufj02ldHqoExFGEG3ze0RkV4fWA6/7BN3Uj+NU 9PKL9TLmZCwmlTi0poJCweV8+itKwS8RS9uEiSe+6xB3bBAYh4c73vLtDTlMI6EubfID JOPMhp97wlLbmpELGUhrOlzZPvHoHAApUp9nwIyZH6w55ZTxiLeCjnSMWqVoyeBWLhcT ZyGffS6xkTY9ASFw4tjss+lBqiWO02btDPf+kzA/etQpOf0PF0LkamrFyeX+cSZ/50Yn 13Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=SkRQbISN5Nbb9GI/H0kgPcBERlU91eWRE8t+NkyVzjI=; b=gH4GBiceGAIsO4Na1Tm6B4YoHamF317P5vGrpJ1okyoB+tV9CJFm5RNf+0E9Y7/vW5 uud8mZi/1uDI3rvJfv5GuR9whne4Dphal2gsNWHCiyG4VkgXMZfsjIq1wP1SM13mSrlw UTbj80E7ave5sJJo9WTrMHxN/+gQ5NsoOG0oE5pvJMQNRjSXVZlx5J3HePFwt2ApWlH0 tq+UMTMqegOB8Cd//h7CwVG581+CNn9EPgJz+z+tfs22wPuraM8Rgj0BB+cNmMPatTxd 3uxBIlkk1vL1ja2ALJVvMRjcNS8xmgfh7sMIGyPB8wBrnF+PMUpzsEF3lqHHMBLsA//A OWyw== 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 b185si2710185pfb.73.2019.09.03.09.07.00; Tue, 03 Sep 2019 09:07:17 -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 S1729930AbfICQFv (ORCPT + 99 others); Tue, 3 Sep 2019 12:05:51 -0400 Received: from foss.arm.com ([217.140.110.172]:39712 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729709AbfICQFu (ORCPT ); Tue, 3 Sep 2019 12:05:50 -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 5FC3E360; Tue, 3 Sep 2019 09:05:50 -0700 (PDT) Received: from [10.1.194.37] (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AAC203F246; Tue, 3 Sep 2019 09:05:48 -0700 (PDT) Subject: Re: [PATCH 2/2] sched/debug: add sched_update_nr_running tracepoint To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , linux-kernel@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Borislav Petkov , Dave Hansen , Steven Rostedt , "H. Peter Anvin" , Andy Lutomirski , =?UTF-8?Q?Jirka_Hladk=c3=bd?= , =?UTF-8?B?SmnFmcOtIFZvesOhcg==?= , x86@kernel.org, Qais Yousef References: <20190903154340.860299-1-rkrcmar@redhat.com> <20190903154340.860299-3-rkrcmar@redhat.com> From: Valentin Schneider Message-ID: Date: Tue, 3 Sep 2019 17:05:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190903154340.860299-3-rkrcmar@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 :).