Date: Tue, 2 Sep 2014 13:24:47 -0700 From: Shrikanth Kamath <shrikanth07@gmail.com> To: freebsd-hackers@freebsd.org, freebsd-dtrace@freebsd.org, markj@freebsd.org Subject: Usage of DTRACE_PROBE macro from sdt.h in kernel modules Message-ID: <CAEOAkMWw07D-XTx8JXvVjU%2BOjUQbKcOZmYoLvzSGA=80B8q-tw@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
Adding a DTRACE_PROBE(name) in a kernel module does not create the SDT
probe. I added
the following to the module file before using DTRACE_PROBE.
#include "opt_kdtrace.h"
#include <sys/sdt.h>
function_foo() {
...
+ DTRACE_PROBE(name);
...
}
I figured the sdt.h does declare SDT_PROVIDER_DECLARE(set); but that
is not helping. Was expecting a sdt probe added under provider 'set'.
The SDT probe creation returns from sdt_kld_load from here
if (linker_file_lookup_set(lf, "sdt_providers_set", &begin, &end, NULL))
return;
I did a nm on the kernel module and did not find anything matching
"sdt_providers_set"
nm -a module.ko | grep sdt
00000000 r __set_sdt_probes_set_sym_sdt_sdt______func____LINE__.103790
U __start_set_sdt_probes_set
U __stop_set_sdt_probes_set
U sdt_probe_func
U sdt_provider_sdt
000006c0 d sdt_sdt______func____LINE__.103789
Can't seem to figure how to get the SDT probe created by using
DTRACE_PROBE macro in a kernel module.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAEOAkMWw07D-XTx8JXvVjU%2BOjUQbKcOZmYoLvzSGA=80B8q-tw>
