You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 line
2.2 KiB

  1. %% 三目元算符
  2. -define(IIF(Cond, Then, That), case Cond of true -> Then; _ -> That end).
  3. %% Ignore Msg Hole Name
  4. -define(eTpfHole, '$eTpfHole').
  5. %% 消息截取默认配置项
  6. -define(defTcmMap, #{
  7. tcmIsCut => false
  8. , tcmDepth => 5
  9. , tcmListSize => 32
  10. , tcmMapSize => 32
  11. , tcmTupleSize => 32
  12. , tcmBinSize => 128
  13. , tcmBitSize => 128 * 8
  14. , tcmNestStruct => 6
  15. }).
  16. -define(eTpfTracerId, eTpfTracerId).
  17. %% 类型声明
  18. -export_type([pidPortSpec/0, flagList/0, pattern/0, traceOpts/0, tracerOpts/0]).
  19. -type pidPortSpec() :: PidPortSpec :: pid() | port()| all | processes | ports| existing | existing_processes | existing_ports| new | new_processes | new_ports.
  20. -type flagList() :: erlang:trace_flag().
  21. -type pattern() :: module() | {module(), atom(), atom()} | {app, atom()} | {callback, module(), atom()}.
  22. -type traceOpts() :: #{
  23. tracerId => any()
  24. , stackTc => boolean() %% 必需的trace选项 为了生成火焰图,我们目前在跟踪时需要使用一个附加选项。此选项将导致将堆栈跟踪信息添加到调用事件。选项为`process_dump`, 并且必须将其设置为`true`。
  25. }.
  26. -type tracerOpts() :: #{
  27. %% tracer for socket
  28. port => pos_integer()
  29. %% tracer for file
  30. , fDir => string() %% 文件目录
  31. , fBaseName => string() %% 文件base file name
  32. , fMaxSize => pos_integer() %% 最大的文件字节数
  33. , fMaxMsg => pos_integer() %% 最大消息数量
  34. %% tracer for console
  35. %% trace msg term cut cfg
  36. , tcmIsCut => boolean() %% 是否cut trace msg term
  37. , tcmDepth => pos_integer() %% term cut时保留的最大深度
  38. , tcmListSize => pos_integer() %% List term cut时保留的最大数量
  39. , tcmMapSize => pos_integer() %% Map term cut时保留的最大数量
  40. , tcmTupleSize => pos_integer() %% Tuple term cut时保留的最大数量
  41. , tcmBinSize => pos_integer() %% Bin term cut时保留的最大字节数
  42. , tcmBitSize => pos_integer() %% Bits term cut时保留的最大bit数
  43. , tcmNestStruct => pos_integer() %% 复合结构 term cut时保留的最大数量
  44. }.