本文へ移動
cccskills
無料GitHub で公開

trace-collection-assistant

Collect, normalize, and structure execution traces from instrumented programs (strace, ltrace) into JSON format for downstream analysis. Use when working with system call traces, library call traces, or execution logs that need to be analyzed for debugging, test case reproduction, or verification. Supports parsing strace/ltrace output, filtering noise, extracting debug information, and preparing traces for bug analysis or reproduction workflows.

インストール方法を見る

含まれるファイル(9)

  • SKILL.md5.4 KB
  • assets/schema_template.json3.1 KB
  • references/analysis_guide.md4.2 KB
  • references/json_schema.md2.2 KB
  • references/trace_formats.md2.5 KB
  • scripts/extract_debug_info.py6.4 KB
  • scripts/filter_trace.py3.9 KB
  • scripts/parse_ltrace.py3.2 KB
  • scripts/parse_strace.py3.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Trace Collection Assistant

Overview

This skill helps collect, normalize, and structure execution traces produced by instrumented programs (strace, ltrace), making them suitable for downstream analysis such as debugging, reproduction, or verification. It converts raw trace output into structured JSON format and provides tools for filtering, cleaning, and extracting relevant information.

Quick Start

Basic Workflow

  1. Parse raw traces - Convert strace/ltrace output to JSON
  2. Filter and clean - Remove noise and focus on relevant calls
  3. Extract debug info - Identify errors, file operations, network activity

Example: Debugging with strace

# 1. Capture trace
strace -o trace.txt python buggy_program.py

# 2. Parse to JSON
python scripts/parse_strace.py trace.txt -o trace.json --pretty

# 3. Extract errors
python scripts/extract_debug_info.py trace.json --category errors --pretty

# 4. Filter to relevant operations
python scripts/filter_trace.py trace.json --error-only --remove-noise -o filtered.json --pretty

Example: Analyzing library calls with ltrace

# 1. Capture trace
ltrace -o trace.txt ./program

# 2. Parse to JSON
python scripts/parse_ltrace.py trace.txt -o trace.json --pretty

# 3. Analyze specific functions
python scripts/filter_trace.py trace.json --include-calls "malloc,free,strlen" --pretty

Core Operations

1. Parsing Traces

Convert raw trace output to normalized JSON format.

For strace:

python scripts/parse_strace.py <input_file> [--output <output_file>] [--pretty]

For ltrace:

python scripts/parse_ltrace.py <input_file> [--output <output_file>] [--pretty]

Both parsers produce the same normalized JSON structure (see references/json_schema.md for details).

2. Filtering Traces

Remove noise and focus on relevant operations.

Common filtering operations:

# Show only errors
python scripts/filter_trace.py trace.json --error-only --pretty

# Remove common noise syscalls
python scripts/filter_trace.py trace.json --remove-noise --pretty

# Include specific calls
python scripts/filter_trace.py trace.json --include-calls "open,read,write,close" --pretty

# Exclude specific calls
python scripts/filter_trace.py trace.json --exclude-calls "gettimeofday,clock_gettime" --pretty

# Filter by argument pattern
python scripts/filter_trace.py trace.json --arg-pattern "config.json" --pretty

# Combine filters
python scripts/filter_trace.py trace.json --error-only --remove-noise --arg-pattern "/etc" -o filtered.json --pretty

3. Extracting Debug Information

Extract structured information for specific analysis tasks.

Extract all debug info:

python scripts/extract_debug_info.py trace.json --pretty

Extract specific categories:

# File operations only
python scripts/extract_debug_info.py trace.json --category file --pretty

# Network operations only
python scripts/extract_debug_info.py trace.json --category network --pretty

# Process operations only
python scripts/extract_debug_info.py trace.json --category process --pretty

# Errors only
python scripts/extract_debug_info.py trace.json --category errors --pretty

Use Cases

Bug Debugging

When debugging a failing program:

  1. Parse the trace to JSON
  2. Extract all errors to identify failure points
  3. Filter to relevant operations around the error
  4. Analyze file/network/process operations for root cause

See references/analysis_guide.md for detailed debugging patterns.

Test Case Reproduction

When reproducing a bug:

  1. Parse the trace from the failing execution
  2. Extract file operations to identify input dependencies
  3. Filter to the minimal sequence of operations
  4. Use the structured trace to reconstruct the execution environment

See references/analysis_guide.md for reproduction workflows.

Reference Documentation

  • references/trace_formats.md - Detailed documentation on strace and ltrace output formats, common syscalls, error codes
  • references/json_schema.md - Schema for normalized JSON output format
  • references/analysis_guide.md - Comprehensive guide on using traces for debugging and reproduction, including common patterns

Output Format

All tools produce JSON output following the normalized schema:

{
  "trace_type": "strace",
  "source_file": "trace.txt",
  "total_calls": 1234,
  "traces": [
    {
      "syscall": "open",
      "arguments": ["\"/etc/passwd\"", "O_RDONLY"],
      "return_value": "3",
      "line_number": 42,
      "raw_line": "open(\"/etc/passwd\", O_RDONLY) = 3"
    }
  ]
}

See assets/schema_template.json for the complete JSON schema definition.

Tips

  • Use --pretty flag for human-readable JSON output
  • Use --remove-noise to filter out common irrelevant syscalls
  • Combine multiple filters for focused analysis
  • Check references/analysis_guide.md for common debugging patterns
  • The line_number field preserves execution order for sequence analysis

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Applies abstract interpretation using different abstract domains (intervals, octagons, polyhedra, sign, congruence) to statically analyze program variables and infer invariants, value ranges, and relationships. Use when analyzing program properties, inferring loop invariants, detecting potential errors, or understanding variable relationships through static analysis.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

Uses abstract interpretation to automatically infer loop invariants, function preconditions, and postconditions for formal verification. Generates invariants that capture program behavior and support correctness proofs in Dafny, Isabelle, Coq, and other verification systems. Use when adding formal specifications to code, generating verification conditions, inferring contracts for functions, or discovering loop invariants for proofs.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

Performs abstract interpretation over source code to infer possible program states, variable ranges, and data properties without executing the program. Reports potential runtime errors including out-of-bounds accesses, null dereferences, type inconsistencies, division by zero, and integer overflows. Use when analyzing code for potential runtime errors, performing static analysis, checking safety properties, or verifying program behavior without execution.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

Performs abstract interpretation to produce summarized execution traces and high-level program behavior representations. Highlights key control flow paths, variable relationships, loop invariants, function summaries, and potential runtime states using abstract domains (intervals, signs, nullness, etc.). Use when analyzing program behavior, understanding execution paths, computing loop invariants, tracking variable ranges, detecting potential runtime errors, or generating program summaries without concrete execution.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

Create ACSL (ANSI/ISO C Specification Language) formal annotations for C/C++ programs. Use this skill when working with formal verification, adding function contracts (requires/ensures), loop invariants, assertions, memory safety annotations, or any ACSL specifications. Supports Frama-C verification and generates comprehensive formal specifications for C/C++ code.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

CLI-based browser automation with persistent page state using ref-based element interaction. Use when users ask to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

ArabelaTso のスキルをすべて見る

このスキルの問題を報告する