Lines Matching +full:json +full:- +full:schema

1 //===-- Trace.cpp ---------------------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
28 // Helper structs used to extract the type of a JSON trace bundle description
36 namespace json { namespace
40 json::ObjectMapper o(value, path); in fromJSON()
44 } // namespace json
57 return it->second; in Lookup()
65 return &it->second; in LookupAsPtr()
75 return Lookup(it->second, k2); in Lookup()
84 return LookupAsPtr(it->second, k2); in LookupAsPtr()
91 "no trace plug-in matches the specified type: \"%s\"", in createInvalidPlugInError()
103 "could not open input file: %s - %s.", in LoadPostMortemTraceFromFile()
108 Expected<json::Value> session_file = in LoadPostMortemTraceFromFile()
109 json::parse(buffer_or_error.get()->getBuffer().str()); in LoadPostMortemTraceFromFile()
120 Debugger &debugger, const json::Value &trace_bundle_description, in FindPluginForPostMortemProcess()
123 json::Path::Root root("traceBundle"); in FindPluginForPostMortemProcess()
124 if (!json::fromJSON(trace_bundle_description, json_bundle, root)) in FindPluginForPostMortemProcess()
138 "Can't trace non-live processes"); in FindPluginForLiveProcess()
148 StringRef schema = PluginManager::GetTraceSchema(name); in FindPluginSchema() local
149 if (!schema.empty()) in FindPluginSchema()
150 return schema; in FindPluginSchema()
155 Error Trace::Start(const llvm::json::Value &request) { in Start()
160 return m_live_process->TraceStart(request); in Start()
168 return m_live_process->TraceStop(TraceStopRequest(GetPluginName())); in Stop()
176 return m_live_process->TraceStop(TraceStopRequest(GetPluginName(), tids)); in Stop()
184 return m_live_process->TraceGetState(GetPluginName()); in GetLiveProcessState()
216 m_live_process->TraceGetBinaryData(request); in GetLiveTraceBinaryData()
221 if (data->size() != expected_size) in GetLiveTraceBinaryData()
226 request.kind, expected_size, data->size(), request.tid, in GetLiveTraceBinaryData()
261 return m_live_process->TraceGetBinaryData(request); in GetLiveCpuBinaryData()
287 uint32_t new_stop_id = m_live_process->GetStopID(); in RefreshLiveProcessState()
297 auto do_refresh = [&]() -> Error { in RefreshLiveProcessState()
303 json::parse<TraceGetStateResponse>(*json_string, in RefreshLiveProcessState()
308 if (live_process_state->warnings) { in RefreshLiveProcessState()
309 for (std::string &warning : *live_process_state->warnings) in RefreshLiveProcessState()
314 live_process_state->traced_threads) { in RefreshLiveProcessState()
321 live_process_state->traced_threads.size()); in RefreshLiveProcessState()
323 if (live_process_state->cpus) { in RefreshLiveProcessState()
325 for (const TraceCpuState &cpu_state : *live_process_state->cpus) { in RefreshLiveProcessState()
326 m_storage.cpus->push_back(cpu_state.id); in RefreshLiveProcessState()
332 live_process_state->cpus->size()); in RefreshLiveProcessState()
335 for (const TraceBinaryData &item : live_process_state->process_binary_data) in RefreshLiveProcessState()
344 return m_storage.live_refresh_error->c_str(); in RefreshLiveProcessState()
434 return callback(it.first->second); in OnLiveCpuBinaryDataRead()
443 inconvertibleErrorCode(), "Failed fetching trace-related file %s. %s", in OnDataFileRead()
489 [&](std::vector<cpu_id_t>::iterator cpu_id) -> Error { in OnAllCpusBinaryDataRead()
490 if (cpu_id == storage.cpus->end()) in OnAllCpusBinaryDataRead()
494 [&](ArrayRef<uint8_t> data) -> Error { in OnAllCpusBinaryDataRead()
501 return process_cpu(storage.cpus->begin()); in OnAllCpusBinaryDataRead()