summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-26 22:35:13 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-29 08:50:08 +0000
commit3f947dffe734800fc15ee27f8b76d7c554249cf5 (patch)
treecbc1555d8df54974a79124fd8cd1242165328f59 /bitbake
parent942987f9cb15a92ac13118e2c2f13bcafe5e327e (diff)
downloadpoky-3f947dffe734800fc15ee27f8b76d7c554249cf5.tar.gz
bitbake: cooker: Sort task graph (dot) file output
This means two different graph files can easily be compared, currently you'd have to sort them as the output is randomized. (Bitbake rev: 5f7c6ec785f70beb1a4a1bbc0eb83cfa6cd7740d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 28717f429c..cd365f7803 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -856,12 +856,12 @@ class BBCooker:
856 856
857 with open('task-depends.dot', 'w') as f: 857 with open('task-depends.dot', 'w') as f:
858 f.write("digraph depends {\n") 858 f.write("digraph depends {\n")
859 for task in depgraph["tdepends"]: 859 for task in sorted(depgraph["tdepends"]):
860 (pn, taskname) = task.rsplit(".", 1) 860 (pn, taskname) = task.rsplit(".", 1)
861 fn = depgraph["pn"][pn]["filename"] 861 fn = depgraph["pn"][pn]["filename"]
862 version = depgraph["pn"][pn]["version"] 862 version = depgraph["pn"][pn]["version"]
863 f.write('"%s.%s" [label="%s %s\\n%s\\n%s"]\n' % (pn, taskname, pn, taskname, version, fn)) 863 f.write('"%s.%s" [label="%s %s\\n%s\\n%s"]\n' % (pn, taskname, pn, taskname, version, fn))
864 for dep in depgraph["tdepends"][task]: 864 for dep in sorted(depgraph["tdepends"][task]):
865 f.write('"%s" -> "%s"\n' % (task, dep)) 865 f.write('"%s" -> "%s"\n' % (task, dep))
866 f.write("}\n") 866 f.write("}\n")
867 logger.info("Task dependencies saved to 'task-depends.dot'") 867 logger.info("Task dependencies saved to 'task-depends.dot'")
@@ -869,18 +869,18 @@ class BBCooker:
869 with open('recipe-depends.dot', 'w') as f: 869 with open('recipe-depends.dot', 'w') as f:
870 f.write("digraph depends {\n") 870 f.write("digraph depends {\n")
871 pndeps = {} 871 pndeps = {}
872 for task in depgraph["tdepends"]: 872 for task in sorted(depgraph["tdepends"]):
873 (pn, taskname) = task.rsplit(".", 1) 873 (pn, taskname) = task.rsplit(".", 1)
874 if pn not in pndeps: 874 if pn not in pndeps:
875 pndeps[pn] = set() 875 pndeps[pn] = set()
876 for dep in depgraph["tdepends"][task]: 876 for dep in sorted(depgraph["tdepends"][task]):
877 (deppn, deptaskname) = dep.rsplit(".", 1) 877 (deppn, deptaskname) = dep.rsplit(".", 1)
878 pndeps[pn].add(deppn) 878 pndeps[pn].add(deppn)
879 for pn in pndeps: 879 for pn in sorted(pndeps):
880 fn = depgraph["pn"][pn]["filename"] 880 fn = depgraph["pn"][pn]["filename"]
881 version = depgraph["pn"][pn]["version"] 881 version = depgraph["pn"][pn]["version"]
882 f.write('"%s" [label="%s\\n%s\\n%s"]\n' % (pn, pn, version, fn)) 882 f.write('"%s" [label="%s\\n%s\\n%s"]\n' % (pn, pn, version, fn))
883 for dep in pndeps[pn]: 883 for dep in sorted(pndeps[pn]):
884 if dep == pn: 884 if dep == pn:
885 continue 885 continue
886 f.write('"%s" -> "%s"\n' % (pn, dep)) 886 f.write('"%s" -> "%s"\n' % (pn, dep))