From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28116 invoked by alias); 20 Jul 2016 15:25:15 -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 28101 invoked by uid 89); 20 Jul 2016 15:25:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1016, H*f:sk:2000cfc, H*MI:sk:2000cfc, H*i:sk:2000cfc X-HELO: mx6-phx2.redhat.com Received: from mx6-phx2.redhat.com (HELO mx6-phx2.redhat.com) (209.132.183.39) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 20 Jul 2016 15:25:13 +0000 Received: from zmail26.collab.prod.int.phx2.redhat.com (zmail26.collab.prod.int.phx2.redhat.com [10.5.83.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6KFPCfR043001; Wed, 20 Jul 2016 11:25:12 -0400 Date: Wed, 20 Jul 2016 15:25:00 -0000 From: Felix Lu To: David Smith Cc: systemtap@sourceware.org Message-ID: <1664305233.23200444.1469028311973.JavaMail.zimbra@redhat.com> In-Reply-To: <2000cfc0-9b01-e61d-23a8-bcded4c78be4@redhat.com> References: <540973478.22718523.1468962366224.JavaMail.zimbra@redhat.com> <70bd0aff-e6bb-3131-e270-598363dfb188@redhat.com> <28211526.23172955.1469026042792.JavaMail.zimbra@redhat.com> <2000cfc0-9b01-e61d-23a8-bcded4c78be4@redhat.com> Subject: Re: Writing tapset functions for multiple versions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-q3/txt/msg00072.txt.bz2 > > A global integer instead of the string comparison could be set if you > > are worried about the overhead. In the example above, tid() could be > > saved in the probe alias body as a private global which would be sufficient > > for identifying the desired function. > > I'm not quite sure how saving tid() in a private global would work if > you are probing more than one thread at a time. Or did I misunderstand > your idea and your global is an array? If the private global is an > array, now we've got 2 private global arrays (1 for version1.stp and 1 > for version2.stp). A global scalar should suffice in this case. All we want is for the function f in version1.stp to be called when version1/process is executed and likewise for version2. The probe alias body in the above example would update the saved tid() every time it's hit. > > -- > David Smith > dsmith@redhat.com > Red Hat > http://www.redhat.com > 256.217.0141 (direct) > 256.837.0057 (fax) >