erlang各种有用的函数包括一些有用nif封装,还有一些性能测试case。
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

19 行
591 B

  1. -ifdef(OTP_RELEASE). %% this implies 21 or higher
  2. -define(EXCEPTION(Class, Reason, Stacktrace), Class:Reason:Stacktrace).
  3. -define(GET_STACK(Stacktrace), Stacktrace).
  4. -else.
  5. -define(EXCEPTION(Class, Reason, _), Class:Reason).
  6. -define(GET_STACK(_), erlang:get_stacktrace()).
  7. -endif.
  8. %% 追溯打印函数调用流程
  9. -define(PRINT_STACK(Tag),
  10. Stack =
  11. try
  12. throw(0)
  13. catch
  14. ?EXCEPTION(_Class, _Reason, Stacktrace) ->
  15. ?GET_STACK(Stacktrace)
  16. end,
  17. io:format("tarce tag:~p cur Stacktrace:", [Tag]),
  18. io:format(utParseStack:parseStack(Stack))
  19. ).