Skip to content

Commit 3fcc553

Browse files
Alexei Starovoitovborkmann
authored andcommitted
bpf: fix build without bpf_syscall
wrap bpf_stats_enabled sysctl with #ifdef Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Fixes: 492ecee ("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>
1 parent 3bcd604 commit 3fcc553

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎kernel/sysctl.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,11 @@ static int proc_dostring_coredump(struct ctl_table *table, int write,
224224
#endif
225225
static int proc_dopipe_max_size(struct ctl_table *table, int write,
226226
void __user *buffer, size_t *lenp, loff_t *ppos);
227+
#ifdef CONFIG_BPF_SYSCALL
227228
static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write,
228229
void __user *buffer, size_t *lenp,
229230
loff_t *ppos);
231+
#endif
230232

231233
#ifdef CONFIG_MAGIC_SYSRQ
232234
/* Note: sysrq code uses its own private copy */
@@ -1232,7 +1234,6 @@ static struct ctl_table kern_table[] = {
12321234
.extra1 = &one,
12331235
.extra2 = &one,
12341236
},
1235-
#endif
12361237
{
12371238
.procname = "bpf_stats_enabled",
12381239
.data = &sysctl_bpf_stats_enabled,
@@ -1242,6 +1243,7 @@ static struct ctl_table kern_table[] = {
12421243
.extra1 = &zero,
12431244
.extra2 = &one,
12441245
},
1246+
#endif
12451247
#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
12461248
{
12471249
.procname = "panic_on_rcu_stall",
@@ -3272,6 +3274,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
32723274

32733275
#endif /* CONFIG_PROC_SYSCTL */
32743276

3277+
#ifdef CONFIG_BPF_SYSCALL
32753278
static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write,
32763279
void __user *buffer, size_t *lenp,
32773280
loff_t *ppos)
@@ -3293,7 +3296,7 @@ static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write,
32933296
}
32943297
return ret;
32953298
}
3296-
3299+
#endif
32973300
/*
32983301
* No sense putting this after each symbol definition, twice,
32993302
* exception granted :-)

0 commit comments

Comments
 (0)