Author: jfrederic.clere(a)jboss.com
Date: 2008-09-01 12:25:48 -0400 (Mon, 01 Sep 2008)
New Revision: 1771
Modified:
sandbox/mod_jk/TraceAna.java
Log:
Add a offset parameter.
Modified: sandbox/mod_jk/TraceAna.java
===================================================================
--- sandbox/mod_jk/TraceAna.java 2008-08-27 16:00:49 UTC (rev 1770)
+++ sandbox/mod_jk/TraceAna.java 2008-09-01 16:25:48 UTC (rev 1771)
@@ -193,17 +193,27 @@
return string;
}
public static void main(String[] args) throws Exception {
- if (args.length != 1) {
+
+ int offset = 0;
+ if (args.length < 1 && args.length > 2) {
System.err.println("missing command line arguments");
System.exit(1);
}
- FileInputStream fd = new FileInputStream(args[0]);
+ FileInputStream fd = null;
+ if (args.length == 2) {
+ offset = Integer.parseInt(args[0]);
+ fd = new FileInputStream(args[1]);
+ } else {
+ fd = new FileInputStream(args[0]);
+ }
BufferedReader in = new BufferedReader(new InputStreamReader(fd));
TraceAna buf = new TraceAna(8192);
/* Detect the "): 0000 " to find the offset of the dumped data */
String ins = in.readLine();
- int offset = ins.indexOf("): 0000 ",0);
- offset = offset + 11;
+ if (offset == 0) {
+ offset = ins.indexOf("): 0000 ",0);
+ offset = offset + 11;
+ }
// while(in.ready()) { /* assume more that one line of traces */
boolean isok = true;
while (isok) {
Show replies by date