Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Feb 2018 23:59:47 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r329995 - head/cddl/lib/libdtrace
Message-ID:  <201802252359.w1PNxlvT022663@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Sun Feb 25 23:59:47 2018
New Revision: 329995
URL: https://svnweb.freebsd.org/changeset/base/329995

Log:
  Updates and enhancements to signal.d to aid DTrace scripting
  
  + Add missing signals SIGTHR (32) and SIGLIBRT (33)
  + Add inline for converting SIG* int to string
  + Add inline for converting CLD_* int to string
  
  Reviewed by:	markj
  Sponsored by:	Smule, Inc.
  Differential Revision:	https://reviews.freebsd.org/D14497

Modified:
  head/cddl/lib/libdtrace/signal.d

Modified: head/cddl/lib/libdtrace/signal.d
==============================================================================
--- head/cddl/lib/libdtrace/signal.d	Sun Feb 25 23:10:13 2018	(r329994)
+++ head/cddl/lib/libdtrace/signal.d	Sun Feb 25 23:59:47 2018	(r329995)
@@ -20,6 +20,7 @@
  * CDDL HEADER END
  *
  * Portions Copyright 2008 John Birrell jb@freebsd.org
+ * Portions Copyright 2018 Devin Teske dteske@freebsd.org
  *
  * $FreeBSD$
  */
@@ -86,7 +87,48 @@ inline int SIGUSR1 = 30;
 #pragma D binding "1.0" SIGUSR1
 inline int SIGUSR2 = 31;
 #pragma D binding "1.0" SIGUSR2
+inline int SIGTHR = 32;
+#pragma D binding "1.13" SIGTHR
+inline int SIGLIBRT = 33;
+#pragma D binding "1.13" SIGLIBRT
 
+#pragma D binding "1.13" signal_string
+inline string signal_string[int signal] =
+	signal == SIGHUP ?	"SIGHUP" :
+	signal == SIGINT ?	"SIGINT" :
+	signal == SIGQUIT ?	"SIGQUIT" :
+	signal == SIGILL ?	"SIGILL":
+	signal == SIGTRAP ?	"SIGTRAP" :
+	signal == SIGABRT ?	"SIGABRT" :
+	signal == SIGEMT ?	"SIGEMT" :
+	signal == SIGFPE ?	"SIGFPE" :
+	signal == SIGKILL ?	"SIGKILL" :
+	signal == SIGBUS ?	"SIGBUS" :
+	signal == SIGSEGV ?	"SIGSEGV" :
+	signal == SIGSYS ?	"SIGSYS" :
+	signal == SIGPIPE ?	"SIGPIPE" :
+	signal == SIGALRM ?	"SIGALRM" :
+	signal == SIGTERM ?	"SIGTERM" :
+	signal == SIGURG ?	"SIGURG" :
+	signal == SIGSTOP ?	"SIGSTOP" :
+	signal == SIGTSTP ?	"SIGTSTP" :
+	signal == SIGCONT ?	"SIGCONT" :
+	signal == SIGCHLD ?	"SIGCHLD" :
+	signal == SIGTTIN ?	"SIGTTIN" :
+	signal == SIGTTOU ?	"SIGTTOU" :
+	signal == SIGIO ?	"SIGIO" :
+	signal == SIGXCPU ?	"SIGXCPU" :
+	signal == SIGXFSZ ?	"SIGXFSZ" :
+	signal == SIGVTALRM ?	"SIGVTALRM" :
+	signal == SIGPROF ?	"SIGPROF" :
+	signal == SIGWINCH ?	"SIGWINCH" :
+	signal == SIGINFO ?	"SIGINFO" :
+	signal == SIGUSR1 ?	"SIGUSR1" :
+	signal == SIGUSR2 ?	"SIGUSR2" :
+	signal == SIGTHR ?	"SIGTHR" :
+	signal == SIGLIBRT ?	"SIGLIBRT" :
+	"UNKNOWN";
+
 inline int CLD_EXITED = 1;
 #pragma D binding "1.0" CLD_EXITED
 inline int CLD_KILLED = 2;
@@ -99,3 +141,13 @@ inline int CLD_STOPPED = 5;
 #pragma D binding "1.0" CLD_STOPPED
 inline int CLD_CONTINUED = 6;
 #pragma D binding "1.0" CLD_CONTINUED
+
+#pragma D binding "1.13" child_signal_string
+inline string child_signal_string[int child_signal] =
+	child_signal == CLD_EXITED ?	"child exited" :
+	child_signal == CLD_KILLED ?	"child terminated abnormally" :
+	child_signal == CLD_DUMPED ?	"child core dumped" :
+	child_signal == CLD_TRAPPED ?	"traced child trapped" :
+	child_signal == CLD_STOPPED ?	"child stopped" :
+	child_signal == CLD_CONTINUED ?	"stopped child continued" :
+	strjoin("Unknown SIGCHLD code (", strjoin(lltostr(child_signal), ")"));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802252359.w1PNxlvT022663>