I've tried this with and without dynamic ftrace and can not reproduce.
I found the cause of this. It was:
c2931e05ec5965597cbfb79ad332d4a29aeceb23
ftrace: return an error when setting a nonexistent tracer
Because the write of sched_switch has more charachters than the max
(because of the whitespace at the end), then we chop what we read from
userspace. Since we do not cosume all what was written, the 'echo' writes
the rest again. But this time it's just the whitespace. This fails to
match, even though we did match before. And we return -EINVAL. But the
funny part is that you can cat the file again, you will see that it
succeeded!
I'll write a patch to fix this.
-- Steve
--