public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Arkady <arkady.miasnikov@gmail.com>
To: Shiyao Ma <i@introo.me>
Cc: systemtap@sourceware.org
Subject: Re: Is it ok to insert a module multiple times with staprun?
Date: Thu, 30 Mar 2017 08:22:00 -0000	[thread overview]
Message-ID: <CANA-60oV6W7bqjwpiW+5_3p+Qsm3qRgha-bVqGE+bjZY5iayFA@mail.gmail.com> (raw)
In-Reply-To: <e7f616ba-eb90-47ee-b784-ea02fdf519ff@Spark>

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.

  parent reply	other threads:[~2017-03-30  8:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30  4:41 Shiyao Ma
2017-03-30  5:40 ` Arkady
     [not found]   ` <e7f616ba-eb90-47ee-b784-ea02fdf519ff@Spark>
2017-03-30  8:22     ` Arkady [this message]
2017-03-30 14:53       ` David Smith
2017-03-31  3:51         ` Shiyao Ma
2017-03-31  4:08           ` Arkady
2017-03-31 14:50           ` David Smith
2017-03-31 15:40             ` David Smith
2017-03-31 15:46               ` Shiyao Ma
2017-04-01  6:15               ` Shiyao Ma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANA-60oV6W7bqjwpiW+5_3p+Qsm3qRgha-bVqGE+bjZY5iayFA@mail.gmail.com \
    --to=arkady.miasnikov@gmail.com \
    --cc=i@introo.me \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).