public static void main(String[] args) {
		String traceFile, ignoreFile, knownFile, tmp;
		int stackLimit = 50;
		CommandLine cmd = null;
		Options options = new Options();
		options.addOption("f", "trace_file", true,
				"dalvik method profiling trace file");
		options.addOption("i", "ignore_pattern_list", true,
				"file containing patterns of classes to be ignored");
		options.addOption("k", "known_method_list", true,
				"file containing methods whose details are to be hidden");
		options.addOption("s", "stack_limit", true,
				"maximum number of stacks to be printed");
		CommandLineParser parser = new PosixParser();
		try {
			cmd = parser.parse(options, args);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			System.out.println(e.getMessage());
			printHelp(options);
			return;
		}
		traceFile = cmd.getOptionValue("f");
		if (traceFile == null) {
			System.out.println("please specify trace file");
			printHelp(options);
			return;
		}
		ignoreFile = cmd.getOptionValue("i");
		knownFile = cmd.getOptionValue("k");
		tmp = cmd.getOptionValue("s");
		if (tmp != null) {
			stackLimit = Integer.parseInt(tmp);
		}
		tracedump d = new tracedump();
		if (ignoreFile != null) {
			if (!d.parseIgnore(ignoreFile)) {
				System.out.println("failed to parse " + ignoreFile);
				return;
			}
		}
		if (knownFile != null) {
			if (!d.parseKnown((knownFile))) {
				System.out.println("failed to parse " + knownFile);
				return;
			}
		}

		if (!d.parseTrace(traceFile)) {
			System.out.println("failed to parse " + traceFile);
			return;
		}
		d.dump(stackLimit);
	}