Skip to content
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

runtime/trace: add missing events for the locked g in extra M. #54974

Closed
wants to merge 11 commits into from

Conversation

doujiang24
Copy link
Contributor

@doujiang24 doujiang24 commented Sep 9, 2022

Extra Ms may lead to the "no consistent ordering of events possible" error when parsing trace file with cgo enabled, since:

  1. The gs in the extra Ms may be in _Gdead status while starting trace by invoking runtime.StartTrace,
  2. and these gs will trigger traceEvGoSysExit events in runtime.exitsyscall when invoking go functions from c,
  3. then, the events of those gs are under non-consistent ordering, due to missing the previous events.

Add two events, traceEvGoCreate and traceEvGoInSyscall, in runtime.StartTrace, will make the trace parser happy.

Fixes #29707

@doujiang24 doujiang24 changed the title wip: runtime/trace: add missing events for the locked g in extra M. runtime/trace: add missing events for the locked g in extra M. Sep 9, 2022
@gopherbot
Copy link
Contributor

This PR (HEAD: 1af40a1) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/429858 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from DeJiang Zhu:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from hopehook:

Patch Set 1: Run-TryBot+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from hopehook:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 1: TryBot-Result-1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 2f65d45) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/429858 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from DeJiang Zhu (doujiang):

Patch Set 1: Code-Review+1

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 4814eee) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/429858 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Michael Pratt:

Patch Set 3: Run-TryBot+1

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 3:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 3: TryBot-Result-1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: ebe3b9f) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/429858 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from DeJiang Zhu (doujiang):

Patch Set 4: Code-Review+1

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from DeJiang Zhu (doujiang):

Patch Set 4:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Bryan Mills:

Patch Set 4: Code-Review+1

(4 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: a9a4e06) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/429858 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from DeJiang Zhu (doujiang):

Patch Set 5: Code-Review+1

(5 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from DeJiang Zhu (doujiang):

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from xie cui:

Patch Set 5: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 7bbfddb) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/429858 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from DeJiang Zhu (doujiang):

Patch Set 6: -Code-Review

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from xie cui:

Patch Set 6: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 6:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 6: TryBot-Result+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Michael Pratt:

Patch Set 6: Run-TryBot+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from DeJiang Zhu (doujiang):

Patch Set 6:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Michael Pratt:

Patch Set 6: Auto-Submit+1 Code-Review+2


Please don’t reply on this GitHub thread. Visit golang.org/cl/429858.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/429858 has been merged.

@gopherbot gopherbot closed this Sep 27, 2022
gopherbot pushed a commit that referenced this pull request Sep 27, 2022
Extra Ms may lead to the "no consistent ordering of events possible" error when parsing trace file with cgo enabled, since:
1. The gs in the extra Ms may be in `_Gdead` status while starting trace by invoking `runtime.StartTrace`,
2. and these gs will trigger `traceEvGoSysExit` events in `runtime.exitsyscall` when invoking go functions from c,
3. then, the events of those gs are under non-consistent ordering, due to missing the previous events.

Add two events, `traceEvGoCreate` and `traceEvGoInSyscall`, in `runtime.StartTrace`, will make the trace parser happy.

Fixes #29707

Change-Id: I2fd9d1713cda22f0ddb36efe1ab351f88da10881
GitHub-Last-Rev: 7bbfddb
GitHub-Pull-Request: #54974
Reviewed-on: https://go-review.googlesource.com/c/go/+/429858
Run-TryBot: Michael Pratt <[email protected]>
Reviewed-by: Michael Pratt <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
Run-TryBot: xie cui <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Auto-Submit: Michael Pratt <[email protected]>
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.

cmd/trace: "failed to parse trace: no consistent ordering of events possible"
2 participants