From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19680 invoked by alias); 30 Mar 2017 08:22:38 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 17681 invoked by uid 89); 30 Mar 2017 08:22:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr0-f169.google.com Received: from mail-wr0-f169.google.com (HELO mail-wr0-f169.google.com) (209.85.128.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 30 Mar 2017 08:22:35 +0000 Received: by mail-wr0-f169.google.com with SMTP id w43so49420623wrb.0 for ; Thu, 30 Mar 2017 01:22:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=hzNGkQ3eU2ZR0fct90t/4Q4zQACI2v+o48aukVD0vPI=; b=pqgbb7tk9KdkXwo0S6YkzxsZ/UEGrq8XHxJEokhBG7x+nbm2KlDPimc3820d7IwMi9 ujCBfKA9u4ZI1nCebQwOVz967s+NUgdj8fut4NQnocX3ZB0tJJ7ZnMslZm8jnm8P8VJG uRWt8f6m7gJqs/q7KZaGS6xfORP/68AApKUE45KhxZ2YCnXMcZkBpffrmIoaj14njldU r1QrVveDEJs4g4cb342C1kc/3rx6SD2OBdcjUT+umuWFbZ6tFiNvVxUYvqT7I0MXJPra rmNBJ25IISj8CK1Z7KRndpuS9cJ7f7iZiuDY0IVXWTv2ixst0VgbtFjdQ3M+/EX7MECU YoEA== X-Gm-Message-State: AFeK/H397FNi1VKjafsQdSte1mMFkLqxtfdsnGEnrphcgrXpR7iVnU3jnoSbz2/OcOyJ1uwVDyjO2xMIDsIR8g== X-Received: by 10.223.175.207 with SMTP id y15mr4046925wrd.63.1490862154673; Thu, 30 Mar 2017 01:22:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.184.29 with HTTP; Thu, 30 Mar 2017 01:22:14 -0700 (PDT) In-Reply-To: References: From: Arkady Date: Thu, 30 Mar 2017 08:22:00 -0000 Message-ID: Subject: Re: Is it ok to insert a module multiple times with staprun? To: Shiyao Ma Cc: systemtap@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2017-q1/txt/msg00178.txt.bz2 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 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 , wrote: > > Linux kernel krpobes farmework supports multiple probes for the same > function. > > On Thu, Mar 30, 2017 at 7:41 AM, Shiyao Ma 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.