Commit 3fcc5530 authored by Alexei Starovoitov's avatar Alexei Starovoitov Committed by Daniel Borkmann

bpf: fix build without bpf_syscall

wrap bpf_stats_enabled sysctl with #ifdef
Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Fixes: 492ecee8 ("bpf: enable program stats")
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarSong Liu <songliubraving@fb.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 3bcd6044
...@@ -224,9 +224,11 @@ static int proc_dostring_coredump(struct ctl_table *table, int write, ...@@ -224,9 +224,11 @@ static int proc_dostring_coredump(struct ctl_table *table, int write,
#endif #endif
static int proc_dopipe_max_size(struct ctl_table *table, int write, static int proc_dopipe_max_size(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos); void __user *buffer, size_t *lenp, loff_t *ppos);
#ifdef CONFIG_BPF_SYSCALL
static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write, static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, void __user *buffer, size_t *lenp,
loff_t *ppos); loff_t *ppos);
#endif
#ifdef CONFIG_MAGIC_SYSRQ #ifdef CONFIG_MAGIC_SYSRQ
/* Note: sysrq code uses its own private copy */ /* Note: sysrq code uses its own private copy */
...@@ -1232,7 +1234,6 @@ static struct ctl_table kern_table[] = { ...@@ -1232,7 +1234,6 @@ static struct ctl_table kern_table[] = {
.extra1 = &one, .extra1 = &one,
.extra2 = &one, .extra2 = &one,
}, },
#endif
{ {
.procname = "bpf_stats_enabled", .procname = "bpf_stats_enabled",
.data = &sysctl_bpf_stats_enabled, .data = &sysctl_bpf_stats_enabled,
...@@ -1242,6 +1243,7 @@ static struct ctl_table kern_table[] = { ...@@ -1242,6 +1243,7 @@ static struct ctl_table kern_table[] = {
.extra1 = &zero, .extra1 = &zero,
.extra2 = &one, .extra2 = &one,
}, },
#endif
#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU) #if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
{ {
.procname = "panic_on_rcu_stall", .procname = "panic_on_rcu_stall",
...@@ -3272,6 +3274,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, ...@@ -3272,6 +3274,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
#endif /* CONFIG_PROC_SYSCTL */ #endif /* CONFIG_PROC_SYSCTL */
#ifdef CONFIG_BPF_SYSCALL
static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write, static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, void __user *buffer, size_t *lenp,
loff_t *ppos) loff_t *ppos)
...@@ -3293,7 +3296,7 @@ static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write, ...@@ -3293,7 +3296,7 @@ static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write,
} }
return ret; return ret;
} }
#endif
/* /*
* No sense putting this after each symbol definition, twice, * No sense putting this after each symbol definition, twice,
* exception granted :-) * exception granted :-)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment