trace: add internal init and fini interface