I prefer using pre-compiled expression objects, especially when loops are involved. You'd use re.compile near the top of the function (probably in a new paragraph between the global variables and the local state variables), and assign the returned object to a variable such as thread_trace_start_exp. Then, the conditional statement becomes elif thread_trace_start_exp.match(line_stripped).
Also, the expression should use ^ and $. (The `match` method will imply ^, of course, but you know what the Zen of Python says about explicit vs. implicit. ☺)
Other than these minor details, that sounds like the correct fix.