lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150424172426.016da583@gandalf.local.home>
Date:	Fri, 24 Apr 2015 17:24:26 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Ron Rechenmacher <ron@...l.gov>
Cc:	<linux-kernel@...r.kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [PATCH] tracing: Export key trace event symbols

On Mon, 20 Apr 2015 16:38:11 -0500
Ron Rechenmacher <ron@...l.gov> 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 <mathieu.desnoyers@...icios.com>
> 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 <ron@...l.gov>
> 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 <linux/module.h>
#include <linux/ftrace.h>
#include <linux/tracepoint.h>

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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ