This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


You can try to use /proc support in the STAP - there is a "probe"
which adds a file to the procfs

For example, procfs("PATH").write { printf("User wrote: %s", $value) }

Alternatively you can use debugfs like I do in
https://github.com/larytet/YALAS/blob/master/src/driver/sysfs.c

On Thu, Mar 30, 2017 at 11:11 AM, Shiyao Ma <i@introo.me> wrote:
> Hi,
>
> Indeed I should insert the kernel module only once.  And do some
> if-conditions based on the supplied parameters.
>
> The limitation on my side is, the params are rather long, exceeding the
> shell limitation.
>
> I'd like the module to  read  a file (that contains the arguments).
>
> Does systemstap script has such a support?
>
>
> Regards.
>
> On Mar 30, 2017, 13:40 +0800, Arkady <arkady.miasnikov@gmail.com>, wrote:
>
> Linux kernel krpobes farmework supports multiple probes for the same
> function.
>
> On Thu, Mar 30, 2017 at 7:41 AM, Shiyao Ma <i@introo.me> wrote:
>
> Hi,
> In the staprun manpage, I saw this:
>
>
> -R Rename the module to a unique name before inserting it.
>
> So looks like it's safe to insert it multiple times as long as the -R
> gives a different name.
>
>
> My application scenario is to log information on different tcp
> connections, and separately output them to different files.
> The invocation is like this:
> # first insertion
> sudo staprun /path/to/module -o /path/to/tcp-2003 filterport=2003 -R
> tcp-2003
> # second insertion
> sudo staprun /path/to/module -o /path/to/tcp-2004 filterport=2004 -R
> tcp-2004
>
> Does the above approach look natural?
>
> Regards.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]