Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4128703imb; Wed, 6 Mar 2019 06:06:21 -0800 (PST) X-Google-Smtp-Source: APXvYqwBV3Ecw5QXvabXbWm1e1mOy7mMqPe2nVale/ow9aNOv+UBX2JdXdyUShv9EQ7nfZad7B4v X-Received: by 2002:a17:902:2a47:: with SMTP id i65mr7230334plb.237.1551881181127; Wed, 06 Mar 2019 06:06:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551881181; cv=none; d=google.com; s=arc-20160816; b=sOSM4V/Cqvk733Nq3Di0Do7Z4I4TicWAadbBBzeKydPev0xxnbRxFEu6QRY/Vw+spi OF6BJjRbKxdD191PeAdZPSQ/byP11LncoYQXB+IRKmlGe4knMek8C3Cc2aP4ncPyq6Gv zUvP3huxinIf8XCA6qkRfIaQ/Kb1EVUv6bjE84cjWcq+i11dC03Rjn0wKSrT3nuT+Y6u 8HUcTqFFZEMrrjX/a3t+Woikzo/hdCas1vBjrw09Esznq6nxqQUMHQ/pd2PKymzyCBzT Kocikbc1j0wdKnck/yMiVkWfDkfDUJIpnm59mkUmVGTJ4S0QezfSyCt7riT+w8G7U97R 0zYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9P/2SFRC3TrjajfsV+8z3b3N6V9YVQ6E2tP7peiRKtA=; b=XgkgU3Q2ffGK6ZIBGrVdkiyyPcQUtWDvpGUArSgOwT1k6AS7OIfkJf/LxwC90x4uNu D3+t+lJLr3n6LIO7YI8sXgxCka33Trv02g28Z/DVlpdi1GRaXdxZ6EF/hO27QiKTbaL5 TAfanLOuhjXXD5NWao/qf5vcYF8tfl+NMW9cf0KFLdMcK+J9YCCLY9+Jl4su4K2Dv9gy wKGDy1FloNCvvqLeSB9hxXyiYHXQmfSoSZG2m2L+VF5xbH8meWSWubRwDEoTX8jgWKpD vUBGj7mgTb5WpLL9l6KdGfl79R5M2k+qNPxEHJJu8DH0X3h+vtnfYYGX331Kd1sc6tpL LKBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=O2NIIM9I; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c24si1437415pgg.534.2019.03.06.06.06.04; Wed, 06 Mar 2019 06:06:21 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=O2NIIM9I; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727715AbfCFLuN (ORCPT + 99 others); Wed, 6 Mar 2019 06:50:13 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:56194 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbfCFLuN (ORCPT ); Wed, 6 Mar 2019 06:50:13 -0500 Received: by mail-it1-f195.google.com with SMTP id z131so9008448itf.5 for ; Wed, 06 Mar 2019 03:50:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9P/2SFRC3TrjajfsV+8z3b3N6V9YVQ6E2tP7peiRKtA=; b=O2NIIM9IQuyvSmLOjrzGHnz2hOP5IWosgnRmuU07f0QiW1+fuHNpzt0mFYPx3hojws Yf5mYpx3Y6qyxX56vWLq62ek+ZROmH1LOAucHlKToEZc22VAgJlLtJ1tMZe900AsrpE7 sg0BDeIEHw6tnmK6rirEYZpfX1Wf2AkKnBkTXdA8R9SjsPIXUZoSO+bDMdqPWI6PAQVt uQ99AaJqQo7GltaLpWn06agQyOqyfYpzz/vZgT9m94TNL0LlM/z8Ll2SuBltyuvgZI7h I1wiKs5L9Ni1UvzYdMm5tylrsaXpc3nGReBtyOvVSTYkFyx/lgw4wz9jF7sCtk/+ifoJ 5CiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9P/2SFRC3TrjajfsV+8z3b3N6V9YVQ6E2tP7peiRKtA=; b=seZSP40zeeUqTvUvyhP0ssF4iUR01UYmI4nSNb9qr4wpRHowLFiHFQEAulbsPg7Dr9 a88r+0P5isT1foU6xkkNAJBlSvlr3mARadcKO7Pyoc8M64g9pSSgTbhWLBoUrQXLDF7g LF/PzLkHgPPmr9tjIU3g1a/dA3gwPurHYxOAwoQNYixCX0mMI1HuLIffwVY9tjAM11uH 62HTpctQwDx3pmj4m3IXLikty6FnaFD8WZVmEDFBC0Um5peJIqczjjKS/VzHzv6sslii /7rhM36cZJXX+VlkeQf7FwbpJvcCIQYqOkEkGzZLsAziNPZOVXQntek1O7OBg9Lqk9W5 uDug== X-Gm-Message-State: APjAAAVXOUJC8WLFzuxX23WxvHROqPai+hVzOQKvinFkoztjxf+XpwDs 9Dib2lDyPRKKSg14uc44+AJG9DApfosR59JwLg4= X-Received: by 2002:a02:13ca:: with SMTP id 193mr3988614jaz.117.1551873012358; Wed, 06 Mar 2019 03:50:12 -0800 (PST) MIME-Version: 1.0 References: <1551861826-12592-1-git-send-email-laoar.shao@gmail.com> <20190306100907.GT32477@hirez.programming.kicks-ass.net> <20190306112707.GU32477@hirez.programming.kicks-ass.net> In-Reply-To: <20190306112707.GU32477@hirez.programming.kicks-ass.net> From: Yafang Shao Date: Wed, 6 Mar 2019 19:49:36 +0800 Message-ID: Subject: Re: [PATCH] sched: fair: fix missed CONFIG_SCHEDSTATS To: Peter Zijlstra Cc: mingo@redhat.com, LKML , shaoyafang@didiglobal.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 6, 2019 at 7:27 PM Peter Zijlstra wrote: > > On Wed, Mar 06, 2019 at 06:15:39PM +0800, Yafang Shao wrote: > > On Wed, Mar 6, 2019 at 6:09 PM Peter Zijlstra wrote: > > > > > > On Wed, Mar 06, 2019 at 04:43:46PM +0800, Yafang Shao wrote: > > > > When I'm using trace_sched_stat_{iowait, blocked, wait, sleep} to > > > > measure how long the processes are stalled, there's always no output from > > > > trace_pipe while there're really some tasks in uninterruptible sleep > > > > state. That makes me confused, so I try to investigate why. > > > > Finally I find the reason is that CONFIG_SCHEDSTATS is not set. > > > > > > > > To avoid such kind of confusion, we should not expose these tracepoints > > > > if CONFIG_SCHEDSTATS is not set. > > > > > > Yeah, lets not sprinkle #ifdef. Big fat NAK. > > > > > > Also, the below seem to indicate your compiler is stupid. Without > > > CONFIG_SCHEDSTAT, schedstat_enabled() should be a constant 0 and DCE > > > should delete all code. > > > > > > > My compiler is GCC-7.3.0. > > I don't know which comipler could be smart enough to remove the > > definition of these tracepoints. > > Could you pls. tell me what compiler you are using ? > > Just look at the generated code... When CONFIG_SCHEDSTATS is not set, I have objdumped the vmlinux, and the perf_trace_sched_stat_template is still there withou my patch. $ objdump -D vmlinux > vmlinux.asm $ cat vmlinux.asm | grep trace_sched_stat ffffffff810b3b40 : ... So I can't get your point really. Forgive me if I missed something. Thanks Yafang