code-instrumentation-generator

Solid

Automatically instruments source code to collect runtime information such as function calls, branch decisions, variable values, and execution traces while preserving original program semantics. Use when users need to: (1) Add logging or tracing to code for debugging, (2) Collect runtime execution data for analysis, (3) Monitor function calls and control flow, (4) Track variable values during execution, (5) Generate execution traces for testing or profiling. Supports Python, Java, JavaScript, and C/C++ with configurable instrumentation levels.

Code & Development 160 stars 17 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 87/100

Stars 20%
73
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Code Instrumentation Generator Automatically instrument source code to collect runtime information while preserving program semantics. ## Workflow Follow these steps to instrument code: ### 1. Analyze the Source Code Understand the code structure and identify instrumentation points: - **Language detection**: Identify the programming language - **Code structure**: Parse functions, classes, branches, loops - **Entry/exit points**: Locate function boundaries - **Control flow**: Identify branches (if/else, switch, loops) - **Variable scope**: Understand variable declarations and usage ### 2. Determine Instrumentation Strategy Choose appropriate instrumentation based on requirements: **Instrumentation levels:** - **Function-level**: Entry/exit of functions with parameters and return values - **Branch-level**: Execution of conditional branches (if/else, switch cases) - **Statement-level**: Individual statement execution - **Variable-level**: Variable assignments and value changes **Configuration options:** - Enable/disable specific instrumentation types - Filter by function names or file patterns - Set verbosity level - Choose output format (logs, JSON, CSV) ### 3. Insert Instrumentation Code Add instrumentation hooks at identified points: **Function instrumentation:** - Insert entry hook at function start - Capture function name, parameters, timestamp - Insert exit hook before returns - Capture return value, execution time **Branch instrumentation:** - Insert hooks...

Details

Author
ArabelaTso
Repository
ArabelaTso/Skills-4-SE
Created
6 months ago
Last Updated
today
Language
Python
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category