summaryrefslogtreecommitdiffstats
path: root/sys/cddl
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2015-09-29 12:02:23 +0000
committeravg <avg@FreeBSD.org>2015-09-29 12:02:23 +0000
commit7ead013d5295f9a70482bbb24f1195981cafcc29 (patch)
tree086a4fda342503a90078c53176e2bad32a254074 /sys/cddl
parent8594b69e8188a592941ef441e945bfd15d534bb9 (diff)
downloadFreeBSD-src-7ead013d5295f9a70482bbb24f1195981cafcc29.zip
FreeBSD-src-7ead013d5295f9a70482bbb24f1195981cafcc29.tar.gz
std: it is important that func name is never an empty string
otherwise DTRACE_ANCHORED() returns false and that makes stack() insert a bogus frame at the top. For example: dtrace -n 'test:dtrace_test::sdttest { stack(); } This change is not really a solution, but just a work-around. The real solution is to record the probe's call site and to use that for resolving a function name. PR: 195222 MFC after: 22 days
Diffstat (limited to 'sys/cddl')
-rw-r--r--sys/cddl/dev/sdt/sdt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/cddl/dev/sdt/sdt.c b/sys/cddl/dev/sdt/sdt.c
index a11febe..67504bf 100644
--- a/sys/cddl/dev/sdt/sdt.c
+++ b/sys/cddl/dev/sdt/sdt.c
@@ -168,6 +168,8 @@ sdt_create_probe(struct sdt_probe *probe)
* in the C compiler, so we have to respect const vs non-const.
*/
strlcpy(func, probe->func, sizeof(func));
+ if (func[0] == '\0')
+ strcpy(func, "none");
from = probe->name;
to = name;
OpenPOWER on IntegriCloud