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',
19 errors
='ignore') as f
:
22 data
= json
.loads(text
)
24 print('ignored %s: failed to parse' % sys
.argv
[arg
], file= sys
.stderr
)
28 result
[key
] += data
[key
]
30 result
[key
] = data
[key
]
32 out
= json
.dumps(result
, indent
=2)