Last active
August 29, 2015 14:00
-
-
Save kergoth/11301539 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import dictdiffer | |
import pickle | |
import sys | |
try: | |
import pprintpp as pprint | |
except ImportError: | |
import pprint | |
if len(sys.argv) < 3: | |
sys.exit('Usage: compare-codeparser FILENAME1 FILENAME2') | |
filename1 = sys.argv[1] | |
filename2 = sys.argv[2] | |
with open(filename1, 'rb') as f1: | |
p1 = pickle.load(f1) | |
with open(filename2, 'rb') as f2: | |
p2 = pickle.load(f2) | |
if p1[1] != p2[1]: | |
sys.exit('Cache version mismatch: %s, %s' % (p1[1], p2[1])) | |
for index, segment in enumerate(p1[0]): | |
diff = list(dictdiffer.diff(segment, p2[0][index])) | |
for e in diff: | |
oper, path, change = e | |
if oper != 'change': | |
continue | |
h, key = path.split('.', 1) | |
h = int(h) | |
pprint.pprint((index, path, segment[h]['value'], change)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From b3cb8df3fe01b8c9c2e987d613b01c905c9fcd4c Mon Sep 17 00:00:00 2001 | |
From: Christopher Larson <kergoth@gmail.com> | |
Date: Fri, 25 Apr 2014 10:49:59 -0700 | |
Subject: [PATCH] bitbake/cooker: shuffle bbfiles parsing order | |
This should be a useful debugging aid, to check for deterministic codeparser | |
behavior, as a means of diagnosing the 'missing vardeps' bug. | |
Signed-off-by: Christopher Larson <kergoth@gmail.com> | |
--- | |
bitbake/lib/bb/cooker.py | 2 ++ | |
1 file changed, 2 insertions(+) | |
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py | |
index f44a088..7982414 100644 | |
--- a/bitbake/lib/bb/cooker.py | |
+++ b/bitbake/lib/bb/cooker.py | |
@@ -28,6 +28,7 @@ import atexit | |
import itertools | |
import logging | |
import multiprocessing | |
+import random | |
import sre_constants | |
import threading | |
from cStringIO import StringIO | |
@@ -1519,6 +1520,7 @@ class CookerCollectFiles(object): | |
topfile = bbfile_seen[base] | |
self.overlayed[topfile].append(f) | |
+ random.shuffle(bbfiles) | |
return (bbfiles, masked) | |
def get_file_appends(self, fn): | |
-- | |
1.7.9.5 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
if [ $# -ne 0 ]; then | |
count=$1 | |
else | |
count=10 | |
fi | |
bitbake -p | |
for i in $(seq 0 $count); do | |
cp cache/bb_codeparser.dat cache/bb_codeparser.dat.old | |
rm -r build/cache | |
rm cache/*.dat | |
bitbake -p || exit 1 | |
./compare-codeparser cache/bb_codeparser.dat.old cache/bb_codeparser.dat >codeparser-delta.$i | |
if [ $(wc -l <codeparser-delta.$i) = 0 ]; then | |
rm -f codeparser-delta.$i | |
else | |
cp cache/bb_codeparser.dat codeparser.dat.$i | |
cp cache/bb_codeparser.dat.old codeparser.dat.$i.old | |
cat codeparser-delta.$i | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment