Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967126AbbDXVYa (ORCPT ); Fri, 24 Apr 2015 17:24:30 -0400 Received: from smtprelay0192.hostedemail.com ([216.40.44.192]:40692 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932462AbbDXVY3 (ORCPT ); Fri, 24 Apr 2015 17:24:29 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::,RULES_HIT:41:334:355:368:369:379:541:599:800:960:967:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2525:2553:2560:2563:2682:2685:2693:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:5007:6261:7875:7903:9025:9040:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12438:12517:12519:12555:12698:12737:12740:13071:13972:14093:14097:21060:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: cake14_612cf1b456651 X-Filterd-Recvd-Size: 2970 Date: Fri, 24 Apr 2015 17:24:26 -0400 From: Steven Rostedt To: Ron Rechenmacher Cc: , Mathieu Desnoyers Subject: Re: [PATCH] tracing: Export key trace event symbols Message-ID: <20150424172426.016da583@gandalf.local.home> In-Reply-To: <553571C3.1060505@fnal.gov> References: <553571C3.1060505@fnal.gov> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2352 Lines: 69 On Mon, 20 Apr 2015 16:38:11 -0500 Ron Rechenmacher wrote: > If symbols are not exported, modules can no longer register additional > (module specified) tracepoints like they use to be able to (i.e linux-3.15.x). > Somewhere on or about commit de7b2973903c6cc50b31ee5682a69b2219b9919d > (Author: Mathieu Desnoyers > Date: Tue Apr 8 17:26:21 2014 -0400 > tracepoint: Use struct pointer instead of name hash for reg/unreg tracepoints) > modules which attempted to register additional tracing functions would > get "Unknown symbol" errors. For example: "... Unknown symbol > __tracepoint_sched_switch (err 0)" > Symbols can be exported using the kernel's EXPORT_TRACEPOINT_SYMBOL_GPL macro > to allow modules to once again register their own tracing functions (for at > least some key points in the kernel as provided by this patch). > > Signed-off-by: Ron Rechenmacher > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=96051 Hi Ron, I was talking with Mathieu on IRC and asked him how LTTng gets its kernel tracepoints, and he told me he uses for_each_kernel_tracepoint(). That will iterate over all tracepoints that have been added in the kernel (and is exported GPL). You can still use that to get the handle onto any tracepoint you need. It's pretty straight forward (I just wrote a simple module to test it out), and just compare against the tp->name, to find what you want. I still would like to get more usage out of the internal code, but this is your work around you wanted. No need to export new symbols. Just a little more setup time on module load. -- Steve Here's my mod.... #include #include #include static func(struct tracepoint *tp, void *ignore) { printk("tracepoint: %s\n", tp->name); } static int __init my_tp_init(void) { for_each_kernel_tracepoint(func, NULL); return 0; } static void __exit my_tp_exit(void) { } module_init(my_tp_init); module_exit(my_tp_exit); MODULE_AUTHOR("My name here"); MODULE_DESCRIPTION("Me!"); MODULE_LICENSE("GPL"); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/