From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by sourceware.org (Postfix) with ESMTPS id 202A33858D33 for ; Wed, 13 Jan 2021 04:38:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 202A33858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=2ndquadrant.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=craig.ringer@2ndquadrant.com Received: by mail-lf1-x12c.google.com with SMTP id o10so786711lfl.13 for ; Tue, 12 Jan 2021 20:38:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=30m+lNCrFJEAypIBu/q/26XT0dsr0ypuZXJywaTJVY0=; b=Kz6L4bvVCXpkeYRoVqwSAgC/2a/j/INmHR6cF4C/U6F/QBcNj/hce0gOsLWw23W2UU B/c75AqOZ0s3fnorcc2/clSnj8mGPq0HgloX4XzeVXQ9egFCpdd6kmE5uCEDhzlisotg odt22G9YyvsVy0cbeE3d7Fv5rz2dPKY3Y0+8H3M/qtddqxvJRKdFvBdVCRVD7ott9u4T d1iLQxlAyl6XUP7nNvemVFqofBQUQ0TaH9Xwfd9NzyJVyK83rYrFxGQ1eMQXP/peVqOa SjX9xD7u/sgbnjr6Ti69jKrxqxw5bcGRhINIjbIdCM4T3g2t+RevfhFKGAT9qWyzflq9 N2QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=30m+lNCrFJEAypIBu/q/26XT0dsr0ypuZXJywaTJVY0=; b=oGz7IqzypgZagXa9PiwV1xRCbN2gMSbmCt3SAdlIGVgBrU9F1rTJ/2hJ6ZKO7DVTp3 027CUclPWaHXMXM40AVWB2J82wPvVDSisAO0zwa2sOOLH43ArjoZuCTQaaqph7vFyTUz diVdqAkoEEqKOWPbEO/7k5FatyN5kSoGI4W2RMqZy92ki1DleO9OkNmMHUlREo/oUsuv sD396U2k8O65sf7NFUeDLLD13uUmyzLaKd4Waocc6fuMz36HmA4rbsU3WHf8Yftcoo8B eoH4EANDnNlfUu9nPa3F75Lo1ZJv+dO6JT/8cjPrJylaX54b7uWQkKRbN6HrKKnQ/cXC DMJA== X-Gm-Message-State: AOAM53364RXprzS2fRNsCxnoonRKtoUVi8bGEb6V/hOziLwqVpcB2hdv /S+0whYCmkra/ypmeLJbTR17vwGbE4vWW9gxD5h+VA== X-Google-Smtp-Source: ABdhPJyvzRftc071wuOQpKflmlmSeh9vpEd51TixBaMmdQCcx28SxYqtfjiljrwJoSTTzT66/P9DuN04oqii62KWTlc= X-Received: by 2002:a05:6512:3305:: with SMTP id k5mr34960lfe.35.1610512678720; Tue, 12 Jan 2021 20:37:58 -0800 (PST) MIME-Version: 1.0 References: <87mtxgr9mu.fsf@redhat.com> In-Reply-To: <87mtxgr9mu.fsf@redhat.com> From: Craig Ringer Date: Wed, 13 Jan 2021 12:37:47 +0800 Message-ID: Subject: Re: It's confused that local variable's value not change in function.return probe. To: "Frank Ch. Eigler" Cc: David McRay , systemtap@sourceware.org X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2021 04:38:02 -0000 On Mon, 11 Jan 2021 at 01:21, Frank Ch. Eigler via Systemtap < systemtap@sourceware.org> wrote: > > David McRay wrote: > > > It's confused that local variable's value not change in function.return > > probe. [...] > >>>>> running stap <<<< > > gcc tests/TestStap.c -O0 -o build/TestStapC -ggdb -gdwarf > > > > # stap tracker.stp -c ./build/TestStapC > > WARNING: confusing usage, consider @entry($a->$) in .return probe: > > identifier '$a$' at scripts/track_cplusplus/track_c.stp:11:28 > > source: printf("return a: %s\n", $a$) > > The warning message is on topic. If in a .return probe, you access a > general $context variable, this refers to a saved snapshot of the > variable as evaluated at function-entry time. See also [man stapprobes] > I never found that especially confusing, but I can see how the message might be improved. - WARNING: confusing usage, consider @entry($a->$) + WARNING: value of $a is captured at function entry and will not reflect any changes made since; consider explicitly using @entry($a->$) or something like that? Or a subhead hint in "man stapprobes" like "See also [man stapprobes] heading MORE ON RETURN PROBES". -- Craig Ringer http://www.2ndQuadrant.com/ 2ndQuadrant - PostgreSQL Solutions for the Enterprise