From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90178 invoked by alias); 30 Oct 2019 22:34:08 -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 89916 invoked by uid 89); 30 Oct 2019 22:34:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 spammy=HX-Languages-Length:991, Setting X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-2.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (205.139.110.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Oct 2019 22:34:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572474845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1yOW4WZj7QfQm9gOvbgYoyLpYvw7Y/CmxH+JDdbildw=; b=D8pcExjcP/aqYyKRpfRiOYyca5hHS6ELWy8kKsCV2/VwNdj4qjQomzgbZoxQRbWkQIvLdx 66x5NcSd/MjCKhNHSujO/uz3bNdrTTBqVVjIWNO4XLIdaJwKigw73JAAVK9PfHaYUk6Ap2 j51grUljAAse8CHY94cyhDRTn5ReANo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-102-WxSO9amJOlet4gb8-myfBg-1; Wed, 30 Oct 2019 18:34:02 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2A2311800D7B; Wed, 30 Oct 2019 22:34:01 +0000 (UTC) Received: from redhat.com (ovpn-116-53.phx2.redhat.com [10.3.116.53]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 030CF60BE0; Wed, 30 Oct 2019 22:34:01 +0000 (UTC) Received: from [127.0.0.1] (helo=vm-rhel7) by redhat.com with esmtp (Exim 4.92) (envelope-from ) id 1iPwXP-0004e1-Fh; Wed, 30 Oct 2019 18:33:59 -0400 From: fche@redhat.com (Frank Ch. Eigler) To: Craig Ringer Cc: systemtap@sourceware.org Subject: Re: Setting values in library tapsets from user tapscript? References: Date: Wed, 30 Oct 2019 22:34:00 -0000 In-Reply-To: (Craig Ringer's message of "Mon, 28 Oct 2019 15:41:27 +0800") Message-ID: <87y2x1eucp.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2019-q4/txt/msg00020.txt.bz2 craig wrote: > Related to my earlier post, is there any way to supply macro values to > referenced tapsets? [...] Yeah, indirectly. You correctly surmise that you're stuck with macros and/or command line parameters to do this kind of thing, because for the purpose you need them, they need to be compile-time literals (instead of variables). So, this works: - create a new foo.stpm file in a new directory /zoo - add into it: @define foo %( @1 %) or @define foo %( "/some/literal" %) - create your probe.stp file that uses this macro: - add into it: probe process(@foo "/bar").function("*"){} - note the @foo reference - run stap thusly: % stap -I/zoo probe.stp "/path/prefix" # in the @1 case or % stap -I/zoo probe.stp # in the hardcoded case and bob is your uncle. This works because "*.stpm" files located in -any- tapset directory are parsed early and macro definitions inside them is accessible to other files. - FChE