This is the mail archive of the frysk-cvs@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[SCM] master: Signals and syscalls are case insensitive, leading "sig" is optional


The branch, master has been updated
       via  75075802814e005513057faa5bb15441638ee327 (commit)
       via  c805e006d8bc42d0daeae0088be510a65f0f2932 (commit)
      from  71bf7fec6d61c9c72ab11f33e9c327e2e88ca5fc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 75075802814e005513057faa5bb15441638ee327
Author: Petr Machata <pmachata@redhat.com>
Date:   Fri Feb 29 18:39:26 2008 +0100

    Signals and syscalls are case insensitive, leading "sig" is optional

commit c805e006d8bc42d0daeae0088be510a65f0f2932
Author: Petr Machata <pmachata@redhat.com>
Date:   Fri Feb 29 18:38:36 2008 +0100

    Allow Pattern options to be passed to Glob compiler.

-----------------------------------------------------------------------

Summary of changes:
 frysk-core/frysk/bindir/ChangeLog   |    6 ++++++
 frysk-core/frysk/bindir/ftrace.java |   13 +++++++++----
 frysk-core/frysk/bindir/ftrace.xml  |   15 +++++++++------
 frysk-core/frysk/util/ChangeLog     |    4 ++++
 frysk-core/frysk/util/Glob.java     |    4 ++++
 5 files changed, 32 insertions(+), 10 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog
index 629f309..70362ce 100644
--- a/frysk-core/frysk/bindir/ChangeLog
+++ b/frysk-core/frysk/bindir/ChangeLog
@@ -1,5 +1,11 @@
 2008-02-29  Petr Machata  <pmachata@redhat.com>
 
+	* ftrace.java (parseSigSysRules): Produce case insensitive rules,
+	allow optional prefix for signals (i.e. sigkill == KILL).
+	* ftrace.xml: Update.
+
+2008-02-29  Petr Machata  <pmachata@redhat.com>
+
 	* ftrace.java: Support signal tracing, cleanups.
 	(SyscallRule): Deleted class.
 	(ByNumberSyscallRule): Deleted class.
diff --git a/frysk-core/frysk/bindir/ftrace.java b/frysk-core/frysk/bindir/ftrace.java
index 35c76da..f886410 100644
--- a/frysk-core/frysk/bindir/ftrace.java
+++ b/frysk-core/frysk/bindir/ftrace.java
@@ -466,7 +466,9 @@ class ftrace
 	String traceableName(Object traceable);
     }
 
-    private List parseSigSysRules(String arg, final TraceableExaminer examiner) {
+    private List parseSigSysRules(String arg, final TraceableExaminer examiner,
+				  String optionalPrefix)
+    {
 	String[] strs = arg.split(",", -1);
 	Pattern sysnumPat = Pattern.compile("[0-9]+");
 	List rules = new ArrayList();
@@ -504,7 +506,10 @@ class ftrace
 	    }
 	    else if (!str.equals("")) {
 		logger.log(Level.FINE, i + ": " + str + ": by name rule");
-		final Pattern pattern = Glob.compile(str);
+		str = str.toLowerCase();
+		if (optionalPrefix != null && !str.startsWith(optionalPrefix))
+		    str = optionalPrefix + str;
+		final Pattern pattern = Glob.compile(str, Pattern.CASE_INSENSITIVE);
 		rule = new Rule(addition, stackTrace) {
 			public boolean matches(final Object traceable) {
 			    String name = examiner.traceableName(traceable);
@@ -677,7 +682,7 @@ class ftrace
 		};
 	    for (Iterator it = sysRules.iterator(); it.hasNext(); )
 		controller.gotSysRules(parseSigSysRules((String)it.next(),
-							syscallExaminer));
+							syscallExaminer, null));
 	    tracer.setTraceSyscalls(controller);
 	}
 
@@ -692,7 +697,7 @@ class ftrace
 		};
 	    for (Iterator it = sigRules.iterator(); it.hasNext(); )
 		controller.gotSigRules(parseSigSysRules((String)it.next(),
-							signalExaminer));
+							signalExaminer, "sig"));
 	    tracer.setTraceSignals(controller);
 	}
 
diff --git a/frysk-core/frysk/bindir/ftrace.xml b/frysk-core/frysk/bindir/ftrace.xml
index 1719f77..0beeabc 100644
--- a/frysk-core/frysk/bindir/ftrace.xml
+++ b/frysk-core/frysk/bindir/ftrace.xml
@@ -308,17 +308,18 @@
 
     <para>Event selection pattern syntax is then as follows:</para>
 
-    <para><optional><replaceable>syscall name</replaceable>|<replaceable>syscall number</replaceable></optional></para>
-    <para><optional><replaceable>SIGNAME</replaceable>|<replaceable>signal number</replaceable></optional></para>
+    <para><optional><replaceable>event name</replaceable>|<replaceable>event number</replaceable></optional></para>
 
     <para>When the pattern is empty, then it matches all events known
     to frysk.  When the pattern is simple number (e.g.
     &quot;12&quot;), then the pattern matches the event with the given
-    number.  Otherwise the pattern is considered to be written using
-    glob syntax, and matched against event names.</para>
+    number.  Otherwise the pattern is considered to be
+    case-insensitive glob, and matched against event names.  Whole
+    name has to match for event to be part of working set.</para>
 
-    <para>Signal names have to be given in upper case and include the
-    leading &quot;SIG&quot;.</para>
+    <para>Signal can be given both with and without leading
+    &quot;sig&quot; (e.g. &quot;sigkill&quot; as well as
+    &quot;kill&quot;).</para>
   </refsect1>
 
   <refsect1>
@@ -329,6 +330,8 @@
       <cmdsynopsis><command>ftrace -sys= ls</command></cmdsynopsis>
       <para>Trace variants of stat system call and moreover a system call #3:</para>
       <cmdsynopsis><command>ftrace -sys=&apos;*stat*,3&apos; ls</command></cmdsynopsis>
+      <para>Various ways to tell ftrace that you want to stack trace on SIGUSR1:</para>
+      <cmdsynopsis><command>ftrace -sig=#USR1,#usr1,#SIGUSR1,#sigusr1,#10 ~/sig</command></cmdsynopsis>
       <para>Trace all library calls:</para>
       <cmdsynopsis><command>ftrace -plt= ls</command></cmdsynopsis>
       <para>Trace all library calls to functions that contain
diff --git a/frysk-core/frysk/util/ChangeLog b/frysk-core/frysk/util/ChangeLog
index a4de4ff..ba686d2 100644
--- a/frysk-core/frysk/util/ChangeLog
+++ b/frysk-core/frysk/util/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-29  Petr Machata  <pmachata@redhat.com>
+
+	* Glob.java (compile(String, int)): New method.
+
 2008-02-29  Andrew Cagney  <cagney@redhat.com>
 
 	* Glob.java: Extracted from frysk.bindir.ftrace.
diff --git a/frysk-core/frysk/util/Glob.java b/frysk-core/frysk/util/Glob.java
index 8cd8bdc..acf93d3 100644
--- a/frysk-core/frysk/util/Glob.java
+++ b/frysk-core/frysk/util/Glob.java
@@ -122,4 +122,8 @@ public class Glob {
     public static Pattern compile(String glob) {
 	return Pattern.compile(toRegex(glob));
     }
+
+    public static Pattern compile(String glob, int flags) {
+	return Pattern.compile(toRegex(glob), flags);
+    }
 }


hooks/post-receive
--
frysk system monitor/debugger


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]