diff --git a/src/PackCommand.cc b/src/PackCommand.cc index 4059cf1b6cf..378e4df1f11 100644 --- a/src/PackCommand.cc +++ b/src/PackCommand.cc @@ -754,6 +754,11 @@ int PackCommand::run(vector& args) { trace_dirs.push_back(trace_dir); } + // If no trace dirs were supplied, default to packing "", i.e. the latest trace. + if (trace_dirs.empty()) { + trace_dirs.push_back(""); + } + return pack(trace_dirs, flags); } diff --git a/src/test/pack.run b/src/test/pack.run index 3eaae5a0050..4c196d7c67b 100644 --- a/src/test/pack.run +++ b/src/test/pack.run @@ -12,6 +12,11 @@ pack || failed "'rr pack' failed" if [[ `ls latest-trace/*_pack$bitness-* | wc -l` != "1" ]]; then failed "Failed to coalesce all instances of 'pack'" fi + +if [[ `ls latest-trace/mmap_pack_* | wc -l` == "0" ]]; then + failed "Packing produced no files." +fi + # If there are no copies of _mapped_file it was probably copied # into the trace data, for one of various reasons, so don't fail # the test in that case.