Skip to content

feat: Implement a query stack Backtrace analog#827

Merged
Veykril merged 1 commit into
salsa-rs:masterfrom
Veykril:veykril/push-rtzrurlyonzr
Apr 29, 2025
Merged

feat: Implement a query stack Backtrace analog#827
Veykril merged 1 commit into
salsa-rs:masterfrom
Veykril:veykril/push-rtzrurlyonzr

Conversation

@Veykril

@Veykril Veykril commented Apr 29, 2025

Copy link
Copy Markdown
Member

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

@netlify

netlify Bot commented Apr 29, 2025

Copy link
Copy Markdown

Deploy Preview for salsa-rs canceled.

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

@codspeed-hq

codspeed-hq Bot commented Apr 29, 2025

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #827 will not alter performance

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

Summary

✅ 12 untouched benchmarks

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

@MichaReiser MichaReiser Apr 29, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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

@MichaReiser MichaReiser left a comment

Copy link
Copy Markdown
Contributor

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

Veykril commented Apr 29, 2025

Copy link
Copy Markdown
Member Author

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)

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