Skip to content

feat: Implement a query stack Backtrace analog #827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Apr 29, 2025

Example output:

query stacktrace:
   0: query_e(Id(3)) -> (R1, Durability::LOW)
             at tests/backtrace.rs:30
   1: query_cycle(Id(3)) -> (R1, Durability::HIGH, iteration = 0)
             at tests/backtrace.rs:43
             cycle heads: query_cycle(Id(3)) -> 0
   2: query_f(Id(3)) -> (R1, Durability::HIGH)
             at tests/backtrace.rs:38

Copy link

netlify bot commented Apr 29, 2025

Deploy Preview for salsa-rs canceled.

Name Link
🔨 Latest commit aaf862c
🔍 Latest deploy log https://app.netlify.com/sites/salsa-rs/deploys/681103bb8ac4e10008cb0eab

Copy link

codspeed-hq bot commented Apr 29, 2025

CodSpeed Performance Report

Merging #827 will not alter performance

Comparing Veykril:veykril/push-rtzrurlyonzr (aaf862c) with master (b27e392)

Summary

✅ 12 untouched benchmarks

let backtrace = query_a(&db, Thing::new(&db, true)).replace("\\", "/");
expect![[r#"
query stacktrace:
0: query_a(Id(1)) -> (R1, Durability::HIGH)
Copy link
Contributor

@MichaReiser MichaReiser Apr 29, 2025

Choose a reason for hiding this comment

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

Wow, this is so useful that I sort of want this for non-panicks too :)

Copy link
Member Author

Choose a reason for hiding this comment

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

This is pretty nice actually

Copy link
Contributor

Choose a reason for hiding this comment

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

I find it more useful than most tracing we have in place today.

@Veykril Veykril force-pushed the veykril/push-rtzrurlyonzr branch from 0cddadd to fa0b2f2 Compare April 29, 2025 16:34
@Veykril Veykril marked this pull request as ready for review April 29, 2025 16:34
Copy link
Contributor

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

This is great!

@Veykril Veykril changed the title Implement a query stack Backtrace analog feat: Implement a query stack Backtrace analog Apr 29, 2025
@Veykril Veykril added this pull request to the merge queue Apr 29, 2025
@Veykril Veykril removed this pull request from the merge queue due to a manual request Apr 29, 2025
@Veykril Veykril force-pushed the veykril/push-rtzrurlyonzr branch from fa0b2f2 to aaf862c Compare April 29, 2025 16:52
@Veykril
Copy link
Member Author

Veykril commented Apr 29, 2025

Just noticed the order was reversed to what a normal backtrace would look like, fixed that just now (the stack top is now at position 0 like it is for normal backtraces)

@Veykril Veykril enabled auto-merge April 29, 2025 16:52
@Veykril Veykril added this pull request to the merge queue Apr 29, 2025
Merged via the queue into salsa-rs:master with commit 89347c8 Apr 29, 2025
11 checks passed
@Veykril Veykril deleted the veykril/push-rtzrurlyonzr branch April 29, 2025 17:11
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.

2 participants