Use sm_print_r() only if it exists, so the code can be backported.