Skip to contentSkip to conversation

perf_counter: do not create perf counter mlock sysctl when CONFIG_PERF_COUNTERS=n

PATCH In review Ian Campbell 3 participants 3 messages May 22, 2009 – May 24, 2009 Proc sysctl

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf_counter: do not create perf counter mlock sysctl when CONFIG_PERF_COUNTERS=n

Building tip from 82811bee3 without CONFIG_PERF_COUNTERS results in:

CC kernel/sysctl.o
kernel/sysctl.c:928: error: 'sysctl_perf_counter_mlock' undeclared here (not in a function)

This is due to c5078f78b "perf_counter: provide an mlock threshold"

kernel/sysctl.c +2 -0
index 44ebd90..c2a4467 100644
@@ -922,6 +922,7 @@ static struct ctl_table kern_table[] = {
 		.child		= slow_work_sysctls,
 	},
 #endif
+#ifdef CONFIG_PERF_COUNTERS
 	{
 		.ctl_name	= CTL_UNNUMBERED,
 		.procname	= "perf_counter_mlock_kb",
@@ -930,6 +931,7 @@ static struct ctl_table kern_table[] = {
 		.mode		= 0644,
 		.proc_handler	= &proc_dointvec,
 	},
+#endif
 /*
  * NOTE: do not add new entries to this table unless you have read
  * Documentation/sysctl/ctl_unnumbered.txt
#1 lore raw
Quoted 21 lines · Ian Campbell

Building tip from 82811bee3 without CONFIG_PERF_COUNTERS results in:

CC kernel/sysctl.o
kernel/sysctl.c:928: error: 'sysctl_perf_counter_mlock' undeclared here (not in a function)

This is due to c5078f78b "perf_counter: provide an mlock threshold"

kernel/sysctl.c +1 -0
index 44ebd90..c2a4467 100644
@@ -922,6 +922,7 @@ static struct ctl_table kern_table[] = {
 		.child		= slow_work_sysctls,
 	},
 #endif
+#ifdef CONFIG_PERF_COUNTERS
 	{
 		.ctl_name	= CTL_UNNUMBERED,
 		.procname	= "perf_counter_mlock_kb",

kernel/sysctl.c static struct ctl_table kern_table[] = { · line 937

Quoted 7 lines
kernel/sysctl.c +1 -0
@@ -930,6 +931,7 @@ static struct ctl_table kern_table[] = {
 		.mode		= 0644,
 		.proc_handler	= &proc_dointvec,
 	},
+#endif
 /*
  * NOTE: do not add new entries to this table unless you have read
  * Documentation/sysctl/ctl_unnumbered.txt

Hm, is this still needed? It doesnt apply here and i'm not seeing build failures.

Thanks,

Ingo

#2 lore raw
Quoted 9 lines · Ingo Molnar
Quoted 4 lines · Ian Campbell

Building tip from 82811bee3 without CONFIG_PERF_COUNTERS results in:

CC kernel/sysctl.o
kernel/sysctl.c:928: error: 'sysctl_perf_counter_mlock' undeclared here (not in a function)

Hm, is this still needed? It doesnt apply here and i'm not seeing build failures.

Looks like I was using an obsolete branch, on current tip (790dc57b) it was already fixed by the commit which added the first perf counter sysctl in 1ccd1549.

Ian.