SCAN: an approach to label and relate execution trace segments