3 Merge .stats files generated by llvm tools
5 merge-stats.py takes as argument a list of stats files to merge
6 and output the result on stdout
9 merge-stats.py $(find ./builddir/ -name "*.stats") > total.stats
17 for arg
in range(1, len(sys
.argv
)):
18 with
open(sys
.argv
[arg
], "r", encoding
="utf-8", errors
="ignore") as f
:
21 data
= json
.loads(text
)
23 print("ignored %s: failed to parse" % sys
.argv
[arg
], file=sys
.stderr
)
27 result
[key
] += data
[key
]
29 result
[key
] = data
[key
]
31 out
= json
.dumps(result
, indent
=2)