summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/profile.py
diff options
context:
space:
mode:
authorDenis Bitouzé <dbitouze@wanadoo.fr>2021-02-25 18:23:07 +0000
committerDenis Bitouzé <dbitouze@wanadoo.fr>2021-02-25 18:23:07 +0000
commitc6101f91d071883b48b1b4b51e5eba0f36d9a78d (patch)
tree1bf7f5a881d7a4f5c5bf59d0b2821943dd822372 /Build/source/utils/asymptote/profile.py
parent07ee7222e389b0777456b427a55c22d0e6ffd267 (diff)
French translation for tlmgr updated
git-svn-id: svn://tug.org/texlive/trunk@57912 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/profile.py')
-rw-r--r--Build/source/utils/asymptote/profile.py98
1 files changed, 0 insertions, 98 deletions
diff --git a/Build/source/utils/asymptote/profile.py b/Build/source/utils/asymptote/profile.py
deleted file mode 100644
index bfdd52015bc..00000000000
--- a/Build/source/utils/asymptote/profile.py
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/usr/bin/env python3
-
-import sys
-from pprint import pprint
-
-# Unused line numbers required by kcachegrind.
-POS = '1'
-
-def nameFromNode(tree):
- name = tree['name']
- pos = tree['pos']
- if pos.endswith(": "):
- pos = pos[:-2]
- return (name, pos)
-
-def addFuncNames(tree, s):
- s.add(nameFromNode(tree))
- for child in tree['children']:
- addFuncNames(child, s)
-
-def funcNames(tree):
- s = set()
- addFuncNames(tree, s)
- return s
-
-def computeTotals(tree):
- for child in tree['children']:
- computeTotals(child)
- tree['instTotal'] = (tree['instructions']
- + sum(child['instTotal'] for child in tree['children']))
- tree['nsecsTotal'] = (tree['nsecs']
- + sum(child['nsecsTotal'] for child in tree['children']))
-
-def printName(name, prefix=''):
- print (prefix+"fl=", name[1])
- print (prefix+"fn=", name[0])
-
-class Arc:
- def __init__(self):
- self.calls = 0
- self.instTotal = 0
- self.nsecsTotal = 0
-
- def add(self, tree):
- self.calls += tree['calls']
- self.instTotal += tree['instTotal']
- self.nsecsTotal += tree['nsecsTotal']
-
-class Func:
- def __init__(self):
- self.instructions = 0
- self.nsecs = 0
- self.arcs = {}
-
- def addChildTime(self, tree):
- arc = self.arcs.setdefault(nameFromNode(tree), Arc())
- arc.add(tree)
-
- def analyse(self, tree):
- self.instructions += tree['instructions']
- self.nsecs += tree['nsecs']
- for child in tree['children']:
- self.addChildTime(child)
-
- def dump(self):
- print (POS, self.instructions, self.nsecs)
- for name in self.arcs:
- printName(name, prefix='c')
- arc = self.arcs[name]
- print ("calls="+str(arc.calls), POS)
- print (POS, arc.instTotal, arc.nsecsTotal)
- print ()
-
-def analyse(funcs, tree):
- funcs[nameFromNode(tree)].analyse(tree)
- for child in tree['children']:
- analyse(funcs, child)
-
-def dump(funcs):
- print ("events: Instructions Nanoseconds")
- for name in funcs:
- printName(name)
- funcs[name].dump()
-
-rawdata = __import__("asyprof")
-profile = rawdata.profile
-
-computeTotals(profile)
-names = funcNames(profile)
-
-funcs = {}
-for name in names:
- funcs[name] = Func()
-
-analyse(funcs, profile)
-dump(funcs)
-
-#pprint(names)