GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — AliceO2/scripts/profile-compilation-merge at dev · maoderos/AliceO2 Expand file tree/ Copy pathprofile-compilation-mergeMore file actions executable file ·45 lines (35 loc) · 1.44 KB / Copy pathprofile-compilation-mergeFile metadata and controlsexecutable file ·45 lines (35 loc) · 1.44 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 #!/usr/bin/env python3 """Combine JSON from multiple -ftime-traces into one. scripts/profile-compilation-merge foo.json bar.json. results in ./combined.json """ import json import sys if __name__ == '__main__': start_time = 0 combined_data = [] for filename in sys.argv[1:]: with open(filename, 'r') as f: file_time = None for event in json.load(f)['traceEvents']: # Skip metadata events # Skip total events # Filter out shorter events to reduce data size if event['ph'] == 'M' or \ event['name'].startswith('Total') or \ event['dur'] < 5000: continue if event['name'] == 'ExecuteCompiler': # Find how long this compilation takes file_time = event['dur'] # Set the file name in ExecuteCompiler #event['args']['detail'] = filename # Offset start time to make compiles sequential event['ts'] += start_time # Add data to combined combined_data.append(event) # Increase the start time for the next file # Add 1 to avoid issues with simultaneous events start_time += file_time + 1 with open('combined.json', 'w') as f: json.dump({'traceEvents': sorted(combined_data, key=lambda k: k['ts'])}, f) |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |