# In a per-pid setup, only the first chunk is a valid trace, the other
# chunks should be empty folders
if test $per_pid = 1; then
# In a per-pid setup, only the first chunk is a valid trace, the other
# chunks should be empty folders
if test $per_pid = 1; then
- validate_trace_empty $local_path/${chunk_pattern}-1
- nr=$(ls $local_path/${chunk_pattern}-2/ust | wc -l)
- test $nr = 0
+ validate_trace_empty $local_path/${chunk_pattern}-0
+ nr=$(find $local_path/${chunk_pattern}-1/ | wc -l)
+ # contains self and may contain ust/ subdir (local) or not (remote).
+ test $nr -le 2