INNER CODE UNIT · Python

trace_to_dicts

SpaRcle-Studio/SREngine · CI/ninjatracing.py:108

def trace_to_dicts(target, trace, options, pid, tid):
    """Read a file-like object |trace| containing -ftime-trace data and yields
    about:tracing dict per eligible event in that log."""
    ninja_time = (target.end - target.start) * 1000
    for event in read_events(trace, options):
        # Check if any event duration is greater than the duration from ninja.
        if event['dur'] > ninja_time:
            print("Inconsistent timing found (clang time > ninja time). Please"
                  " ensure that timings are from consistent builds.")
            sys.exit(1)

        # Set tid and pid from ninja log.
        event['pid'] = pid
        event['tid'] = tid

        # Offset trace time stamp by ninja start time.
        event['ts'] += (target.start * 1000)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…