Skip to content

[Concurrency] Add tracing for major operations in the concurrency runtime. #40070

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
Jan 11, 2022

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Nov 5, 2021

Each trace point is declared as a function in the new Tracing.h header. These functions are called from the appropriate places in the concurrency runtime.

On Darwin, an implementation of these functions is provided which uses the os/signpost.h API to emit signpost events/intervals.

When the signpost API is not available, no-op stub implementations are provided. Implementations for other OSes can be provided by providing implementations of the trace functions for that OS.

rdar://81858487

@mikeash mikeash force-pushed the concurrency-tracing branch 2 times, most recently from 36e0231 to 15be195 Compare November 8, 2021 21:12
@mikeash mikeash force-pushed the concurrency-tracing branch from 74203fa to 9f94ed0 Compare December 3, 2021 17:47
@mikeash mikeash marked this pull request as ready for review December 3, 2021 17:47
@mikeash mikeash changed the title WIP concurrency tracing support [Concurrency] Add tracing for major operations in the concurrency runtime. Dec 3, 2021
@mikeash mikeash force-pushed the concurrency-tracing branch 2 times, most recently from a7cba96 to a7352d2 Compare December 9, 2021 21:42
concurrency::trace::actor_state_changed( \
this, newState.FirstJob.getRawJob(), \
newState.FirstJob.needsPreprocessing(), \
newState.FirstJob.isOverride(), newState.Flags.getOpaqueValue()); \
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a goal that tracing makes any sense to anyone without knowledge of the current runtime implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not at this level. The goal is to get the info out in a compact and fast manner, and then interpreting it into something more sensible for a human reader is up to whatever receives it.

@mikeash mikeash force-pushed the concurrency-tracing branch 4 times, most recently from 1abb388 to cdae7ed Compare December 15, 2021 20:56
@mikeash
Copy link
Contributor Author

mikeash commented Dec 16, 2021

@swift-ci please test

@mikeash mikeash force-pushed the concurrency-tracing branch from cdae7ed to c18e9c1 Compare December 16, 2021 19:54
@mikeash
Copy link
Contributor Author

mikeash commented Dec 16, 2021

@swift-ci please test

@mikeash mikeash force-pushed the concurrency-tracing branch from c18e9c1 to dabfb25 Compare December 16, 2021 20:17
@mikeash
Copy link
Contributor Author

mikeash commented Dec 16, 2021

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - dabfb254260b99995b1b38559aaecfcf80d52267

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - dabfb254260b99995b1b38559aaecfcf80d52267

@mikeash mikeash force-pushed the concurrency-tracing branch from dabfb25 to d43301c Compare December 17, 2021 16:28
@mikeash
Copy link
Contributor Author

mikeash commented Dec 17, 2021

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - d43301cad24bafb6ea703b0ceaffacf3e10d37ee

@mikeash mikeash force-pushed the concurrency-tracing branch from d43301c to 653a7df Compare December 17, 2021 21:39
@mikeash
Copy link
Contributor Author

mikeash commented Dec 17, 2021

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 653a7df660a7a454dc1e836b51cecee2ee5383ed

@mikeash
Copy link
Contributor Author

mikeash commented Jan 5, 2022

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Jan 5, 2022

Build failed
Swift Test Linux Platform
Git Sha - 653a7df660a7a454dc1e836b51cecee2ee5383ed

@swift-ci
Copy link
Contributor

swift-ci commented Jan 5, 2022

Build failed
Swift Test OS X Platform
Git Sha - 653a7df660a7a454dc1e836b51cecee2ee5383ed

@mikeash mikeash force-pushed the concurrency-tracing branch from 653a7df to 028584b Compare January 6, 2022 21:56
@mikeash
Copy link
Contributor Author

mikeash commented Jan 6, 2022

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Jan 7, 2022

Build failed
Swift Test OS X Platform
Git Sha - 028584bc05efc754a36de765fdcff627faa9df1a

…time.

Each trace point is declared as a function in the new `Tracing.h` header. These functions are called from the appropriate places in the concurrency runtime.

On Darwin, an implementation of these functions is provided which uses the `os/signpost.h` API to emit signpost events/intervals.

When the signpost API is not available, no-op stub implementations are provided. Implementations for other OSes can be provided by providing implementations of the trace functions for that OS.

rdar://81858487
@mikeash mikeash force-pushed the concurrency-tracing branch from 028584b to 0977920 Compare January 7, 2022 16:35
@mikeash
Copy link
Contributor Author

mikeash commented Jan 7, 2022

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Jan 7, 2022

Build failed
Swift Test OS X Platform
Git Sha - 0977920

@mikeash
Copy link
Contributor Author

mikeash commented Jan 10, 2022

@swift-ci please test macOS platform

@mikeash mikeash merged commit e935692 into swiftlang:main Jan 11, 2022
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