tiny.profiling.driver.publish
Defined in driver.
API (1)
Actions
Public operations.
Source
Source: src/profiling/driver/publish.zig
zig
const std = @import("std");const catalog = @import("../root.zig").catalog;const host = @import("../root.zig").host;const ingest = @import("../root.zig").ingest;const order = @import("../root.zig").order;const record = @import("../root.zig").record;const reducer = @import("../root.zig").reduction;const CompletedWorkload = @import("root.zig").model.CompletedWorkload;const PreparedWorkload = @import("root.zig").model.PreparedWorkload;const WorkloadContext = @import("root.zig").model.WorkloadContext;const benchmarkReductionDomain = @import("root.zig").artifact.benchmarkReductionDomain;const collectCaptures = @import("root.zig").artifact.collectCaptures;const collectMeasuredArtifacts = @import("root.zig").artifact.collectMeasuredArtifacts;const hasControlResult = @import("root.zig").artifact.hasControlResult;const perturbationStructuredPaths = @import("root.zig").artifact.perturbationStructuredPaths;const reduceMeasuredBenchmarks = @import("root.zig").artifact.reduceMeasuredBenchmarks;const retainedArtifactPaths = @import("root.zig").artifact.retainedArtifactPaths;const writeCaptureCaveats = @import("root.zig").progress.writeCaptureCaveats;pub fn recordCompletedWorkload( allocator: std.mem.Allocator, context: *const WorkloadContext, workload: catalog.Workload, index: usize, prepared: PreparedWorkload, completed_value: CompletedWorkload, acquisition: order.Context, started_unix_ns: i128, finished_unix_ns: i128,) !i64 { var completed = completed_value; const scope_label = if (prepared.execution_plan.direct) host.direct_scope else host.scope; const structured = try collectMeasuredArtifacts( allocator, context, workload, prepared, completed.executions, ); const benchmark_process_domain = benchmarkReductionDomain( context.request, workload.surface, workload.tracesAllocationsByDefault(), prepared.execution_plan, ); const benchmark_process_reduction = try reduceMeasuredBenchmarks( allocator, benchmark_process_domain, completed.executions, ); const captures = try collectCaptures( allocator, context, workload, prepared, completed, scope_label, structured.max_benchmark_allocated_bytes, ); try writeCaptureCaveats(allocator, workload.name, captures); if (completed.perturbation) |*measurement| { if (hasControlResult(measurement.pairs)) { const control_structured = try ingest.collect( allocator, workload, perturbationStructuredPaths(measurement.control_artifacts), ); measurement.control_structured_rows = control_structured.rows; measurement.control_structured_parse_errors = control_structured.parse_errors; } } try appendWorkloadRecord( allocator, context, workload, index, prepared, completed, acquisition, scope_label, captures, structured, benchmark_process_domain, benchmark_process_reduction, started_unix_ns, finished_unix_ns, ); return completed.execution.exit_code;}fn appendWorkloadRecord( allocator: std.mem.Allocator, context: *const WorkloadContext, workload: catalog.Workload, index: usize, prepared: PreparedWorkload, completed: CompletedWorkload, acquisition: order.Context, scope_label: []const u8, captures: []const host.Capture, structured: ingest.Summary, benchmark_process_domain: reducer.DomainDeclaration, benchmark_process_reduction: reducer.Result, started_unix_ns: i128, finished_unix_ns: i128,) !void { std.debug.assert(index < context.request.selection.count()); std.debug.assert(prepared.command.len > 0); std.debug.assert(acquisition.valid()); const artifacts = retainedArtifactPaths(prepared.paths, completed.executions); try record.appendWorkload(allocator, context.paths, context.metadata, .{ .index = index, .acquisition = acquisition, .workload = workload, .runtime = prepared.runtime, .argv = prepared.wrapped.argv, .command = prepared.command, .cwd = prepared.execution_plan.cwd, .scope = scope_label, .causal = context.request.control.causal, .tracy = context.request.tracy, .trace_allocations = context.request.trace_allocations or workload.tracesAllocationsByDefault(), .bench_min_time_ns = context.request.control.min_time_ns, .causal_filter = context.request.control.filter, .setup = completed.setup, .prepare = completed.prepare, .artifact_root = prepared.paths.root, .command_path = prepared.paths.command, .result_path = prepared.paths.result, .stdout_path = artifacts.stdout, .stderr_path = artifacts.stderr, .bench_jsonl_path = artifacts.bench_jsonl, .coz_jsonl_path = artifacts.coz_jsonl, .coz_analysis_path = artifacts.coz_analysis, .tracy_jsonl_path = artifacts.tracy_jsonl, .tracy_summary_path = artifacts.tracy_summary, .allocations_path = artifacts.allocations, .allocation_repetitions_path = prepared.paths.allocation_repetitions, .structured_path = prepared.paths.structured, .structured_rows = structured.rows, .structured_parse_errors = structured.parse_errors, .started_unix_ns = started_unix_ns, .finished_unix_ns = finished_unix_ns, .execution = completed.execution, .executions = completed.executions, .benchmark_process_domain = benchmark_process_domain, .benchmark_process_reduction = benchmark_process_reduction, .host_state_windows = completed.host_state_windows, .warmup_executions = completed.warmup_executions, .warmup_paths = prepared.paths.warmup, .resets = completed.resets, .perturbation = completed.perturbation, .captures = captures, });}Source: src/profiling/driver/root.zig:10
zig
pub const publish = @import("publish.zig");Complete call list for driver.publish.recordCompletedWorkload
8 direct calls.
tiny.profiling.driver.artifact.benchmarkReductionDomain[function] atsrc/profiling/driver/artifact.zig:272tiny.profiling.driver.artifact.collectCaptures[function] atsrc/profiling/driver/artifact.zig:20tiny.profiling.driver.artifact.collectMeasuredArtifacts[function] atsrc/profiling/driver/artifact.zig:169tiny.profiling.driver.artifact.hasControlResult[function] atsrc/profiling/driver/artifact.zig:162tiny.profiling.driver.artifact.perturbationStructuredPaths[function] atsrc/profiling/driver/artifact.zig:149tiny.profiling.driver.artifact.reduceMeasuredBenchmarks[function] atsrc/profiling/driver/artifact.zig:246tiny.profiling.driver.progress.writeCaptureCaveats[function] atsrc/profiling/driver/progress.zig:105src.profiling.driver.publish.appendWorkloadRecord[function] — private; no exact target atsrc/profiling/driver/publish.zig:91in nearest public ownertiny.profiling.driver.publish
Audit
| Definitions | 2 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |