This document explains every command-line flag currently supported by coroTracer, including:
- what it does
- its default value
- which mode it belongs to
- common flag combinations
- the most common points of confusion
Program entry point:
coroTracer currently has exactly two modes, and they are strictly mutually exclusive.
Triggered by -cmd.
This mode will:
- create shared memory
- create the Unix Domain Socket
- launch the target program
- harvest coroutine events
- write JSONL output
Minimal example:
./coroTracer -cmd "./your_target_app"Triggered by -export.
This mode will:
- read an already existing JSONL trace
- convert it into SQLite / MySQL / PostgreSQL / CSV
Minimal example:
./coroTracer -export sqlite -in trace.jsonlThis combination is not allowed:
./coroTracer -cmd "./your_target_app" -export sqliteThe current design is:
-cmdproduces JSONL-exportconsumes an existing JSONL
They are separate stages, not a single chained run.
| Flag | Default | Mode | Purpose |
|---|---|---|---|
-n |
128 |
trace | preallocated station count |
-cmd |
empty | trace | target command to launch and trace |
-shm |
/tmp/corotracer.shm |
trace | shared memory file path |
-sock |
/tmp/corotracer.sock |
trace | UDS path |
-out |
trace_output.jsonl |
trace | JSONL output path |
-export |
empty | export | export target type |
-in |
empty | export | input JSONL path; falls back to -out |
-sqlite-out |
empty | export | SQLite output path; defaults to <input>.sqlite |
-csv-out |
empty | export | CSV output path; defaults to <input>.csv |
-db-cli |
empty | export | override the default database CLI name |
-db-host |
127.0.0.1 |
export | MySQL / PostgreSQL host |
-db-port |
0 |
export | MySQL / PostgreSQL port; inferred by exporter type |
-db-user |
empty | export | database user |
-db-password |
empty | export | database password |
-db-name |
coro_tracer |
export | database name |
-db-table |
coro_trace_events |
export | table name |
-mysql-socket |
empty | export | MySQL Unix socket path |
-pg-maintenance-db |
postgres |
export | PostgreSQL maintenance database used for CREATE DATABASE |
-pg-sslmode |
empty | export | value forwarded through PGSSLMODE |
Default:
128
Purpose:
- sets how many stations are preallocated
- effectively defines the current upper collection capacity for coroutine tracking
Important note:
- one of the current known limitations is that capacity is still fixed and finite
- it is not dynamically growing
- if your coroutine population is substantially larger, you should raise this value explicitly
Example:
./coroTracer -n 512 -cmd "./your_target_app"Default:
empty
Purpose:
- specifies the target command that
coroTracershould launch and trace
Implementation detail:
- internally the program uses
sh -c - so commands with arguments work directly
Example:
./coroTracer -cmd "./server --threads 4 --config ./conf.yaml"Important:
- once
-cmdis present, the program is in trace mode - you may not also provide
-export
Default:
/tmp/corotracer.shm
Purpose:
- sets the shared-memory file path
Useful when:
- running multiple test instances in parallel
- the default path collides with another run
- you want the IPC files in a custom location
Example:
./coroTracer -cmd "./your_target_app" -shm /tmp/case1.shmDefault:
/tmp/corotracer.sock
Purpose:
- sets the UDS wakeup path
Useful when:
- running multiple instances in parallel
- the default path collides with something else
Example:
./coroTracer -cmd "./your_target_app" -sock /tmp/case1.sockDefault:
trace_output.jsonl
Purpose:
- sets the JSONL output file produced by trace collection
Example:
./coroTracer -cmd "./your_target_app" -out traces/run1.jsonlExtra note:
- in export-only mode, if
-inis omitted, the program falls back to the value of-out
Default:
empty
Purpose:
- selects the export type
Currently supported values:
sqlitemysqlpostgrespostgresqldataframecsv
Notes:
postgresandpostgresqlare equivalentdataframeandcsvare equivalent and both export CSV
Default:
empty
Purpose:
- sets the input JSONL file in export mode
Default behavior:
- if
-inis omitted, the program falls back to-out
For example:
./coroTracer -export sqlite -out trace.jsonlis effectively the same as:
./coroTracer -export sqlite -in trace.jsonlIn practice, using -in explicitly is clearer.
Default:
empty
Purpose:
- sets the SQLite database output path
Default behavior:
- if omitted, the program derives
<input>.sqlite
Example:
./coroTracer -export sqlite -in trace.jsonl -sqlite-out out/trace.sqliteRuntime dependency:
- a local
sqlite3binary is required
Default:
empty
Purpose:
- sets the CSV output path
Default behavior:
- if omitted, the program derives
<input>.csv
Example:
./coroTracer -export csv -in trace.jsonl -csv-out out/trace.csvGood downstream targets:
- pandas
- polars
- DuckDB
- R
Purpose:
- overrides the default database CLI command name
Default behavior:
- MySQL export uses
mysql - PostgreSQL export uses
psql
Default:
127.0.0.1
Purpose:
- sets the MySQL / PostgreSQL host
Default:
0
Actual default behavior:
- for MySQL export,
0becomes3306 - for PostgreSQL export,
0becomes5432
Purpose:
- sets the database user
Purpose:
- sets the database password
Notes:
- this is intended for the user's own database password
- MySQL forwards it through
MYSQL_PWD - PostgreSQL forwards it through
PGPASSWORD
Security note:
- a plaintext password may appear in shell history
Default:
coro_tracer
Purpose:
- sets the database name
Default:
coro_trace_events
Purpose:
- sets the destination table name
Default:
empty
Purpose:
- connects to MySQL over a Unix socket
Once set:
-db-hostand-db-portare ignored
Example:
./coroTracer \
-export mysql \
-in trace.jsonl \
-db-user root \
-db-password your_password \
-mysql-socket /tmp/mysql.sockRuntime dependency:
- a local
mysqlCLI is required
Default:
postgres
Purpose:
- when the target database does not exist, the program first connects to this maintenance database
- then it attempts
CREATE DATABASE
Default:
empty
Purpose:
- forwards a value through
PGSSLMODEtopsql
Common values:
disablerequireverify-caverify-full
Example:
./coroTracer \
-export postgresql \
-in trace.jsonl \
-db-user postgres \
-db-password your_password \
-pg-sslmode disableRuntime dependency:
- a local
psqlCLI is required
./coroTracer -cmd "./your_target_app"./coroTracer -n 512 -cmd "./your_target_app --threads 4" -out traces/run1.jsonl./coroTracer -export sqlite -in traces/run1.jsonl./coroTracer -export csv -in traces/run1.jsonl./coroTracer \
-export mysql \
-in traces/run1.jsonl \
-db-host 127.0.0.1 \
-db-port 3306 \
-db-user root \
-db-password your_password \
-db-name coro_tracer \
-db-table coro_trace_events./coroTracer \
-export postgresql \
-in traces/run1.jsonl \
-db-host 127.0.0.1 \
-db-port 5432 \
-db-user postgres \
-db-password your_password \
-db-name coro_tracer \
-db-table coro_trace_events \
-pg-sslmode disableNo. They are mutually exclusive modes.
No. It is much closer to the upper collection capacity for coroutine tracking.
In export mode the program falls back to the value of -out.
That is the current implementation tradeoff. The goal is to keep the repository's Go dependency set lightweight.