Skip to content

avoid overwriting existing vai_profile.zip - #66

Merged
hackwa merged 1 commit into
Xilinx:mainfrom
rogerngatxilinx:update/collect-data-overwriting
Oct 13, 2026
Merged

hackwa merged 1 commit into
Xilinx:mainfrom
rogerngatxilinx:update/collect-data-overwriting

Conversation

@rogerngatxilinx

Copy link
Copy Markdown
Contributor

Keep prior vai_profile.zip archives on successive collects

Summary

Running vaiprofile-collect-data a second time in the same hardware run directory no longer deletes the existing vai_profile.zip. The first archive stays in place, and later collections write vai_profile_1.zip, vai_profile_2.zip, and so on. Collected source files still move into vai_profile_data or the next free vai_profile_data_<n> directory, so both the zip and the moved-file directory now use the same numbered-fallback scheme.

This applies to the shell script and the Windows batch script. Downstream profiling that expects vai_profile.zip still finds the first collection there; later collections are additional archives rather than replacements.

Changes

File Change
src/mldebug/script/vaiprofile-collect-data If vai_profile.zip exists, write the next free vai_profile_<n>.zip
src/mldebug/script/vaiprofile-collect-data.bat Same numbered zip fallback; drop the delete-and-fail path for an existing zip

Before

out="${root}/vai_profile.zip"
rm -f "$out"
zip -j -q "$out" -- "${files[@]}"

The batch script deleted vai_profile.zip and exited with an error if the delete failed.

After

out="${root}/vai_profile.zip"
if [[ -e "$out" ]]; then
  n=1
  while [[ -e "${root}/vai_profile_${n}.zip" ]]; do
    ((n++)) || true
  done
  out="${root}/vai_profile_${n}.zip"
fi
zip -j -q "$out" -- "${files[@]}"

The batch script uses the same loop (vai_profile_%ZN%.zip) before calling :make_zip.

Motivation

vai_profile_data already avoided clobbering a previous collection by stepping to vai_profile_data_<n>. The zip path did the opposite: every run removed vai_profile.zip and wrote a new one, so an earlier archive from the same hardware run directory was lost. A second collect in one directory should keep the prior zip the same way it already keeps the prior data directory.

@hackwa
hackwa merged commit d4a7936 into Xilinx:main Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants