示例#1
0
文件: bootfiles.go 项目: taysom/va
func mapTrace(file string) {
	tr := trace.Get(file)
	for _, t := range tr {
		path, ok := inodb[t.Ino]
		if ok {
			_, ok = found[path]
			if !ok {
				fmt.Println(path)
				found[path] = true
			}
		}
	}
}
示例#2
0
文件: hist.go 项目: taysom/va
func histogram(name string) {
	tr := trace.Get(name)
	for _, t := range tr {
		if Max < t.Count {
			Max = t.Count
		}
		if t.Count < maxcount {
			Hist[t.Count]++
		} else {
			fmt.Println(t)
		}
	}
}
示例#3
0
文件: vcache.go 项目: taysom/va
// handler -
func handler(w http.ResponseWriter, r *http.Request) {
	tr := trace.Get(r.URL.Path[1:])
	dy := divup(trace.MaxBlock(tr), dx)
	m := Image{image.Rect(0, 0, dx, dy), make([][dx]bool, dy)}
	for _, t := range tr {
		for j := 0; j < int(t.Count); j++ {
			block := int(t.Block) + j
			y := block / dx
			x := block % dx
			m.Used[y][x] = true
		}
	}
	io.Copy(w, ShowImage(m))
}
示例#4
0
文件: cache.go 项目: taysom/va
func simulateCache(name string) {
	tr := trace.Get(name)
	noglass(tr)
	fmt.Println("size K #segs   MiB   secs    opt    avg    eff")
	for shift := uint(0); shift < MaxShift; shift++ {
		segment := make([]uint64, Segment(uint64(trace.MaxBlock(tr)), shift)+1)
		for _, t := range tr {
			for j := uint32(0); j < t.Count; j++ {
				segment[Segment(uint64(t.Block+j), shift)]++
			}
		}
		numsegs := nonzero(segment)
		avg := avgHits(segment)
		segsize := 1 << shift
		fmt.Printf(" %5d %5.3d %5.3d %6.2f %6.2f %6.2f %6.2f%%\n",
			4*segsize, numsegs, (numsegs<<shift)*PageSize/Meg,
			cost(shift, numsegs), ideal(shift, numsegs),
			avg, avg/float64(segsize)*100.)
	}
}
示例#5
0
文件: bootfiles.go 项目: taysom/va
func dumpTrace(file string) {
	tr := trace.Get(file)
	for _, t := range tr {
		fmt.Println(t)
	}
}
示例#6
0
文件: dump.go 项目: taysom/va
func dumpCache(name string) {
	tr := trace.Get(name)
	for _, t := range tr {
		fmt.Println(t)
	}
}