Logo J6 Ucp Perfetto Trace Catcher

J6 Ucp Perfetto Trace Catcher

Tổ chức
HorizonRobotics
j6-ucp-perfetto-trace-catcher

Capture UCP (Horizon Robotics inference SDK) Perfetto traces from a J6 development board. Use this skill whenever the user wants to grab UCP traces, capture Perfetto traces on a Horizon dev board, debug UCP scheduling issues with trace data, or pull .pftrace files from a remote board. Also trigger when the user mentions UCP performance analysis, UCP trace, hrt_model_exec tracing, or BPU trace capture on J6/S1000 platforms. Do NOT use for DSP trace or Chrome trace.

Tổng quan

Nhà phát hànhHorizonRobotics
Kho mãOE-Skills
Tên kỹ năngj6-ucp-perfetto-trace-catcher
Sao
28
Bản fork
4
Tệp đi kèm
6
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 6 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được HorizonRobotics công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI J6 Ucp Perfetto Trace Catcher trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/HorizonRobotics/OE-Skills/tree/main/horizon/skills/ucp/j6-ucp-perfetto-trace-catcher
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HorizonRobotics/OE-Skills.git /tmp/OE-Skills
mkdir -p .claude/skills
cp -r /tmp/OE-Skills/horizon/skills/ucp/j6-ucp-perfetto-trace-catcher .claude/skills/j6-ucp-perfetto-trace-catcher
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật J6 Ucp Perfetto Trace Catcher trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp J6 Ucp Perfetto Trace Catcher ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng J6 Ucp Perfetto Trace Catcher với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

UCP Trace Catcher

Capture Perfetto-based UCP traces from a remote J6 development board and bring them back to the X86 host for analysis.

What this skill does

Automates the full lifecycle of UCP Perfetto trace capture:

  1. Transfer config files to the dev board
  2. Set up the trace environment and run the application
  3. Pull the captured trace back to the host
  4. Tell the user what to do next

Only Perfetto trace is in scope — ignore DSP trace and Chrome trace.

Never modify original files in this skill's directory. Copy config files to a temp location under the local current workspace (pwd), edit the copy there, then transfer.

Before starting

You need the following information from the user. Ask for anything not provided:

ParameterDescriptionExample
board_ipIP address or hostname of the dev board192.168.1.100
board_userSSH username for the board (default: root if not specified, do not use local username)root
work_dirDirectory on the board where the UCP app runs/userdata/ucp_test
modein_process or systemsystem
enable_bpuWhether to capture BPU trace (system mode only, default: false)false
output_nameDesired trace filename (default: ucp.pftrace)my_trace.pftrace
app_commandThe UCP application command to run./hrt_model_exec perf --model_file model.hbm --frame_count 1000 --thread_num 8

If mode is not specified, ask the user:

  • in_process: captures only UCP process-internal trace (track_event). Does NOT support thread scheduling states, ftrace, memory stats, process stats, or BPU trace. No daemon needed. Good for UCP scheduling logic analysis.
  • system: captures UCP trace + thread scheduling states (ftrace), memory stats, and process stats by default (uses ucp_system.cfg). When BPU trace is enabled, the same ucp_system.cfg is used but BPU trace is additionally turned on via sysfs commands; BPU trace data will appear alongside ftrace data. Needs tracebox daemons. Use system mode when you need system-level visibility beyond UCP internals.

Important: The pre-built config files in reference/ cover all modes. Select the right one by mode — do NOT modify config files unless you have a specific reason (e.g., adjusting buffer size or duration).

Step 1: Transfer config files to the board

Config files are in this skill's reference/ directory. Select the right cfg file based on mode:

Modecfg filejson file
in_processucp_in_process.cfgucp_in_process.json
systemucp_system.cfgucp_system.json

All system mode configs share the same ucp_system.json (it just sets "backend": "system"). System mode always uses ucp_system.cfg regardless of BPU trace — BPU trace is controlled by sysfs commands, not the cfg file.

Transfer via scp:

For in_process mode

bash
scp reference/ucp_in_process.cfg reference/ucp_in_process.json <board_user>@<board_ip>:<work_dir>/

For system mode

bash
scp reference/ucp_system.cfg reference/ucp_system.json <board_user>@<board_ip>:<work_dir>/

If you edited a config copy (e.g., adjusting duration_ms or output_path), scp the copy instead of the original reference/ file.

Step 2: Set up environment and run the application

Environment variables and the app must run in the same SSH session, otherwise the variables are lost. Always combine setup and app execution into a single SSH heredoc.

For in_process mode

bash
ssh <board_user>@<board_ip> << 'EOF'
cd <work_dir>

# Remove old trace file if it exists (Perfetto cannot overwrite)
rm -f <output_name>

# Set environment variables
export HB_UCP_PERFETTO_CONFIG_PATH=ucp_in_process.json
export HB_UCP_ENABLE_PERFETTO=true

# Run the UCP application
<App command>
EOF

For system mode

bash
ssh <board_user>@<board_ip> << 'EOF'
cd <work_dir>

# Remove old trace file if it exists
rm -f <output_name>

# Kill existing tracebox processes to avoid interference
pkill -f "tracebox" 2>/dev/null || true
sleep 1

# Start Perfetto daemons
tracebox traced --background
tracebox traced_probes --background --reset-ftrace

# If BPU trace is enabled, query BPU core count and turn on BPU trace on ALL cores
if <enable_bpu>; then
    BPU_CORE_NUM=$(cat /sys/devices/system/bpu/core_num)
    for i in $(seq 0 $(expr $BPU_CORE_NUM - 1)); do
        echo 0 > /sys/devices/system/bpu/bpu${i}/power_enable 2>/dev/null || true
        echo 1 > /sys/devices/system/bpu/bpu${i}/trace
    done
fi

# Start trace capture in background and record its PID
tracebox perfetto --txt -c <cfg_file_from_step1> -o <output_name> &
PERFETTO_PID=$!

# Set UCP environment variables
export HB_UCP_PERFETTO_CONFIG_PATH=ucp_system.json
export HB_UCP_ENABLE_PERFETTO=true

# Run the UCP application
<App command>

# Wait for the background perfetto process to finish writing trace data
wait $PERFETTO_PID

# If BPU trace was enabled, disable it on ALL cores
if <enable_bpu>; then
    BPU_CORE_NUM=$(cat /sys/devices/system/bpu/core_num)
    for i in $(seq 0 $(expr $BPU_CORE_NUM - 1)); do
        echo 0 > /sys/devices/system/bpu/bpu${i}/trace
    done
fi
EOF

Important: in system mode, the tracebox perfetto process must remain running for the entire duration of the UCP application. If it exits before the app, the trace will be incomplete. After the app finishes, wait $PERFETTO_PID ensures the perfetto process completes writing all trace data before cleanup.

Step 3: Pull the trace file back to the host

After the application finishes:

bash
scp <board_user>@<board_ip>:<work_dir>/<output_name> ./

Verify the file was transferred and has reasonable size (should be > 0 bytes).

Step 4: Tell the user what to do next

Inform the user:

  • The trace file is saved at <local_path>/<output_name>
  • They can open it in Perfetto UI for visualization
  • If BPU trace was captured, they need the hbperfetto tool (contact Horizon support) to view BPU-specific data
  • Key Perfetto UI shortcuts: w/s to zoom in/out, a/d to pan left/right, ? for help

Handling common issues

ProblemSolution
Trace file already existsDelete it with rm -f ucp.pftrace before capture. Perfetto cannot overwrite.
tracebox: command not foundThe tracebox binary may not be in PATH. Ask the user where it's located.
Trace is empty or 0 bytesLikely env vars weren't set in the same shell as the app, or perfetto process crashed. Check with wait $PERFETTO_PID — if it returns a non-zero exit code, perfetto exited abnormally.
BPU trace not showingVerify BPU trace was enabled on ALL cores: query cat /sys/devices/system/bpu/core_num for the core count, then check echo 1 > /sys/devices/system/bpu/bpu${i}/trace was executed for each core i from 0 to core_num - 1 before starting the capture. Also verify power_enable was 0 on each core.
Old perfetto processes interfereKill existing tracebox perfetto and tracebox traced processes before starting a new capture.
BPU trace not cleaned upAfter capture, disable BPU trace on ALL cores: loop through echo 0 > /sys/devices/system/bpu/bpu${i}/trace for each core i from 0 to core_num - 1. Leaving it on may affect subsequent runs.
Config file not found on boardThe config files use relative paths — they must be in the same directory as the running program.

Config file reference

All config files are in this skill's reference/ directory. Read them when you need to inspect or modify the configurations before transfer.

FileModeTrace modulesBuffers
ucp_in_process.json + ucp_in_process.cfgin_processUCP1
ucp_system.json + ucp_system.cfgsystemUCP + ftrace + BPU trace (BPU data requires sysfs enable)2

Key parameters you might want to adjust:

ParameterFileDefaultPurpose
duration_msall .cfg10000 (10s)How long Perfetto captures. For in_process mode, trace data after this duration is discarded — increase this value if the app runs longer than 10s. For system mode, the perfetto process exits after this duration regardless of whether the app has finished.
size_kbucp_in_process.cfg65535Buffer size for in_process mode.
size_kbucp_system.cfg131072Buffer size per buffer for system mode (2 buffers).
file_write_period_msucp_in_process.cfg2500How often buffer is flushed to file.
write_into_fileucp_in_process.cfgtruePeriodic flush to file. Keep true for reliability.
bputrace_period_msucp_system.cfg500BPU trace sampling period. Decrease under heavy BPU load. Data appears only when BPU trace is enabled via sysfs.
output_pathucp_in_process.cfgucp.pftraceTrace output path on the board.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI J6 Ucp Perfetto Trace Catcher làm được gì?

Capture UCP (Horizon Robotics inference SDK) Perfetto traces from a J6 development board. Use this skill whenever the user wants to grab UCP traces, capture Perfetto traces on a Horizon dev board, debug UCP scheduling issues with trace data, or pull .pftrace files from a remote board. Also trigger when the user mentions UCP performance analysis, UCP trace, hrt_model_exec tracing, or BPU trace capture on J6/S1000 platforms. Do NOT use for DSP trace or Chrome trace.

Vì sao nên dùng J6 Ucp Perfetto Trace Catcher trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. J6 Ucp Perfetto Trace Catcher là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài J6 Ucp Perfetto Trace Catcher trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/HorizonRobotics/OE-Skills/tree/main/horizon/skills/ucp/j6-ucp-perfetto-trace-catcher. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng J6 Ucp Perfetto Trace Catcher?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng J6 Ucp Perfetto Trace Catcher với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng J6 Ucp Perfetto Trace Catcher với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI J6 Ucp Perfetto Trace Catcher có miễn phí không?

Có. Kỹ năng này được HorizonRobotics phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇