Date: Tue, 29 Sep 2015 12:02:23 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288363 - head/sys/cddl/dev/sdt Message-ID: <201509291202.t8TC2NpG056326@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Tue Sep 29 12:02:23 2015 New Revision: 288363 URL: https://svnweb.freebsd.org/changeset/base/288363 Log: 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 Modified: head/sys/cddl/dev/sdt/sdt.c Modified: head/sys/cddl/dev/sdt/sdt.c ============================================================================== --- head/sys/cddl/dev/sdt/sdt.c Tue Sep 29 11:58:21 2015 (r288362) +++ head/sys/cddl/dev/sdt/sdt.c Tue Sep 29 12:02:23 2015 (r288363) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509291202.t8TC2NpG056326>