This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Listing probe alias resolution failures
- From: patm at pdx dot edu
- To: systemtap at sources dot redhat dot com
- Date: Tue, 15 May 2007 14:14:27 -0700
- Subject: Listing probe alias resolution failures
With (version 0.5.14 built 2007-04-30) of systemtap and kernel
2.6.19.7 (i386), there are a lot (~220) of failures in the tapset like
the following:
semantic error: no match for probe point while resolving probe point
vm.write_shared_copy
To get a list of all of these, I pulled out some code from the
systemtap GUI and made a quick standalone java program "listprobes",
it works like the following:
$ java listprobes |wc --lines
1502
$ java listprobes
register_event
addevent.sunrpc
addevent.sunrpc.entry
addevent.sunrpc.return
...
$ java listprobes --format
probe register_event{}probe addevent.sunrpc{}probe
addevent.sunrpc.entry{}probe addevent.sunrpc.
return{}probe addevent.sunrpc.clnt{}...
$ java listprobes --format |stap -p2 -u -
semantic error: no match for probe point while resolving probe point
sunrpc.clnt.create_client
semantic error: no match for probe point while resolving probe point
_addevent.sunrpc.clnt.create_client.entry
semantic error: no match for probe point while resolving probe point
addevent.sunrpc.clnt.create_client.entry
semantic error: no match for probe point while resolving probe point
sunrpc.clnt.create_client.return
semantic error: no match for probe point while resolving probe point
_addevent.sunrpc.clnt.create_client.return
semantic error: no match for probe point while resolving probe point
addevent.sunrpc.clnt.create_client.return
..
These failing probes can be kept track of on bugzilla or be addressed
or be addressed by the tapset authors directly.
Attached below is the source for the listprobes java program.
Patrick McCormick
pmmccorm at us . ibm . com
import java.io.*;
import java.util.*;
import java.lang.*;
public class listprobes {
private static boolean format;
public static void main (String[] argv) {
if (argv.length != 0) format = true;
else format = false;
File tapdir = new File ("/usr/local/share/systemtap/tapset");
String s = catProbes(tapdir);
parseLevel1 (s);
return;
}
private static void parseLevel1(String s) {
String prev = null;
String prev2 = null;
StringBuilder token = new StringBuilder("");
char currChar;
for(int i=0; i<s.length(); i++) {
currChar = s.charAt(i);
if(!Character.isWhitespace(currChar) && '}' != currChar && '{' != currChar)
token.append(currChar);
else if(token.length() > 0) {
prev2 = prev;
prev = token.toString();
token.delete(0, token.length());
}
if(1 == token.length()) {
if (token.toString().contains (",") &&
!token.toString().contains("kernel.function")) { /* skip over alias of
aliases */ }
else if ("probe".equals(prev2) && "=".equals(token.toString())) {
do {
currChar = s.charAt(++i);
token.append(currChar);
} while('{' != currChar && i < s.length());
if (format) System.out.print ("probe " + prev + "{}");
else System.out.println (prev);
}
else { /* keep on moving */ }
}
}
} // end of method
private static String catProbes(File handle) {
StringBuilder sb = new StringBuilder();
if (handle.isDirectory()) {
File[] contents = handle.listFiles();
for (File file: contents) {
sb.append (catProbes(file));
}
return sb.toString();
}
else if (handle.getAbsolutePath().endsWith (".stp")) {
FileInputStream fis = null;
InputStreamReader bis = null;
BufferedReader reader = null;
sb.append ("# file " + handle.getAbsolutePath() + "\n");
try {
fis = new FileInputStream (handle);
bis = new InputStreamReader (fis);
reader = new BufferedReader(bis);
while (reader.ready()) sb.append (reader.readLine() + "\n");
reader.close();
bis.close();
fis.close();
}
catch (IOException ioe) {
// FIXME: hookup to logger
// FIXME: close streams and readers here as well?
}
return sb.toString();
}
else return "\n"; // some non-tapset file, ignore
} // end of method
}