Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4179786imb; Wed, 6 Mar 2019 07:14:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwzKM2PHfP4grZDVwFWvi6lCrU3BTJmHfy9Wpt8/13+1xyZqxgF2sr0lKGiO3Acy2bNWmPV X-Received: by 2002:a17:902:854b:: with SMTP id d11mr7216018plo.224.1551885278881; Wed, 06 Mar 2019 07:14:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551885278; cv=none; d=google.com; s=arc-20160816; b=jAFvRExZhk/DstUSw3otrFlFaLMGqhWFzQqW0nZaJCywLc2TRGQMvGBipfDZf+LKw+ AJqh69fD17ZSdQQpDGozwr0EqP4Ti2ie3DmQWXxcT0fWoQPjtqqHZmDvEyYK04bbsct7 WbrHYU75uYJOZT/GYcrhN1F+QXtaZPGl63H+Gu7z+sVKioUHfWOW2GCFzstPlRHVoGYs D7eJhZtaHFpSKjvfxdlAHL7f2AA/4G8wEslEHCBsEAuMYXLSBz9aGUPxXYqKddjFNeqf 99KmCz0kbKx8ghLqqAVHVk26OpKSY7tWNiNIT7vIqwni6nfIfBSdJPmKGGThPTO1dCrv pTXg== 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=kfpJRDy1xHfMNuiuhzjAegVPQHwdm/b8Qr2fOAvHYnY=; b=YmzGaLP/mrc3bqxiIjcUTT0J+HoRroDBA9wn9eM5d+0cTLMu0doulFHYKFebU1FpDm isjNl44KaS9wKPcKKnLee8szKvuZEUYgqxbynyxOGt2+8kuEssiEaKk6t4fFSymGXz4K ICOeLl8L+/YvOJUtBF6imzh/ZlIijD4SyEJq8Fttoiwp9Jc/1hq5X7sYfcN6/5C8Ufmi kwszzsTh+L7ZlXZ4yakuTBl0+nXAE+4gw9/nszfiEsrEMSQWnrMVmCCUkF98Sl9oiWY6 D9CVKCk0YYWfjKOsIL9mRxyJVAFEc9EEjbd3Zx8IujB4FbE8dZAP6pGjxqSWAa8uaLDo Nm3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KdFadkKb; 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 f14si1777324pln.221.2019.03.06.07.14.23; Wed, 06 Mar 2019 07:14:38 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KdFadkKb; 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 S1729939AbfCFMik (ORCPT + 99 others); Wed, 6 Mar 2019 07:38:40 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:58534 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726156AbfCFMik (ORCPT ); Wed, 6 Mar 2019 07:38:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=kfpJRDy1xHfMNuiuhzjAegVPQHwdm/b8Qr2fOAvHYnY=; b=KdFadkKbW3zq3TxtZ6EirhzG4 2QdeIQYbfDSeIhBVFUngQN1eTI3sQwErkck/zPUUMOopg24wctk42NGWZbKlA0x54/0nqohyXfv54 YFBMpkZuM2w8Lka39kgLdsBZLmyRZ0lunXKMya9l2Vs9XghTRIy9pOmKq9kqTSydx6DK6TsRHiCvs n22gIuneWfnzcP0XQ8bzkbmgEb25Pu1JIFuZ7YJrAmJFN/+bjZDshQ6NuWI//yOSg/8vxrrMgCD55 Foc04CqsmfZr0i0PgkloqObM8Csrhfuycj6AnzY4F4C2yrapCiBWhSPVXv0ro+RLCpM2Yrxoyb/1M ja9BjUHTQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1Voj-0001ID-Dp; Wed, 06 Mar 2019 12:38:37 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4410B2029E064; Wed, 6 Mar 2019 13:38:34 +0100 (CET) Date: Wed, 6 Mar 2019 13:38:34 +0100 From: Peter Zijlstra To: Yafang Shao Cc: mingo@redhat.com, LKML , shaoyafang@didiglobal.com Subject: Re: [PATCH] sched: fair: fix missed CONFIG_SCHEDSTATS Message-ID: <20190306123834.GW32494@hirez.programming.kicks-ass.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Wed, Mar 06, 2019 at 07:49:36PM +0800, Yafang Shao wrote: $ grep SCHEDSTAT defconfig-build/.config # CONFIG_SCHEDSTATS is not set $ obbjdump -dr defconfig-build/kernel/sched/fair.o | awk '/>:$/ { F=$2 } /sched_stat/ { print F " " $0 }' : 24cd: R_X86_64_32S __tracepoint_sched_stat_runtime+0x28 : 24d9: R_X86_64_PC32 __tracepoint_sched_stat_runtime+0x24 $ patch -p1 < foo patching file kernel/sched/fair.c $ make O=defconfig-build kernel/sched/ make[1]: Entering directory '/usr/src/linux-2.6/defconfig-build' Using .. as source for kernel GEN Makefile CALL ../scripts/checksyscalls.sh CALL ../scripts/atomic/check-atomics.sh DESCEND objtool CC kernel/sched/fair.o AR kernel/sched/built-in.a make[1]: Leaving directory '/usr/src/linux-2.6/defconfig-build' $ objdump -dr defconfig-build/kernel/sched/fair.o | awk '/>:$/ { F=$2 } /sched_stat/ { print F " " $0 }' $ cat foo diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8213ff6e365d..6e5ceec3b662 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -839,7 +839,8 @@ static void update_curr(struct cfs_rq *cfs_rq) if (entity_is_task(curr)) { struct task_struct *curtask = task_of(curr); - trace_sched_stat_runtime(curtask, delta_exec, curr->vruntime); + if (schedstat_enabled()) + trace_sched_stat_runtime(curtask, delta_exec, curr->vruntime); cgroup_account_cputime(curtask, delta_exec); account_group_exec_runtime(curtask, delta_exec); } _1_ line, where you wanted to add _6_ ugly #ifdefs