This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Is it ok to insert a module multiple times with staprun?
- From: Shiyao Ma <i at introo dot me>
- To: David Smith <dsmith at redhat dot com>
- Cc: systemtap at sourceware dot org
- Date: Sat, 1 Apr 2017 14:15:43 +0800
- Subject: Re: Is it ok to insert a module multiple times with staprun?
- Authentication-results: sourceware.org; auth=none
- References: <CAJQX3DyhKKCn6U+T4oBcMs6NHHo1zQwsD2fASjnytiTdGKYz5w@mail.gmail.com> <CANA-60pRqRW3x9DcFtG_fj3wq5qVHhPaPTgcAxNNgnSpFJawwA@mail.gmail.com> <e7f616ba-eb90-47ee-b784-ea02fdf519ff@Spark> <CANA-60oV6W7bqjwpiW+5_3p+Qsm3qRgha-bVqGE+bjZY5iayFA@mail.gmail.com> <CAKFOr-Z=Zk6WOx_B5D3GutfioJMhqcBRCj9wXv5FL6PhoKOXKw@mail.gmail.com> <CAJQX3DyS2inKFwJPDpQc+d4PLj+zP5fFqZDcxARy--F-C+L4tw@mail.gmail.com> <CAKFOr-a+j4an-YhDT4shSwjZnduPsi4fxyJCmX9rNVXBRjVwmg@mail.gmail.com> <CAKFOr-bzF8Tb2Wtf=Q=761JgmLaVaexOZy8jW+V4h-2jkOqw6g@mail.gmail.com>
If the expr in `if expr' could support function invocation, that would
be awesome.
Currently, only
probe kernel.function("vfs_read") if (some_variable) is supported.
probe kernel.function("vfs_read") if (some_func()) is not supported.
Best.
On Fri, Mar 31, 2017 at 11:40 PM, David Smith <dsmith@redhat.com> wrote:
> 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)