// Path: src/org/bootchart/common/CPUSample.java
// public class CPUSample extends Sample {
// 	/** User load. */
// 	public double user;
// 	/** System load. */
// 	public double sys;
// 	/** The percentage of CPU time spent waiting on disk I/O. */
// 	public double io;
// 
// 	/**
// 	 * Creates a new sample.
// 	 *
// 	 * @param time  sample time
// 	 * @param user  user load
// 	 * @param sys   system load
// 	 * @param io    IO wait
// 	 */
// 	public CPUSample(Date time, double user, double sys, double io) {
// 		this.time = time != null ? new Date(time.getTime()) : null;
// 		this.user = user;
// 		this.sys = sys;
// 		this.io = io;
// 	}
// 
// 	/**
// 	 * Returns the string representation of the sample.
// 	 * 
// 	 * @return  string representation
// 	 */
// 	public String toString() {
// 		String t = time != null ? time.getTime() + "\t" : "";
// 		return t + user + "\t" + sys + "\t" + io;
// 	}
// }
// 
// Path: src/org/bootchart/common/ProcessSample.java
// public class ProcessSample extends Sample {
// 	/** Process state. */
// 	public int state;
// 	/** CPU statistics. */
// 	public CPUSample cpu;
// 	/** Disk utlization statistics. */
// 	public DiskUtilSample diskUtil;
// 	/** Disk troughput statistics. */
// 	public DiskTPutSample diskTPut;
// 	
// 	/**
// 	 * Creates a new process sample.
// 	 * 
// 	 * @param time      sample time
// 	 * @param state     proces state
// 	 * @param cpu       CPU sample
// 	 * @param diskUtil  disk utilization sample
// 	 * @param diskTPut  disk throughput sample
// 	 */
// 	public ProcessSample(Date time, int state, CPUSample cpu,
// 		                 DiskUtilSample diskUtil, DiskTPutSample diskTPut) {
// 		this.time = time != null ? new Date(time.getTime()) : null;
// 		this.state = state;
// 		this.cpu = cpu;
// 		this.diskUtil = diskUtil;
// 		this.diskTPut = diskTPut;
// 	}
// 	
// 	/**
// 	 * Returns the string representation of the sample.
// 	 * 
// 	 * @return  string representation
// 	 */
// 	public String toString() {
// 		return time.getTime() + "\t" + state + "\t" + cpu + "\t" + diskUtil + "\t" + diskTPut;
// 	}
// }
// 
// Path: src/org/bootchart/common/PsStats.java
// public class PsStats {
// 	/** A list of processes (with enclosing CPU samples). */
// 	public List processList;
// 	/** Statistics sampling period. */
// 	public int samplePeriod;
// 	/** Start and end of sampling period. */
// 	public Date startTime;
// 	public Date endTime;
// }


import org.bootchart.common.CPUSample;
import org.bootchart.common.Common;
import org.bootchart.common.Process;
import org.bootchart.common.ProcessSample;
import org.bootchart.common.PsStats;
import org.bootchart.common.Sample;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.logging.Logger;
					line = reader.readLine();
					continue;
				}
				lastUptime = uptime;
				time = new Date(uptime);
				
				if (startTime == null) {
					startTime = time;
				}
				numSamples++;
			} else {
				line = reader.readLine();
				continue;
			}
			line = reader.readLine();
			while (line != null && line.trim().length() > 0) {
				line = line.trim();
				/*
				 * See proc(5) for details.
				 * 
				 * {pid, comm, state, ppid, pgrp, session, tty_nr, tpgid,
				 *  flags, minflt, cminflt, majflt, cmajflt, utime, stime,
				 *  cutime, cstime, priority, nice, 0, itrealvalue, starttime, 
				 *  vsize, rss, rlim, startcode, endcode, startstack, 
				 *  kstkesp, kstkeip}
				 */
				int pos = line.indexOf(' ');
				if (pos == -1) {
					log.fine("Invalid line: " + line);
					line = reader.readLine();
// Path: src/org/bootchart/common/CPUSample.java
// public class CPUSample extends Sample {
// 	/** User load. */
// 	public double user;
// 	/** System load. */
// 	public double sys;
// 	/** The percentage of CPU time spent waiting on disk I/O. */
// 	public double io;
// 
// 	/**
// 	 * Creates a new sample.
// 	 *
// 	 * @param time  sample time
// 	 * @param user  user load
// 	 * @param sys   system load
// 	 * @param io    IO wait
// 	 */
// 	public CPUSample(Date time, double user, double sys, double io) {
// 		this.time = time != null ? new Date(time.getTime()) : null;
// 		this.user = user;
// 		this.sys = sys;
// 		this.io = io;
// 	}
// 
// 	/**
// 	 * Returns the string representation of the sample.
// 	 * 
// 	 * @return  string representation
// 	 */
// 	public String toString() {
// 		String t = time != null ? time.getTime() + "\t" : "";
// 		return t + user + "\t" + sys + "\t" + io;
// 	}
// }
// 
// Path: src/org/bootchart/common/ProcessSample.java
// public class ProcessSample extends Sample {
// 	/** Process state. */
// 	public int state;
// 	/** CPU statistics. */
// 	public CPUSample cpu;
// 	/** Disk utlization statistics. */
// 	public DiskUtilSample diskUtil;
// 	/** Disk troughput statistics. */
// 	public DiskTPutSample diskTPut;
// 	
// 	/**
// 	 * Creates a new process sample.
// 	 * 
// 	 * @param time      sample time
// 	 * @param state     proces state
// 	 * @param cpu       CPU sample
// 	 * @param diskUtil  disk utilization sample
// 	 * @param diskTPut  disk throughput sample
// 	 */
// 	public ProcessSample(Date time, int state, CPUSample cpu,
// 		                 DiskUtilSample diskUtil, DiskTPutSample diskTPut) {
// 		this.time = time != null ? new Date(time.getTime()) : null;
// 		this.state = state;
// 		this.cpu = cpu;
// 		this.diskUtil = diskUtil;
// 		this.diskTPut = diskTPut;
// 	}
// 	
// 	/**
// 	 * Returns the string representation of the sample.
// 	 * 
// 	 * @return  string representation
// 	 */
// 	public String toString() {
// 		return time.getTime() + "\t" + state + "\t" + cpu + "\t" + diskUtil + "\t" + diskTPut;
// 	}
// }
// 
// Path: src/org/bootchart/common/PsStats.java
// public class PsStats {
// 	/** A list of processes (with enclosing CPU samples). */
// 	public List processList;
// 	/** Statistics sampling period. */
// 	public int samplePeriod;
// 	/** Start and end of sampling period. */
// 	public Date startTime;
// 	public Date endTime;
// }


// Path: src/org/bootchart/parser/linux/ProcPsParser.java
import org.bootchart.common.CPUSample;
import org.bootchart.common.Common;
import org.bootchart.common.Process;
import org.bootchart.common.ProcessSample;
import org.bootchart.common.PsStats;
import org.bootchart.common.Sample;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.logging.Logger;

					line = reader.readLine();
					continue;
				}
				lastUptime = uptime;
				time = new Date(uptime);
				
				if (startTime == null) {
					startTime = time;
				}
				numSamples++;
			} else {
				line = reader.readLine();
				continue;
			}
			line = reader.readLine();
			while (line != null && line.trim().length() > 0) {
				line = line.trim();
				/*
				 * See proc(5) for details.
				 * 
				 * {pid, comm, state, ppid, pgrp, session, tty_nr, tpgid,
				 *  flags, minflt, cminflt, majflt, cmajflt, utime, stime,
				 *  cutime, cstime, priority, nice, 0, itrealvalue, starttime, 
				 *  vsize, rss, rlim, startcode, endcode, startstack, 
				 *  kstkesp, kstkeip}
				 */
				int pos = line.indexOf(' ');
				if (pos == -1) {
					log.fine("Invalid line: " + line);
					line = reader.readLine();
					continue;