Re: [RFC/PATCH] ftrace: Allow to change size of function graph filters

From: Steven Rostedt
Date: Sat Jan 14 2017 - 00:00:13 EST


On Sat, 14 Jan 2017 13:20:00 +0900
Namhyung Kim <namhyung@xxxxxxxxxx> wrote:


> But I'm not sure how to synchronize hash table manipulations. It
> seems synchronize_sched() is not good enough for function graph
> tracer, right? So I limited changing filter size only when no tracer
> is used, but is it ok to have the limitation when adding or removing
> an entry to/from the table? If not, what can I do?

There's already a hash that function tracing uses. Look at the code in
ftrace_hash_move(). If you make it where the hash is always looked at
with preemption disabled, you can use synchronize_sched() to modify the
hash.

The trampolines are a bit trickier, because there's no way to disable
preemption or do any other synchronization when they are called.

-- Steve