diff --git a/analyzeme/src/profiling_data.rs b/analyzeme/src/profiling_data.rs index 0247a5c..e9fad39 100644 --- a/analyzeme/src/profiling_data.rs +++ b/analyzeme/src/profiling_data.rs @@ -52,6 +52,17 @@ impl ProfilingData { fs::read(paths.string_index_file).expect("couldn't read string_index file"); let event_data = fs::read(paths.events_file).expect("couldn't read events file"); + ProfilingData::from_buffers(string_data, index_data, event_data) + } + + pub fn from_buffers( + string_data: Vec, + string_index: Vec, + events: Vec, + ) -> Result> { + let index_data = string_index; + let event_data = events; + let event_data_format = read_file_header(&event_data, FILE_MAGIC_EVENT_STREAM)?; if event_data_format != CURRENT_FILE_FORMAT_VERSION { Err(format!(