Lines Matching +full:json +full:- +full:schema
1 //===-- TraceIntelPTBundleLoader.cpp --------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
36 auto do_parse = [&]() -> Error { in ParseModule()
57 module_sp->SetLoadAddress(target, module.load_address.value, false, in ParseModule()
68 Error TraceIntelPTBundleLoader::CreateJSONError(json::Path::Root &root, in CreateJSONError()
69 const json::Value &value) { in CreateJSONError()
108 ProcessSP process_sp = target_sp->CreateProcess( in CreateEmptyProcess()
113 process_sp->SetID(static_cast<lldb::pid_t>(pid)); in CreateEmptyProcess()
126 ProcessSP process_sp = parsed_process->target_sp->GetProcessSP(); in ParseProcess()
129 parsed_process->threads.push_back(ParseThread(*process_sp, thread)); in ParseProcess()
132 if (Error err = ParseModule(*parsed_process->target_sp, module)) in ParseProcess()
136 process_sp->GetThreadList().SetSelectedThreadByIndexID(0); in ParseProcess()
141 process_sp->DidAttach(process_arch); in ParseProcess()
155 ProcessSP process_sp = parsed_process->target_sp->GetProcessSP(); in ParseKernel()
161 thread_sp->SetName(formatv("kernel_cpu_{0}", cpu.id).str().c_str()); in ParseKernel()
162 process_sp->GetThreadList().AddThread(thread_sp); in ParseKernel()
163 parsed_process->threads.push_back(thread_sp); in ParseKernel()
167 FileSpec file_spec(bundle_description.kernel->file); in ParseKernel()
173 parsed_process->target_sp->GetOrCreateModule(module_spec, false, &error); in ParseKernel()
179 bundle_description.kernel->load_address in ParseKernel()
180 ? bundle_description.kernel->load_address->value in ParseKernel()
184 module_sp->SetLoadAddress(*parsed_process->target_sp, load_address, false, in ParseKernel()
187 process_sp->GetThreadList().SetSelectedThreadByIndexID(0); in ParseKernel()
192 process_sp->DidAttach(process_arch); in ParseKernel()
230 static std::string schema; in GetSchema() local
231 if (schema.empty()) { in GetSchema()
232 schema = R"({ in GetSchema()
233 "type": "intel-pt", in GetSchema()
289 // section in https://man7.org/linux/man-pages/man2/perf_event_open.2.html in GetSchema()
307 - All paths are either absolute or relative to folder containing the bundle in GetSchema()
309 - "cpus" is provided if and only if processes[].threads[].iptTrace is not provided. in GetSchema()
310 - "tscPerfZeroConversion" must be provided if "cpus" is provided. in GetSchema()
311 - If "kernel" is provided, then the "processes" section must be empty or not in GetSchema()
319 return schema; in GetSchema()
345 if (indexed_threads[proc->second].count(tid)) in AugmentThreadsFromContextSwitches()
347 indexed_threads[proc->second].insert(tid); in AugmentThreadsFromContextSwitches()
348 proc->second->threads.push_back({tid, /*ipt_trace=*/std::nullopt}); in AugmentThreadsFromContextSwitches()
354 [&](ArrayRef<uint8_t> data) -> Error { in AugmentThreadsFromContextSwitches()
376 processes.push_back(parsed_process.target_sp->GetProcessSP()); in CreateTraceIntelPTInstance()
388 parsed_process.target_sp->SetTrace(trace_instance); in CreateTraceIntelPTInstance()
416 bundle_description.kernel->file = in NormalizeAllPaths()
417 NormalizePath(bundle_description.kernel->file).GetPath(); in NormalizeAllPaths()
422 json::Path::Root root("traceBundle"); in Load()