Skip to content

add cli options to generate perfetto trace#246

Open
UnamedRus wants to merge 7 commits intoazat:mainfrom
UnamedRus:cli
Open

add cli options to generate perfetto trace#246
UnamedRus wants to merge 7 commits intoazat:mainfrom
UnamedRus:cli

Conversation

@UnamedRus
Copy link
Copy Markdown

To simplify testing/debug of perfetto different versions
Also, idea is to make "chdig" as togo tool for making exports for research/debug purposes.

@azat azat self-assigned this Apr 21, 2026
@azat
Copy link
Copy Markdown
Owner

azat commented Apr 21, 2026

Also, idea is to make "chdig" as togo tool for making exports for research/debug purposes.

This is a very good idea, it will also allow to cover it with tests

@azat
Copy link
Copy Markdown
Owner

azat commented Apr 21, 2026

@UnamedRus CI failed, PTAL

Comment thread src/interpreter/clickhouse.rs Outdated
Copy link
Copy Markdown
Owner

@azat azat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything else I will look later

Comment thread src/interpreter/options.rs Outdated
Comment thread src/interpreter/options.rs Outdated
Comment thread src/interpreter/clickhouse.rs Outdated
Comment thread src/bin.rs Outdated
Comment thread src/bin.rs Outdated
Comment on lines +89 to +92
let mut builder = PerfettoTraceBuilder::new(
perfetto_options.per_server,
perfetto_options.text_log_android,
);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be passed from command line

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about those two.

IMO, android style logs should be enabled/used by default.

Per server track split also make sense, compared to not have it.
(Actually, in order to use TracePacketDefaults, there should/will be much more detailed sequences/tracks)

@azat
Copy link
Copy Markdown
Owner

azat commented Apr 22, 2026

@UnamedRus ping me once all comments will be resolved

Comment thread src/bin.rs Outdated
.view
.output
.clone()
.unwrap_or_else(|| "/tmp/chdig_perfetto.pftrace".to_string());
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this is not the default for cli option?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's "generic" option now, so hardcoding perfetto naming seems wrong.
Anyway, it set to ./ as default.

If it ./
for server level -> trace saved as ./server_perfetto_trace.pftrace
for query level ./query_id.pftrace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants