#!/bin/bash # This scripts transforms the output of clang's -ftime-trace JSON files into a format to upload to ClickHouse # Example: # mkdir time_trace # utils/prepare-time-trace/prepare-time-trace.sh build time_trace # See also https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview < \"${OUTPUT_DIR}/\$\$\" " # Now you can upload it as follows: #cat "$OUTPUT_DIR"/* | clickhouse-client --progress --query "INSERT INTO build_time_trace (extra_column_names, file, library, time, pid, tid, ph, ts, dur, cat, name, detail, count, avgMs, args_name) FORMAT JSONCompactEachRow"