Re: [for-next][PATCH 15/16] ftrace: Add freeing algorithm to free ftrace_mod_maps

From: Joel Fernandes
Date: Sun Oct 08 2017 - 14:56:23 EST


Hi Steve,

On Sun, Oct 8, 2017 at 11:42 AM, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> On Sun, 8 Oct 2017 01:42:15 -0700
[..]
>> > "Joel Fernandes (Google)" <joel.opensrc@xxxxxxxxx> wrote:
>> [..]
>> > Also could you let me know what is the correct behavior of the filters
>> > after a module being traced is unloaded, are the filters supposed to
>> > be setup again after the module is unloaded, before the module can be
>> > loaded again?
>>
>> Actually I learnt that it doesn't get preserved and wrote a patch to fix that, let me know
>> what you think, thanks. (its only lightly tested - checked that the filters are preserved,
>> will do more testing tomorrow):
>
> They should not be preserved, it's too non-deterministic.

Could you elaborate more on non-deterministic?

Say a user setup filters with '*:mod:<mod-name>' and unloads and
loads, then the filter carrying forward for the second load helps
avoid having them to set it up again.

OTOH I agree its not a big deal to set up the filters again, and
probably not worth save it if it complicates the code too much to
handle all cases.

> I'm wondering why the setting of the ip to zero didn't keep it from
> showing up again. I'll have to investigate that.

Ok. Happy to help test anything you want to try :) I *think* the 'bar'
function that showed up the second time around is actually the address
of the init function in the previous load, and probably the new code
you added switched it on but I have yet to debug it (you'll probably
beat me to it since you wrote this code ;)).

thanks,

- Joel