-
Notifications
You must be signed in to change notification settings - Fork 110
Fix: Correctly instrument newproc1 for Go 1.23+ parameter counts (#13188) #216
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
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
be77826
Fix: Correctly instrument newproc1 for Go 1.23+ parameter counts (#13…
zJiaJun a988dae
Fix: Correctly instrument newproc1 for Go 1.23+ parameter counts (#13…
zJiaJun 0d2546c
Fix: Correctly instrument newproc1 for Go 1.23+ parameter counts (#13…
zJiaJun a94ffa7
Fix: Correctly instrument newproc1 for Go 1.23+ parameter counts (#13…
zJiaJun b9f5abc
Fix: Correctly instrument newproc1 for Go 1.23+ parameter counts (#13…
zJiaJun 141b560
Fix: Correctly instrument newproc1 for Go 1.23+ parameter counts (#13…
zJiaJun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| home="$(cd "$(dirname $0)"; pwd)" | ||
| go build ${GO_BUILD_OPTS} -o cross-goroutine | ||
|
|
||
| ./cross-goroutine |
50 changes: 50 additions & 0 deletions
50
test/plugins/scenarios/cross-goroutine/config/excepted.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| segmentItems: | ||
| - serviceName: cross-goroutine | ||
| segmentSize: ge 1 | ||
| segments: | ||
| - segmentId: not null | ||
| spans: | ||
| - operationName: GET:/execute | ||
| parentSpanId: -1 | ||
| spanId: 0 | ||
| spanLayer: Http | ||
| startTime: nq 0 | ||
| endTime: nq 0 | ||
| componentId: 5004 | ||
| isError: false | ||
| spanType: Entry | ||
| peer: '' | ||
| skipAnalysis: false | ||
| tags: | ||
| - {key: http.method, value: GET} | ||
| - {key: url, value: 'service:8080/execute'} | ||
| - {key: status_code, value: '200'} | ||
| - operationName: testGoroutineLocalSpan | ||
| parentSpanId: 0 | ||
| spanId: 1 | ||
| spanLayer: Unknown | ||
| startTime: nq 0 | ||
| endTime: nq 0 | ||
| componentId: 0 | ||
| isError: false | ||
| spanType: Local | ||
| peer: '' | ||
| skipAnalysis: false | ||
| meterItems: [] | ||
| logItems: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| module test/plugins/scenarios/cross-goroutine | ||
|
|
||
| go 1.19 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| // Licensed to Apache Software Foundation (ASF) under one or more contributor | ||
| // license agreements. See the NOTICE file distributed with | ||
| // this work for additional information regarding copyright | ||
| // ownership. Apache Software Foundation (ASF) licenses this file to you under | ||
| // the Apache License, Version 2.0 (the "License"); you may | ||
| // not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| package main | ||
|
|
||
| import ( | ||
| "log" | ||
| "net/http" | ||
| "sync" | ||
| "time" | ||
|
|
||
| _ "github.com/apache/skywalking-go" | ||
| "github.com/apache/skywalking-go/toolkit/trace" | ||
| ) | ||
|
|
||
| func executeHandler(w http.ResponseWriter, r *http.Request) { | ||
| log.Println("Received request for /execute") | ||
| var wg sync.WaitGroup | ||
| wg.Add(1) | ||
| go func() { | ||
| defer wg.Done() | ||
| trace.CreateLocalSpan("testGoroutineLocalSpan") | ||
| time.Sleep(100 * time.Millisecond) | ||
| trace.StopSpan() | ||
| }() | ||
| wg.Wait() | ||
| log.Println("Goroutine finished, sending response") | ||
| w.WriteHeader(http.StatusOK) | ||
| _, _ = w.Write([]byte("success")) | ||
| } | ||
|
|
||
| func main() { | ||
| http.HandleFunc("/execute", executeHandler) | ||
| http.HandleFunc("/health", func(writer http.ResponseWriter, request *http.Request) { | ||
| writer.WriteHeader(http.StatusOK) | ||
| }) | ||
| _ = http.ListenAndServe(":8080", nil) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| entry-service: http://${HTTP_HOST}:${HTTP_PORT}/execute | ||
| health-checker: http://${HTTP_HOST}:${HTTP_PORT}/health | ||
| start-script: ./bin/startup.sh | ||
| framework: go | ||
| export-port: 8080 | ||
| support-version: | ||
| - go: 1.19 | ||
| - go: 1.20 | ||
| - go: 1.21 | ||
| - go: 1.22 | ||
| - go: 1.23 | ||
| - go: 1.24 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the PR description, for Go 1.23 and later, runtime.newproc1 should expect 2 parameters rather than 5. Please update the logic to set the expected parameter count to 2 for Go 1.23+.