print_record_sample: add branch stack support