1# DFX子系统JS API变更 2 3OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,DFX子系统的API变更如下: 4 5## 接口变更 6 7| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | 8|---|---|---|---| 9| ohos.hiTraceMeter | hiTraceMeter | traceByValue(name: string, count: number): void; | 新增 | 10| ohos.hiTraceMeter | hiTraceMeter | finishTrace(name: string, taskId: number): void; | 新增 | 11| ohos.hiTraceMeter | hiTraceMeter | startTrace(name: string, taskId: number): void; | 新增 | 12| ohos.hiTraceChain | hiTraceChain | enableFlag(id: HiTraceId, flag: HiTraceFlag): void; | 新增 | 13| ohos.hiTraceChain | hiTraceChain | isFlagEnabled(id: HiTraceId, flag: HiTraceFlag): boolean; | 新增 | 14| ohos.hiTraceChain | hiTraceChain | isValid(id: HiTraceId): boolean; | 新增 | 15| ohos.hiTraceChain | hiTraceChain | tracepoint(mode: HiTraceCommunicationMode, type: HiTraceTracepointType, id: HiTraceId, msg?: string): void; | 新增 | 16| ohos.hiTraceChain | hiTraceChain | createSpan(): HiTraceId; | 新增 | 17| ohos.hiTraceChain | hiTraceChain | clearId(): void; | 新增 | 18| ohos.hiTraceChain | hiTraceChain | setId(id: HiTraceId): void; | 新增 | 19| ohos.hiTraceChain | hiTraceChain | getId(): HiTraceId; | 新增 | 20| ohos.hiTraceChain | hiTraceChain | end(id: HiTraceId): void; | 新增 | 21| ohos.hiTraceChain | hiTraceChain | begin(name: string, flags: number = HiTraceFlag.DEFAULT): HiTraceId; | 新增 | 22| ohos.hiTraceChain | HiTraceId | flags?: number; | 新增 | 23| ohos.hiTraceChain | HiTraceId | parentSpanId?: number; | 新增 | 24| ohos.hiTraceChain | HiTraceId | spanId?: number; | 新增 | 25| ohos.hiTraceChain | HiTraceId | chainId: bigint; | 新增 | 26| ohos.hiTraceChain | HiTraceCommunicationMode | DEVICE = 3 | 新增 | 27| ohos.hiTraceChain | HiTraceCommunicationMode | PROCESS = 2 | 新增 | 28| ohos.hiTraceChain | HiTraceCommunicationMode | THREAD = 1 | 新增 | 29| ohos.hiTraceChain | HiTraceCommunicationMode | DEFAULT = 0 | 新增 | 30| ohos.hiTraceChain | HiTraceTracepointType | GENERAL = 4 | 新增 | 31| ohos.hiTraceChain | HiTraceTracepointType | SR = 3 | 新增 | 32| ohos.hiTraceChain | HiTraceTracepointType | SS = 2 | 新增 | 33| ohos.hiTraceChain | HiTraceTracepointType | CR = 1 | 新增 | 34| ohos.hiTraceChain | HiTraceTracepointType | CS = 0 | 新增 | 35| ohos.hiTraceChain | HiTraceFlag | D2D_TP_INFO = 1 << 6 | 新增 | 36| ohos.hiTraceChain | HiTraceFlag | FAILURE_TRIGGER = 1 << 5 | 新增 | 37| ohos.hiTraceChain | HiTraceFlag | DISABLE_LOG = 1 << 4 | 新增 | 38| ohos.hiTraceChain | HiTraceFlag | NO_BE_INFO = 1 << 3 | 新增 | 39| ohos.hiTraceChain | HiTraceFlag | TP_INFO = 1 << 2 | 新增 | 40| ohos.hiTraceChain | HiTraceFlag | DONOT_CREATE_SPAN = 1 << 1 | 新增 | 41| ohos.hiTraceChain | HiTraceFlag | INCLUDE_ASYNC = 1 | 新增 | 42| ohos.hiTraceChain | HiTraceFlag | DEFAULT = 0 | 新增 | 43| ohos.hilog | LogLevel | FATAL = 7 | 新增 | 44| ohos.hilog | LogLevel | ERROR = 6 | 新增 | 45| ohos.hilog | LogLevel | WARN = 5 | 新增 | 46| ohos.hilog | LogLevel | INFO = 4 | 新增 | 47| ohos.hilog | LogLevel | DEBUG = 3 | 新增 | 48| ohos.hilog | hilog | isLoggable(domain: number, tag: string, level: LogLevel) : boolean; | 新增 | 49| ohos.hilog | hilog | fatal(domain: number, tag: string, format: string, ...args: any[]) : void; | 新增 | 50| ohos.hilog | hilog | error(domain: number, tag: string, format: string, ...args: any[]) : void; | 新增 | 51| ohos.hilog | hilog | warn(domain: number, tag: string, format: string, ...args: any[]) : void; | 新增 | 52| ohos.hilog | hilog | info(domain: number, tag: string, format: string, ...args: any[]) : void; | 新增 | 53| ohos.hilog | hilog | debug(domain: number, tag: string, format: string, ...args: any[]) : void; | 新增 | 54| ohos.hidebug | hidebug | dumpHeapData(filename : string) : void; | 新增 | 55| ohos.hidebug | hidebug | stopProfiling() : void; | 新增 | 56| ohos.hidebug | hidebug | startProfiling(filename : string) : void; | 新增 | 57| ohos.hidebug | hidebug | getSharedDirty() : bigint; | 新增 | 58| ohos.hidebug | hidebug | getPss() : bigint; | 新增 | 59| ohos.hidebug | hidebug | getNativeHeapFreeSize() : bigint; | 新增 | 60| ohos.hidebug | hidebug | getNativeHeapAllocatedSize() : bigint; | 新增 | 61| ohos.hidebug | hidebug | getNativeHeapSize() : bigint; | 新增 | 62| ohos.hichecker | hichecker | contains(rule: bigint) : boolean; | 新增 | 63| ohos.hichecker | hichecker | getRule() : bigint; | 新增 | 64| ohos.hichecker | hichecker | removeRule(rule: bigint) : void; | 新增 | 65| ohos.hichecker | hichecker | addRule(rule: bigint) : void; | 新增 | 66| ohos.hichecker | hichecker | const RULE_CHECK_ABILITY_CONNECTION_LEAK: 8589934592n; | 新增 | 67| ohos.hichecker | hichecker | const RULE_THREAD_CHECK_SLOW_PROCESS: 1n; | 新增 | 68| ohos.hichecker | hichecker | const RULE_CAUTION_TRIGGER_CRASH: 4611686018427387904n; | 新增 | 69| ohos.hichecker | hichecker | const RULE_CAUTION_PRINT_LOG: 9223372036854775808n; | 新增 | 70| ohos.faultLogger | FaultLogInfo | fullLog: string; | 新增 | 71| ohos.faultLogger | FaultLogInfo | summary: string; | 新增 | 72| ohos.faultLogger | FaultLogInfo | module: string; | 新增 | 73| ohos.faultLogger | FaultLogInfo | reason: string; | 新增 | 74| ohos.faultLogger | FaultLogInfo | timestamp: number; | 新增 | 75| ohos.faultLogger | FaultLogInfo | type: FaultType; | 新增 | 76| ohos.faultLogger | FaultLogInfo | uid: number; | 新增 | 77| ohos.faultLogger | FaultLogInfo | pid: number; | 新增 | 78| ohos.faultLogger | FaultLogger | querySelfFaultLog(faultType: FaultType, callback: AsyncCallback\<Array\<FaultLogInfo>>) : void;<br>querySelfFaultLog(faultType: FaultType) : Promise\<Array\<FaultLogInfo>>; | 新增 | 79| ohos.faultLogger | FaultType | APP_FREEZE = 4 | 新增 | 80| ohos.faultLogger | FaultType | JS_CRASH = 3 | 新增 | 81| ohos.faultLogger | FaultType | CPP_CRASH = 2 | 新增 | 82| ohos.faultLogger | FaultType | NO_SPECIFIC = 0 | 新增 | 83