hiviewdfx_hiviewdfx_cangjie_wrapper:基于 OpenHarmony 的 DFX 仓颉接口封装项目

DFX子系统仓颉封装层

Branch6Tags0
FilesLast commitLast update
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago

hiviewdfx_cangjie_wrapper

Introduction

The hiviewdfx_cangjie_wrapper is a Cangjie API encapsulated on OpenHarmony based on the capabilities of the DFX Subsystem. Design for X (DFX) refers to the software design that aims to improve the quality attribute in OpenHarmony. It mainly consists of two parts: design for reliability (DFR) and design for testability (DFT).The DFX Cangjie interface currently under development only supports standard devices.

System Architecture

Figure 1 Architecture of the hiviewdfx_cangjie_wrapper

Architecture of the hiviewdfx_cangjie_wrapper

As shown in the diagram:

  • DFX Cangjie provides the following capabilities:
    • HiLog:A logging system enables applications/services to output log content according to specified levels, identifiers, and format strings, helping developers understand the running status of applications/services and better debug programs.
    • HiAppEvent:This module provides application management and event subscription capabilities, including event storage, event subscription, event cleaning, management configuration, and other functions.
    • HiTraceMeter:This module provides the ability to track process trajectories and measure program execution performance.
  • Interface encapsulation: Implement DFX capability using Cangjie.
  • Cangjie DFX FFI interface definition: responsible for defining the C interoperability Cangjie interface, used to implement Cangjie DFX capabilities.

Directory Structure

base/hiviewdfx/hiviewdfx_cangjie_wrapper
├── figures                    # architecture pictures
├── kit                        # Cangjie kit code
│   └── PerformanceAnalysisKit
├── ohos                       # Cangjie DFX code
│   ├── hi_trace_meter         # Cangjie HiTraceMeter code
│   ├── hilog                  # Cangjie HiLog code
│   └── hiviewdfx              # Cangjie HiAppEvent code
└── test                       # Test cases

Usage

As shown in the diagram, DFX Cangjie provides the following functions, and developers can comprehensively use one or more types of interfaces according to their usage requirements:

  • HiLog: Implements logging.
  • HiAppEvent: Implements logging of application events.
  • HiTraceMeter: Implement call chain tracing throughout a service process.

DFX Cangjie related APIs, please refer toohos.hiviewdfx.hi_app_event(Application Event Logging),ohos.hilog(HiLog Logging),ohos.hi_trace.meter(Performance Tracing).

For relevant guidance, please refer toIntroduction to Performance Analysis Kit.

Compared to ArkTS, the following features are currently not supported:

  • Hiview: Functions as the plug-in platform.
  • FaultLoggerd: Implements fault information collection and subscription.

Code Contribution

Developers are welcome to contribute code, documentation, etc. For specific contribution processes and methods, please refer to Code Contribution.

Repositories Involved

hiviewdfx_hilog

hiviewdfx_hiappevent

hiviewdfx_hitrace

Introduction

DFX子系统仓颉封装层

Customize your domain