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: ftrace: tracing inside dynamic linker has to be allowed with -i option


The branch, master has been updated
       via  1cc9d6f4bc5db27bf30ff59207d5588bf090495c (commit)
      from  3365da12a517b83f255cd2ebff24c00ac43bd8d4 (commit)

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

- Log -----------------------------------------------------------------
commit 1cc9d6f4bc5db27bf30ff59207d5588bf090495c
Author: Petr Machata <pmachata@redhat.com>
Date:   Wed Dec 12 22:58:35 2007 +0100

    ftrace: tracing inside dynamic linker has to be allowed with -i option
    
    * ftrace now implicitly generates -@INTERP rule at the end of each script.
      When the user wishes to trace dynamic linker, she should use -i.

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

Summary of changes:
 frysk-core/frysk/bindir/ChangeLog   |    5 +++++
 frysk-core/frysk/bindir/ftrace.java |   19 +++++++++++++++++++
 frysk-core/frysk/bindir/ftrace.xml  |   11 +++++++++++
 3 files changed, 35 insertions(+), 0 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog
index 835f14a..eb12a1d 100644
--- a/frysk-core/frysk/bindir/ChangeLog
+++ b/frysk-core/frysk/bindir/ChangeLog
@@ -1,5 +1,10 @@
 2007-12-12  Petr Machata  <pmachata@redhat.com>
 
+	* ftrace.java: Support -i for tracing inside dynamic linker.
+	* ftrace.xml: Describe it.
+
+2007-12-12  Petr Machata  <pmachata@redhat.com>
+
 	* ftrace.java: Use aliasing capabilities of Symbol.
 	(checkNameMatches): New method.
 
diff --git a/frysk-core/frysk/bindir/ftrace.java b/frysk-core/frysk/bindir/ftrace.java
index a0c416b..55e8524 100644
--- a/frysk-core/frysk/bindir/ftrace.java
+++ b/frysk-core/frysk/bindir/ftrace.java
@@ -308,6 +308,7 @@ class ftrace
     final List dynRules = new ArrayList();
     final List symRules = new ArrayList();
     final MyLtraceController controller = new MyLtraceController();
+    boolean allowInterpTracing = false;
 
     Ftrace tracer = new Ftrace();
 
@@ -453,6 +454,13 @@ class ftrace
           }
         });
 
+        parser.add(new Option('i', "don't trace dynamic linker symbols") {
+          public void parsed(String arg) throws OptionException
+          {
+	      allowInterpTracing = true;
+          }
+        });
+
 	parser.add(new Option("plt", "trace library calls done via PLT", "RULE[,RULE]...") {
 		public void parsed(String arg) {
 		    pltRules.add(arg);
@@ -504,6 +512,17 @@ class ftrace
         if (writer == null)
             writer = new PrintWriter(System.out);
 
+	// If tracing dynamic linker disabled, generate implicit
+	// -@INTERP rule at the end of the chain.
+	if (!allowInterpTracing) {
+	    if (pltRules.size() > 0)
+		pltRules.add("-@INTERP");
+	    if (dynRules.size() > 0)
+		dynRules.add("-@INTERP");
+	    if (symRules.size() > 0)
+		symRules.add("-@INTERP");
+	}
+
 	// We need to load and apply rules separately, to get all log
 	// messages.
 	for (Iterator it = pltRules.iterator(); it.hasNext(); )
diff --git a/frysk-core/frysk/bindir/ftrace.xml b/frysk-core/frysk/bindir/ftrace.xml
index 71279d7..30bb6b8 100644
--- a/frysk-core/frysk/bindir/ftrace.xml
+++ b/frysk-core/frysk/bindir/ftrace.xml
@@ -69,6 +69,7 @@
     <cmdsynopsis>
       <command>ftrace</command>
       <arg choice="opt">-c</arg>
+      <arg choice="opt">-i</arg>
       <arg choice="opt">-m</arg>
       <arg choice="opt">-o=<replaceable>FILE</replaceable></arg>
       <arg choice="opt" rep="repeat">-p=<replaceable>PID</replaceable></arg>
@@ -158,6 +159,16 @@
 
 	<variablelist>
 	  <varlistentry>
+	    <term>-i</term>
+	    <listitem>
+	      <para>Trace inside dynamic linker.  When this option is
+	      not present, <function>ftrace</function> will function
+	      as if -@INTERP rule was present at the end of each
+	      tracing script.</para>
+	    </listitem>
+	  </varlistentry>
+
+	  <varlistentry>
 	    <term>-plt=<replaceable>RULE</replaceable>[,<replaceable>RULE</replaceable>...]</term>
 	    <listitem>
 	      <para>Trace library calls done via PLT entries matching each


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]