Add public lw_trace function