From e4c3d714da9503d1003d274eede3af08b0486dbc Mon Sep 17 00:00:00 2001 From: Bernd Hufmann Date: Wed, 27 Nov 2024 14:37:18 -0500 Subject: [PATCH] Support of directory traces other than CTF The trace detection algorithm checks recursively for CTF traces. If no CTF trace are found under the root directory, then use the root directory as trace directory. The trace server back-end will validate if this path points to a valid trace or not. With this it's now possible to open traces that are directories other than CTF. Note that only a single trace can be opened in the experiment and not set of traces, which is currently only supported with CTF traces. Examples trace type: uftrace Signed-off-by: Bernd Hufmann --- vscode-trace-extension/src/trace-explorer/trace-utils.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vscode-trace-extension/src/trace-explorer/trace-utils.ts b/vscode-trace-extension/src/trace-explorer/trace-utils.ts index f398a20..c8973a2 100644 --- a/vscode-trace-extension/src/trace-explorer/trace-utils.ts +++ b/vscode-trace-extension/src/trace-explorer/trace-utils.ts @@ -86,6 +86,12 @@ export const fileHandler = if (fileStat.type === vscode.FileType.Directory) { // Find recursively CTF traces const foundTraces = await findTraces(filePath); + + // No CTF traces found. Add root directory as trace directory. + // Back-end will reject if it is not a trace + if (foundTraces.length === 0) { + foundTraces.push(filePath); + } foundTraces.forEach(trace => tracesArray.push(trace)); } else { // Open single trace file