summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-10 21:54:48 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-10 21:54:48 +0000
commitec37588443b98cef4f3dbc9d4dbf2e162865f610 (patch)
tree1e9abcdfa7756fb2958861c710a00f7d96ec72f3
parent4ae927e113fd9d24036c8038e944ed97df419f2e (diff)
downloadportage-ec37588443b98cef4f3dbc9d4dbf2e162865f610.tar.gz
portage-ec37588443b98cef4f3dbc9d4dbf2e162865f610.tar.bz2
portage-ec37588443b98cef4f3dbc9d4dbf2e162865f610.zip
This is an old emerge profiling script that probably doesn't work.
svn path=/main/trunk/; revision=13980
-rwxr-xr-xbin/pemerge.py44
1 files changed, 0 insertions, 44 deletions
diff --git a/bin/pemerge.py b/bin/pemerge.py
deleted file mode 100755
index 08de6eda3..000000000
--- a/bin/pemerge.py
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/python -O
-
-import profile,time,sys,os
-sys.path = ["/usr/lib/portage/bin","/usr/lib/portage/pym"]+sys.path
-
-def clock():
- return time.time()
-profile.time.clock = clock
-
-profile.run("import emerge", os.getcwd()+"/prof")
-
-class StatsProcesser:
- def __init__(self, stats):
- self.output = []
- self.last = ""
- import sys
- sys.stdout = self
- stats.print_stats()
- sys.stdout = sys.__stdout__
- funcs = ["?"]
- for line in self.output:
- spline = line.split()
- if len(spline) == 6 and spline[0][0].isdigit():
- func = spline[5][spline[5].index("(")+1:-1]
- print line
- if func not in funcs:
- funcs.append(func)
- func = "\\(" + func + "\\)"
- stats.print_callers(func)
-
- def write(self, text):
- new = self.last + text
- new = new.split("\n")
- if len(new) > 1:
- self.output += new[:-1]
- self.last = new[-1]
-
-import pstats
-p = pstats.Stats("prof")
-dir(p)
-p.sort_stats("time")
-p.print_stats()
-
-sp = StatsProcesser(p)