Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2596176rwi; Fri, 21 Oct 2022 05:54:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM66FqBF0U9TGoQVm9OoDKt/391vXZ0NMdGh8GdIrLlRCPiSiHbrNJ3hFXu2rBBIEokmnG0P X-Received: by 2002:a17:907:728c:b0:78e:2856:7fed with SMTP id dt12-20020a170907728c00b0078e28567fedmr15434975ejc.2.1666356851562; Fri, 21 Oct 2022 05:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666356851; cv=none; d=google.com; s=arc-20160816; b=nkpuLMykLwDJVqWy/SF44QDdbt83oidMNUfB+ERVopjl+vmWAtkEmlGqa/uwYZrodG /nINQqcbLI8boJATX4GGkVAW8OcMxsoTzduJZNLrTwd6qTUeru1qjXWZ2bnukBzSZsRV UXudnAjrQ5eefMpqlOesCvKFkxypssVE2NbN29HbNi1a+4VXcKrxf0xIzAZlJ0ZFFI7Z jTct2blUaY0IXBHIlk6f7zP0olNQ5aRrMIhytited9wHP5JYaYyDuhhAnyXSNz78RONf zyU5XcdCBL3PhecYVsdcKsf1pkoP7ZcdHib03QQMe++NHQ1lPd3PgXOYYGPMD6dZneM8 72sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=/ayNUy3sTsy9pimU1io6LYZZzHtgtV1Ym3v4+6UTgWM=; b=PiRzG+JX3+yjxPHrYetUMThCsfJVn6rCF7MlCBsCnumimjyA2O+aNG4BRw+/hD9QZR I93CKYtom04+vRiQhcvFEceVmCIh2sSW2vZah/YLRti+u0/9BBkpxB1LOT7+xTkNH4pS yoS6sBrudI8UeOfMYEojwT2sKFu2QmDC2JqZ47YTIlwDmiRn4sZyS3Caf3Eq0SL1vUUX p6NVYc4F5hSCDfOvsnYTEFN/XHZBW+pXXQ7H1eNFN4VwGZx5ZF8KCijmjc2QJmqP8q2F CCjb6nFWEiRqt0oovUUYZh0gPKAaEp0bpVnEY42Dkiw7Jv3UiWWMLgEbGsXr47t6wUya CFhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b9-20020a056402084900b0045d3e06e4d5si21858156edz.389.2022.10.21.05.53.45; Fri, 21 Oct 2022 05:54:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229664AbiJUMc7 (ORCPT + 99 others); Fri, 21 Oct 2022 08:32:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbiJUMc6 (ORCPT ); Fri, 21 Oct 2022 08:32:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DB522608FE; Fri, 21 Oct 2022 05:32:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 386EF61E88; Fri, 21 Oct 2022 12:32:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E228C433D6; Fri, 21 Oct 2022 12:32:55 +0000 (UTC) Date: Fri, 21 Oct 2022 08:32:54 -0400 From: Steven Rostedt To: richard clark Cc: bristot@kernel.org, linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Question about 'for_each_kernel_tracepoint(...)' function Message-ID: <20221021083254.3c879824@rorschach.local.home> In-Reply-To: References: <20221020111439.76e72230@gandalf.local.home> <20221020221255.5b3dffe1@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 21 Oct 2022 11:51:20 +0800 richard clark wrote: > On Fri, Oct 21, 2022 at 10:12 AM Steven Rostedt wrote: > > > > On Fri, 21 Oct 2022 09:43:14 +0800 > > richard clark wrote: > > > > > > > Ah, as you can see that I did it, but the result is not what I > > > expected :-). Help? > > > > Looking at the code, I see it does indeed only look at builtin tracepoints. > > What the logic behind is not to implement a function like > 'for_each_tracepoints' instead of 'for_each_kernel_tracepoint' to find > all the TPs defined by both builtin kernel and external kernel > modules, just like we can find all the kernel symbols and exported > symbols from external module? Why? It's not needed upstream. If you push your code upstream and it's something to get accepted, then we can think about adding that. > > > > > But if you want one module to have access to the tracepoints of another, > > then you can have the first one export it. > > > > EXPORT_SYMBOL_TRACEPOINT_GPL(function_event_a); > > > > And then module b should have access to it. > > > Yes, but module b needs to register a new probe call back function for > the new TPs defined by module a in my case, so first it needs to find > the TPs defined by module a. Any comments? No, because I have no idea what you are doing or why you need this. -- Steve