aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2019-02-27 21:30:44 -0500
committerDaniel Borkmann <daniel@iogearbox.net>2019-02-28 18:44:58 -0500
commit3fcc5530bcb2a879e32bd940e6eafee328ac3647 (patch)
tree5bf3686ff3763e7045aebabdf5bc7388c291f5bc /kernel
parent3bcd60444519616508f72df454cc596511e726d1 (diff)
bpf: fix build without bpf_syscall
wrap bpf_stats_enabled sysctl with #ifdef Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Fixes: 492ecee892c2 ("bpf: enable program stats") Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sysctl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 86e0771352f2..7578e21a711b 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -224,9 +224,11 @@ static int proc_dostring_coredump(struct ctl_table *table, int write,
224#endif 224#endif
225static int proc_dopipe_max_size(struct ctl_table *table, int write, 225static int proc_dopipe_max_size(struct ctl_table *table, int write,
226 void __user *buffer, size_t *lenp, loff_t *ppos); 226 void __user *buffer, size_t *lenp, loff_t *ppos);
227#ifdef CONFIG_BPF_SYSCALL
227static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write, 228static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write,
228 void __user *buffer, size_t *lenp, 229 void __user *buffer, size_t *lenp,
229 loff_t *ppos); 230 loff_t *ppos);
231#endif
230 232
231#ifdef CONFIG_MAGIC_SYSRQ 233#ifdef CONFIG_MAGIC_SYSRQ
232/* Note: sysrq code uses its own private copy */ 234/* Note: sysrq code uses its own private copy */
@@ -1232,7 +1234,6 @@ static struct ctl_table kern_table[] = {
1232 .extra1 = &one, 1234 .extra1 = &one,
1233 .extra2 = &one, 1235 .extra2 = &one,
1234 }, 1236 },
1235#endif
1236 { 1237 {
1237 .procname = "bpf_stats_enabled", 1238 .procname = "bpf_stats_enabled",
1238 .data = &sysctl_bpf_stats_enabled, 1239 .data = &sysctl_bpf_stats_enabled,
@@ -1242,6 +1243,7 @@ static struct ctl_table kern_table[] = {
1242 .extra1 = &zero, 1243 .extra1 = &zero,
1243 .extra2 = &one, 1244 .extra2 = &one,
1244 }, 1245 },
1246#endif
1245#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU) 1247#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
1246 { 1248 {
1247 .procname = "panic_on_rcu_stall", 1249 .procname = "panic_on_rcu_stall",
@@ -3272,6 +3274,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
3272 3274
3273#endif /* CONFIG_PROC_SYSCTL */ 3275#endif /* CONFIG_PROC_SYSCTL */
3274 3276
3277#ifdef CONFIG_BPF_SYSCALL
3275static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write, 3278static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write,
3276 void __user *buffer, size_t *lenp, 3279 void __user *buffer, size_t *lenp,
3277 loff_t *ppos) 3280 loff_t *ppos)
@@ -3293,7 +3296,7 @@ static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write,
3293 } 3296 }
3294 return ret; 3297 return ret;
3295} 3298}
3296 3299#endif
3297/* 3300/*
3298 * No sense putting this after each symbol definition, twice, 3301 * No sense putting this after each symbol definition, twice,
3299 * exception granted :-) 3302 * exception granted :-)