示例#1
0
func main() {
	parser := tdtool.InitTool()
	parser.ParseStacktrace = false
	parser.ParseLocks = false
	stats := allStats(parser)
	printStats(stats, os.Stdout)
}
示例#2
0
func main() {
	minWaitingThreads := flag.Int("w", 0, "the minimum amount of waiting threads to be listed")
	lockObjectClass := flag.String("c", "", "a filter on the lock object class")

	parser := tdtool.InitTool()
	parser.ParseStacktrace = false

	listLocks(parser, *minWaitingThreads, *lockObjectClass, os.Stdout)
}
示例#3
0
func main() {
	name := flag.String("n", "", "either an exact name or a regular expression like 'http.*' to match everything that starts with 'http'")
	stacktrace := flag.String("s", "", "a regular expression that is performed on every stacktrace line")
	// TODO: native pid
	// TODO: java-pid
	// TODO: state

	parser := tdtool.InitTool()
	parser.KeepContent = true
	parser.ParseStacktrace = true

	filters, err := createFilters(*name, *stacktrace)
	if err != nil {
		fmt.Fprintf(os.Stderr, "Bad filters: %s\n", err.Error())
		os.Exit(1)
	}

	grepThreads(parser, filters, os.Stdout)
}
示例#4
0
文件: tdls.go 项目: slotties/jtdutils
func main() {
	sortBy := flag.String("s", "", "sort by any of: name, pid, state or empty (natural order)")
	reverseOrder := flag.Bool("r", false, "reverse sort order")
	printHexPids := flag.Bool("hex", false, "print PIDs in hexadecimal instead of decimal")

	parser := tdtool.InitTool()
	parser.ParseStacktrace = false
	parser.ParseLocks = false

	conf := Conf{}
	conf.sortBy = *sortBy
	conf.reverseOrder = *reverseOrder
	if *printHexPids {
		conf.printPid = printHexPid
	} else {
		conf.printPid = printDecimalPid
	}

	listThreads(parser, conf, os.Stdout)
}