From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932141AbbHDHBs (ORCPT ); Tue, 4 Aug 2015 03:01:48 -0400 Received: from blu004-omc1s15.hotmail.com ([65.55.116.26]:58707 "EHLO BLU004-OMC1S15.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932103AbbHDHBr (ORCPT ); Tue, 4 Aug 2015 03:01:47 -0400 X-TMN: [67vR5etnAMbHkE/zxiuhrsRUPtzpdmiy] X-Originating-Email: [yang_oliver@hotmail.com] Message-ID: Subject: Re: [PATCH 1/2] sched: Some sched trace points should depend on SCHEDSTATS To: Steven Rostedt References: <20150803133428.5fd137ec@gandalf.local.home> CC: mingo@redhat.com, linux-kernel@vger.kernel.org, Yong Yang , Peter Zijlstra From: Oliver Yang Date: Tue, 4 Aug 2015 15:05:56 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <20150803133428.5fd137ec@gandalf.local.home> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Aug 2015 07:01:43.0188 (UTC) FILETIME=[6B69D540:01D0CE83] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015/8/4 1:34, Steven Rostedt wrote: > On Mon, 27 Jul 2015 09:11:51 -0400 > yangoliver wrote: > >> When SCHEDSTATS is not enabled, follow trace points shouldn't be >> accessed by default, >> >> sched:sched_stat_wait >> sched:sched_stat_sleep >> sched:sched_stat_iowait >> sched:sched_stat_blocked >> >> These trace points should only be available when SCHEDSTATS is >> enabled. >> >> Signed-off-by: Yong Yang >> --- >> include/trace/events/sched.h | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h >> index d57a575..5b34309 100644 >> --- a/include/trace/events/sched.h >> +++ b/include/trace/events/sched.h >> @@ -334,6 +334,7 @@ DECLARE_EVENT_CLASS(sched_stat_template, >> ); >> >> >> +#ifdef CONFIG_SCHEDSTATS > Why not also surround the sched_stat_template too? That also creates > code even if no event uses it. Steve, Because the sched_stat_template is used by sched_stat_runtime. The sched_stat_runtime is used event without SCHEDSTATS option enabled. And the se.sum_exec_runtime counter is also similar. I don't think this counter is defined for SCHEDSTATS. Yes. I just try to make our trace points design be similar with SCHEDSTATS counters design. > -- Steve > >> /* >> * Tracepoint for accounting wait time (time the task is runnable >> * but not actually running due to scheduler contention). >> @@ -364,6 +365,7 @@ DEFINE_EVENT(sched_stat_template, sched_stat_iowait, >> DEFINE_EVENT(sched_stat_template, sched_stat_blocked, >> TP_PROTO(struct task_struct *tsk, u64 delay), >> TP_ARGS(tsk, delay)); >> +#endif >> >> /* >> * Tracepoint for accounting runtime (time the task is executing