Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3794796img; Mon, 25 Mar 2019 18:41:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9QBc8RVb35ygU1Yk1MXUYCuEoe6FCxUwl/lFOeQp0m/Fu5lEPNs8IC9mQmAo2GSBVLX/H X-Received: by 2002:a17:902:d70f:: with SMTP id w15mr28688787ply.234.1553564498696; Mon, 25 Mar 2019 18:41:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553564498; cv=none; d=google.com; s=arc-20160816; b=XLSZ/uIHRiZCE32RaefZvt+1m7kF80tVQlO3mUk7KzXcdDgpfsI0CxLCxCt11m9x/h UCzNPPFQvalGi675EljNliH9/7D/pDEy1KuOyiUEclHBkzbVz7GZagN+IP8cjhSQka+t 8WDA2bbuuCQakbs5Xab4tiFimmJOfhyCDgzzgOPtP6Rxfg/EUkPXLTiqP5+c++iUqYdx K3T9558OQRw3hiiS2TvkfxQXXXJEuxOnpPiBE0b2hwLS970/yO5eW6FTY+qfUF2TXq5a GY1UZLpLbL5GhSp4cmGw/RDfUp0SBzCJg/EqVgD2ktlhTIwM3yGLwJ4bW53OOU8eZURC vahQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=y5LzK+NGOQu00/0oiJaxPPBOSYz2xzWCsp+F1301xHI=; b=aoNCWUFwtpWt4tu7kVFeF++z2IXKIg79+odIyd4gKj5CXI/13iw6NHwrP3xFJUqQzL 4UuJluoLU4dqCU2Rle6+wRPcXaUbVKeUZp15dKdT0zUANHtewTViys0nvaTdQ0Vjczo1 /zzS1rGTnPAfVDvVHOvwc/BZNcep/i8lqcZ6kFE7fBM1SOmi94pvF6I/xDmmewRX8e8B 7qwMkICb3XmSqkA4/khQ1mQWxZ1TlXkdZgd5KByZKdlNMvwsLrAl2fzHMpTWvhu0H6e1 7kmyRNnLBQ0tMklPJaZHjfBfN8DmfN/8yoiyOT7yGWNl5YftVyXJsn5QovuEIoWJQTzX 2HWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eZplhQc0; 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 y1si14749957pgf.32.2019.03.25.18.41.23; Mon, 25 Mar 2019 18:41:38 -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=@gmail.com header.s=20161025 header.b=eZplhQc0; 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 S1730871AbfCZBkj (ORCPT + 99 others); Mon, 25 Mar 2019 21:40:39 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:34663 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727506AbfCZBki (ORCPT ); Mon, 25 Mar 2019 21:40:38 -0400 Received: by mail-pf1-f193.google.com with SMTP id b3so5922719pfd.1 for ; Mon, 25 Mar 2019 18:40:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=y5LzK+NGOQu00/0oiJaxPPBOSYz2xzWCsp+F1301xHI=; b=eZplhQc0JgvlvBk1kp2q6sEvEfSzf+9YfqzUT0oE5g8grWbOvfhJ5FEPfp31dFDosh klJC4dDtB7nfIt2PiBRHe0IpHhxdr5OZKU78e4FWnLogOIruPk5MImYq5M1iWQFkz3cd fGiRB4GBo+E7Wpz6qShB+e2TrtcadfTYICZaa3h25ZozTTwLMXx21b8TikGSKvxfZOyS c2tRq4WctfOMw5vo5vzGBSQFJZU+sPzdoWXOdYoDK1frSWZ2p0fcUaesC/wwjpWiO8tE QQsYBiiT8Z+YRS4i1nAHl1A+BZvjVhCv5pnjCBbAJVevWOzxo95htBOd8GCCY+Jsrv1l j06A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=y5LzK+NGOQu00/0oiJaxPPBOSYz2xzWCsp+F1301xHI=; b=BWCCYAife4ZCyUxz6hxhFg2Fyatp18Hsc2cGlkMOMq3VJk2MI4VQAffeTlqpSbgULO 0L+69i18Kjgbp+nHv1ecdyMjyEP5d0FpQ6mx7GUXh83Q6mpPq4/MbAo0hI3tNdMJYYWX kjSUA5jYNXDQLU1f2QPGi07EdeKQfPPXep+RufyMCk0WwfwezTsbyg1nOa3QxqcRD3bA CMkDvJR6E038fEaLH3R7F3EOnHMqgFyQtuZjNh4Kuwkz/NoNHf8dVmcNtZFfUWsTZIOZ i/0KGJP+vU9Zr4pOIXWheFTkn4zhRUaIbcqt8IVP8LAO1fHdr7HGu1V4UURSreW6s6rB Cf4w== X-Gm-Message-State: APjAAAUswl9otnP+vhrzRbkcEB4Fu0SnIrvvAHwafNgAItpi7r9KGJqF SiQeUswhUxwn6mQunStIDCo= X-Received: by 2002:a63:6786:: with SMTP id b128mr17034690pgc.318.1553564437558; Mon, 25 Mar 2019 18:40:37 -0700 (PDT) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id m7sm41464119pgg.62.2019.03.25.18.40.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2019 18:40:36 -0700 (PDT) From: Yafang Shao To: rostedt@goodmis.org, mingo@redhat.com, peterz@infradead.org, paulmck@linux.vnet.ibm.com, josh@joshtriplett.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, joel@joelfernandes.org Cc: shaoyafang@didiglobal.com, linux-kernel@vger.kernel.org, Yafang Shao Subject: [PATCH 2/3] sched/fair: do not expose some tracepoints to user if CONFIG_SCHEDSTATS is not set Date: Tue, 26 Mar 2019 09:40:06 +0800 Message-Id: <1553564407-1162-3-git-send-email-laoar.shao@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1553564407-1162-1-git-send-email-laoar.shao@gmail.com> References: <1553564407-1162-1-git-send-email-laoar.shao@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The tracepoints trace_sched_stat_{iowait, blocked, wait, sleep} should be not exposed to user if CONFIG_SCHEDSTATS is not set. Signed-off-by: Yafang Shao --- include/trace/events/sched.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 9a4bdfa..4686c7f 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -336,6 +336,7 @@ static inline long __trace_sched_switch_state(bool preempt, struct task_struct * __entry->pid, __entry->old_pid) ); +#ifdef CONFIG_SCHEDSTATS /* * XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE * adding sched_stat support to SCHED_FIFO/RR would be welcome. @@ -395,6 +396,19 @@ static inline long __trace_sched_switch_state(bool preempt, struct task_struct * TP_PROTO(struct task_struct *tsk, u64 delay), TP_ARGS(tsk, delay)); +#else /* CONFIG_SCHEDSTATS */ + +TRACE_EVENT_NONE(sched_stat_wait, + TP_PROTO(struct task_struct *tsk, u64 delay)); +TRACE_EVENT_NONE(sched_stat_sleep, + TP_PROTO(struct task_struct *tsk, u64 delay)); +TRACE_EVENT_NONE(sched_stat_iowait, + TP_PROTO(struct task_struct *tsk, u64 delay)); +TRACE_EVENT_NONE(sched_stat_blocked, + TP_PROTO(struct task_struct *tsk, u64 delay)); + +#endif /* CONFIG_SCHEDSTATS */ + /* * Tracepoint for accounting runtime (time the task is executing * on a CPU). -- 1.8.3.1