On Mon, Apr 25, 2016 at 08:41:39PM -0300, Arnaldo Carvalho de Melo wrote: > > +int sysctl_perf_event_max_stack __read_mostly = PERF_MAX_STACK_DEPTH; > + > +static inline size_t perf_callchain_entry__sizeof(void) > +{ > + return (sizeof(struct perf_callchain_entry) + > + sizeof(__u64) * sysctl_perf_event_max_stack); > +} > @@ -1144,6 +1144,14 @@ static struct ctl_table kern_table[] = { > .extra1 = &zero, > .extra2 = &one_hundred, > }, > + { > + .procname = "perf_event_max_stack", > + .data = NULL, /* filled in by handler */ > + .maxlen = sizeof(sysctl_perf_event_max_stack), > + .mode = 0644, > + .proc_handler = perf_event_max_stack_handler, > + .extra1 = &zero, > + },
you need to define a max value otherwise perf_callchain_entry__sizeof will overflow. Sure it's root only facility, but still not nice. 1M? Anything above 1M stack frames would be insane anyway. The rest looks good. Thanks!