common: add print_trace() for backtracing