Is it ok to insert a module multiple times with staprun?

David Smith dsmith@redhat.com
Fri Mar 31 15:40:00 GMT 2017


On Fri, Mar 31, 2017 at 9:50 AM, David Smith <dsmith@redhat.com> wrote:
> On Thu, Mar 30, 2017 at 10:51 PM, Shiyao Ma <i@introo.me> wrote:

OK, I had another sneaky thought here. You could use the system()
function to copy the config file to the /proc file. I haven't had time
to test this, but in theory something like this should work:

====
global config_done

probe procfs.write("config")
{
    # process $value here
   config_done = 1
}

probe kernel.function("vfs_read") if (config_done)
{
   # real processing here...
}

probe begin
{
   system(sprintf("cat config > /proc/systemtap/%s/config", module_name()))
}
====

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)



More information about the Systemtap mailing list