Write a tool-call entry to the global monitor mmap. `project_root` is used to derive the folder name. `prefix` identifies the tool suite (e.g. "tracedecay"). Best-effort: silently returns on any failure.
(project_root: &Path, prefix: &str, tool_name: &str, delta: u64, before: u64)
| 68 | /// the tool suite (e.g. "tracedecay"). Best-effort: silently returns on |
| 69 | /// any failure. |
| 70 | pub fn write_entry(project_root: &Path, prefix: &str, tool_name: &str, delta: u64, before: u64) { |
| 71 | let Some(dir) = global_tracedecay_dir() else { |
| 72 | return; |
| 73 | }; |
| 74 | let _ = std::fs::create_dir_all(&dir); |
| 75 | let mmap_path = dir.join(MMAP_FILENAME); |
| 76 | let project = project_root |
| 77 | .file_name() |
| 78 | .map(|n| n.to_string_lossy().to_string()) |
| 79 | .unwrap_or_default(); |
| 80 | let _ = write_entry_inner(&mmap_path, prefix, &project, tool_name, delta, before); |
| 81 | } |
| 82 | |
| 83 | /// Write a tool-call entry to a specific mmap directory (for testing). |
| 84 | pub fn write_entry_to( |
no test coverage detected