From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MASiOCc6ZmTmoQ0AWB0awg (envelope-from ) for ; Thu, 18 May 2023 10:45:59 -0400 Received: by simark.ca (Postfix, from userid 112) id E5E741E11E; Thu, 18 May 2023 10:45:59 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=lists.lttng.org header.i=@lists.lttng.org header.a=rsa-sha256 header.s=default header.b=p02rBU7u; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.lttng.org (lists.lttng.org [167.114.26.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 78DAA1E111 for ; Thu, 18 May 2023 10:45:58 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.lttng.org; s=default; t=1684421158; bh=zVLiUoxVAx3ClXhWNwm48B6Zj+kui1GMEcTxbp7ZKkA=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=p02rBU7uhkyQwzRWrwt29NYzGJCo3fxnE6Ql069YlcacI0x3lhCibfuasRGHB02Xg h5nxzGmrWPxznogCgL15fzDhmlQ4INHUrR60/FqArnE/aXlKoTTtdyzBsXUPAQD/EK I0pJA2KPghMHlrx/ta9yqPOw4LHbu+nNiJwzw5GYO0dh9PqyJwjk4RJCrF3AWYkaYj dRKVPIFR3RyEtdhFnXygJ78Mk+Y5gkZtHkjHgctdLJ2jZg+9jiRiEBqXe0hTIBTcgk PzLaUQWU/MK1dmLrOYURDo99AKLNNGjQ3vEUgzD8VzIN9x7aTXcMSWxpLmgZrpDMQx MXp7cVX5WIrGw== Received: from lists-lttng01.efficios.com (localhost [IPv6:::1]) by lists.lttng.org (Postfix) with ESMTP id 4QMXpZ0Y5Fz1GBv; Thu, 18 May 2023 10:45:57 -0400 (EDT) Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lists.lttng.org (Postfix) with ESMTPS id 4QMXpW3nw2z1GBt for ; Thu, 18 May 2023 10:45:55 -0400 (EDT) Received: from [172.16.0.117] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4QMXpV6fSBz13Cw; Thu, 18 May 2023 10:45:54 -0400 (EDT) Message-ID: <2f8ea79e-9515-854b-d3b0-707baba60b92@efficios.com> Date: Thu, 18 May 2023 10:46:01 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Content-Language: en-US To: Brian Hutchinson Cc: lttng-dev@lists.lttng.org References: <2d953bd2-6544-3357-1424-fa44731e2bf5@efficios.com> In-Reply-To: Subject: Re: [lttng-dev] Trying to understand use of lttng enable-event --kernel --userspace-probe= X-BeenThere: lttng-dev@lists.lttng.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: LTTng development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mathieu Desnoyers via lttng-dev Reply-To: Mathieu Desnoyers Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" On 2023-05-18 10:10, Brian Hutchinson wrote: [...] > I updated my hello world to have a function I'd like to use the > --userspace-probe method on with the very original name of > 'probe_function': > > #include > #include > > void probe_function(int i); > > int main(int argc, char *argv[]) > { > unsigned int i; > puts("Hello, World!\nPress Enter to continue..."); > /* > * The following getchar() call only exists for the purpose of this > * demonstration, to pause the application in order for you to have > * time to list its tracepoints. You don't need it otherwise. > */ > getchar(); > > lttng_ust_tracef("Number %d, string %s", 23, "hi there!"); > printf("Number %d, string %s", 23, "hi there!"); > > for (i = 0; i < argc; i++) { > lttng_ust_tracef("Number %d, argv %s", i, argv[i]); > printf("Number %d, argv %s", i, argv[i]); > } > > puts("Quitting now!"); > > probe_function(i); > > return 0; > } > > void probe_function(int i) { > > lttng_ust_tracef("Number %d, string %s", i * i, "i^2"); > printf("Number %d, string %s", i * i, "i^2"); > > } > > ... and I get the same error as before when I try to enable the probe: > # lttng enable-event --kernel > --userspace-probe=/usr/local/bin/hello:probe_function > Error: Missing event name(s). As the error states, you are missing the event name. See man 1 lttng-enable-event lttng [GENERAL OPTIONS] enable-event --kernel [--probe=SOURCE | --function=SOURCE | --syscall | --userspace-probe=SOURCE] [--filter=EXPR] [--session=SESSION] [--channel=CHANNEL] EVENT[,EVENT]... You will want something like: lttng enable-event --kernel --userspace-probe=/usr/local/bin/hello:probe_function my_probe_function Where "my_probe_function" is the event name that will appear in the collected traces. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev