xai-org/grok-build · warning

no timing events found in {:?}

Error message

no timing events found in {:?}

What it means

generate_chrome_trace parses each line of the instrumentation log for timing events; if the whole file yields zero parseable timing events (counter `seen == 0`), it errors because an empty Chrome trace would be useless. This is a validation error, not an I/O error — the file was readable but contained no usable timing data.

Source

Thrown at crates/codegen/xai-grok-telemetry/src/instrumentation.rs:494

            .unwrap_or(0);

        let trace_event = serde_json::json!({
            "name": name,
            "cat": "instrumentation",
            "ph": "X",
            "ts": start_us,
            "dur": dur_us,
            "pid": 1,
            "tid": thread_id,
            "args": Value::Object(args),
        });

        events.push(trace_event);
        seen += 1;
    }

    if seen == 0 {
        return Err(anyhow!("no timing events found in {:?}", input));
    }

    let trace = serde_json::json!({
        "displayTimeUnit": "ms",
        "traceEvents": events,
    });

    let mut output_file = std::fs::File::create(&output)
        .map_err(|err| anyhow!("failed to create chrome trace {:?}: {}", output, err))?;
    serde_json::to_writer_pretty(&mut output_file, &trace)
        .map_err(|err| anyhow!("failed to write chrome trace: {}", err))?;

    Ok(output)
}

pub fn finalize() -> Result<()> {
    let mode = mode();
    if mode == InstrumentationMode::Disabled {

View on GitHub (pinned to bc7f02eddd)

Solutions

  1. Confirm the app actually ran instrumented/timed operations between instrumentation start and log capture
  2. Check the log is non-empty and contains timing records (`wc -l`, inspect first lines)
  3. Regenerate the instrumentation log with the same binary version that parses it
  4. Verify the parser's event-matching logic covers the event types your app emits

Example fix

// before
if seen == 0 {
    return Err(anyhow!("no timing events found in {:?}", input));
}
// after
if seen == 0 {
    eprintln!("warning: no timing events found in {:?}; emitting empty trace", input);
}
let trace = serde_json::json!({ "traceEvents": events });
Defensive patterns

Strategy: validation

Validate before calling

let has_events = std::fs::read_to_string(&input)?
    .lines()
    .any(|l| l.contains("\"ts\"") || l.contains("ph"));
if !has_events { eprintln!("log contains no timing events; run instrumented workloads first"); }

Try / catch

match generate_chrome_trace(opts) {
    Err(e) if e.to_string().contains("no timing events found") => {
        eprintln!("nothing to trace; ensure instrumented operations ran before generating");
    }
    other => other,
}

Prevention

When it happens

Trigger: Calling generate_chrome_trace against an instrumentation log that is empty, contains only non-timing lines, or whose event format does not match the parser's expected timing-event shape.

Common situations: Instrumentation started but no timed operations ran before the trace was generated; the log was rotated/truncated; a version mismatch where the log was written by a different format than the parser expects.

Related errors


AI-assisted analysis of xai-org/grok-build@bc7f02eddd (2026-08-31). Data as JSON: /api/errors/db755f1f7bc0af22. Report an issue: GitHub.