perfetto-protos
v48.1.0
Published
Perfetto protos exposed via protobuf-es for browser and node
Downloads
852
Readme
perfetto-protos
Use perfetto protos in {Type,Java}Script in the browser and node
Example:
import { TraceConfigSchema } from "perfetto-protos";
import { create, toBinary, toJson } from "@bufbuild/protobuf";
const config = create(TraceConfigSchema, {
durationMs: 10000,
buffers: [
{
sizeKb: 65536,
},
],
dataSources: [
{
config: {
name: "linux.ftrace",
targetBuffer: 0,
ftraceConfig: {
ftraceEvents: "sched_switch",
ftraceEvents: "sched_wakeup",
},
},
},
],
});
const bytes = toBinary(TraceConfigSchema, config);
console.log("Config as bytes:", bytes);
const json = toJson(TraceConfigSchema, config);
console.log("Config as json:", json);