diff --git a/LICENSES/go.opentelemetry.io/ebpf-profiler/LICENSE b/LICENSES/go.opentelemetry.io/ebpf-profiler/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/LICENSES/go.opentelemetry.io/ebpf-profiler/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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. diff --git a/Makefile b/Makefile index bccfdf4c..aecf159d 100644 --- a/Makefile +++ b/Makefile @@ -66,13 +66,23 @@ ebpf: $(MAKE) -j$(shell nproc) -C support/ebpf GOLANGCI_LINT_VERSION = "v1.60.1" -lint: generate +lint: generate vanity-import-check go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) version go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) run linter-version: @echo $(GOLANGCI_LINT_VERSION) +.PHONY: vanity-import-check +vanity-import-check: + @go install github.com/jcchavezs/porto/cmd/porto@latest + @porto --include-internal -l . || ( echo "(run: make vanity-import-fix)"; exit 1 ) + +.PHONY: vanity-import-fix +vanity-import-fix: $(PORTO) + @go install github.com/jcchavezs/porto/cmd/porto@latest + @porto --include-internal -w . + test: generate ebpf test-deps go test $(GO_FLAGS) ./... @@ -108,5 +118,5 @@ legal: @go-licenses save --force . --save_path=LICENSES @./legal/add-non-go.sh legal/non-go-dependencies.json LICENSES -codespell: +codespell: @codespell diff --git a/armhelpers/arm_helpers.go b/armhelpers/arm_helpers.go index 19d409b6..8065a07c 100644 --- a/armhelpers/arm_helpers.go +++ b/armhelpers/arm_helpers.go @@ -2,14 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 // This package contains a series of helper functions that are useful for ARM disassembly. -package armhelpers +package armhelpers // import "go.opentelemetry.io/ebpf-profiler/armhelpers" import ( "fmt" "strconv" "strings" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/stringutil" + "go.opentelemetry.io/ebpf-profiler/stringutil" aa "golang.org/x/arch/arm64/arm64asm" ) diff --git a/cli_flags.go b/cli_flags.go index b2d1f4d7..772907d3 100644 --- a/cli_flags.go +++ b/cli_flags.go @@ -12,7 +12,7 @@ import ( "github.com/peterbourgon/ff/v3" log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracer" + "go.opentelemetry.io/ebpf-profiler/tracer" ) const ( diff --git a/collector/factory.go b/collector/factory.go index a8814e3d..c7710957 100644 --- a/collector/factory.go +++ b/collector/factory.go @@ -12,7 +12,7 @@ import ( "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receiverprofiles" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/collector/internal" + "go.opentelemetry.io/ebpf-profiler/collector/internal" ) var ( diff --git a/collector/factory_test.go b/collector/factory_test.go index 6212d9d2..21fc8da3 100644 --- a/collector/factory_test.go +++ b/collector/factory_test.go @@ -7,11 +7,11 @@ import ( "context" "testing" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/collector/internal" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver/receivertest" + "go.opentelemetry.io/ebpf-profiler/collector/internal" ) func TestNewFactory(t *testing.T) { diff --git a/collector/internal/config.go b/collector/internal/config.go index 18f17b9e..7721159f 100644 --- a/collector/internal/config.go +++ b/collector/internal/config.go @@ -12,7 +12,7 @@ import ( "github.com/tklauser/numcpus" "go.opentelemetry.io/collector/component" - tracertypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracer/types" + tracertypes "go.opentelemetry.io/ebpf-profiler/tracer/types" ) const ( diff --git a/collector/internal/controller.go b/collector/internal/controller.go index 7bc94a29..1b45776f 100644 --- a/collector/internal/controller.go +++ b/collector/internal/controller.go @@ -14,13 +14,13 @@ import ( "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.uber.org/zap" - hostinfo "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/times" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracehandler" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracer" - tracertypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracer/types" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + hostinfo "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/times" + "go.opentelemetry.io/ebpf-profiler/tracehandler" + "go.opentelemetry.io/ebpf-profiler/tracer" + tracertypes "go.opentelemetry.io/ebpf-profiler/tracer/types" + "go.opentelemetry.io/ebpf-profiler/util" ) var ( diff --git a/collector/internal/helpers.go b/collector/internal/helpers.go index 86940381..d17de7cd 100644 --- a/collector/internal/helpers.go +++ b/collector/internal/helpers.go @@ -11,8 +11,8 @@ import ( "sync" "syscall" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracer" log "github.com/sirupsen/logrus" + "go.opentelemetry.io/ebpf-profiler/tracer" "github.com/jsimonetti/rtnetlink" "golang.org/x/sys/unix" diff --git a/go.mod b/go.mod index 6d5bd59e..97d112f7 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/open-telemetry/opentelemetry-ebpf-profiler +module go.opentelemetry.io/ebpf-profiler go 1.22.2 diff --git a/helpers.go b/helpers.go index 201da720..8dcdefa8 100644 --- a/helpers.go +++ b/helpers.go @@ -9,8 +9,8 @@ import ( "sync" "syscall" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracer" log "github.com/sirupsen/logrus" + "go.opentelemetry.io/ebpf-profiler/tracer" "github.com/jsimonetti/rtnetlink" "golang.org/x/sys/unix" diff --git a/host/host.go b/host/host.go index d4a38992..c12a02a3 100644 --- a/host/host.go +++ b/host/host.go @@ -2,14 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 // Package host implements types and methods specific to interacting with eBPF maps. -package host +package host // import "go.opentelemetry.io/ebpf-profiler/host" import ( "encoding/binary" "fmt" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/times" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/times" ) // TraceHash is used for unique identifiers for traces, and is required to be 64-bits diff --git a/hostmetadata/collector.go b/hostmetadata/collector.go index b63ed51c..8c95b7a5 100644 --- a/hostmetadata/collector.go +++ b/hostmetadata/collector.go @@ -1,13 +1,13 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package hostmetadata +package hostmetadata // import "go.opentelemetry.io/ebpf-profiler/hostmetadata" import ( "context" "time" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/reporter" ) // Collector implements host metadata collection and reporting diff --git a/interpreter/apmint/apmint.go b/interpreter/apmint/apmint.go index 108072a0..5a7a76a4 100644 --- a/interpreter/apmint/apmint.go +++ b/interpreter/apmint/apmint.go @@ -5,7 +5,7 @@ // libraries, establishes socket connections with them and notifies them about // the stack traces that we collected for their process. This allows the APM // agent to associate stack traces with APM traces / transactions / spans. -package apmint +package apmint // import "go.opentelemetry.io/ebpf-profiler/interpreter/apmint" import ( "encoding/hex" @@ -16,11 +16,11 @@ import ( log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/remotememory" ) // #include diff --git a/interpreter/apmint/socket.go b/interpreter/apmint/socket.go index 7c1879ed..f986fb4e 100644 --- a/interpreter/apmint/socket.go +++ b/interpreter/apmint/socket.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package apmint +package apmint // import "go.opentelemetry.io/ebpf-profiler/interpreter/apmint" import ( "bufio" @@ -18,9 +18,9 @@ import ( "golang.org/x/sys/unix" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/xsync" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/stringutil" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/xsync" + "go.opentelemetry.io/ebpf-profiler/stringutil" ) // sendSocket is the shared, unbound socket that we use for communication with diff --git a/interpreter/dotnet/cachingreader.go b/interpreter/dotnet/cachingreader.go index 95ccd1f1..a7e513b6 100644 --- a/interpreter/dotnet/cachingreader.go +++ b/interpreter/dotnet/cachingreader.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package dotnet +package dotnet // import "go.opentelemetry.io/ebpf-profiler/interpreter/dotnet" import ( "io" diff --git a/interpreter/dotnet/data.go b/interpreter/dotnet/data.go index 0064c4cc..cafd5098 100644 --- a/interpreter/dotnet/data.go +++ b/interpreter/dotnet/data.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package dotnet +package dotnet // import "go.opentelemetry.io/ebpf-profiler/interpreter/dotnet" import ( "fmt" @@ -11,9 +11,9 @@ import ( "github.com/elastic/go-freelru" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/remotememory" ) // #include "../../support/ebpf/types.h" diff --git a/interpreter/dotnet/dotnet.go b/interpreter/dotnet/dotnet.go index 971fb34f..7ef7c85e 100644 --- a/interpreter/dotnet/dotnet.go +++ b/interpreter/dotnet/dotnet.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package dotnet +package dotnet // import "go.opentelemetry.io/ebpf-profiler/interpreter/dotnet" // Microsoft .Net Unwinder support code @@ -106,8 +106,8 @@ import ( log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" ) const ( diff --git a/interpreter/dotnet/instance.go b/interpreter/dotnet/instance.go index 8b11aeff..8bbc0682 100644 --- a/interpreter/dotnet/instance.go +++ b/interpreter/dotnet/instance.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package dotnet +package dotnet // import "go.opentelemetry.io/ebpf-profiler/interpreter/dotnet" import ( "fmt" @@ -16,18 +16,18 @@ import ( "github.com/elastic/go-freelru" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/lpm" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - npsr "github.com/open-telemetry/opentelemetry-ebpf-profiler/nopanicslicereader" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/successfailurecounter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/lpm" + "go.opentelemetry.io/ebpf-profiler/metrics" + npsr "go.opentelemetry.io/ebpf-profiler/nopanicslicereader" + "go.opentelemetry.io/ebpf-profiler/process" + "go.opentelemetry.io/ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/successfailurecounter" + "go.opentelemetry.io/ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/util" ) // dotnet internal constants which have not changed through the current @@ -631,8 +631,16 @@ func (i *dotnetInstance) SynchronizeMappings(ebpf interpreter.EbpfHandler, open := func() (process.ReadAtCloser, error) { return os.Open(m.Path) } - symbolReporter.ExecutableMetadata(info.fileID, path.Base(m.Path), - info.guid, libpf.Dotnet, open) + symbolReporter.ExecutableMetadata( + &reporter.ExecutableMetadataArgs{ + FileID: info.fileID, + FileName: path.Base(m.Path), + GnuBuildID: info.guid, + DebuglinkFileName: "", + Interp: libpf.Dotnet, + Open: open, + }, + ) info.reported = true } diff --git a/interpreter/dotnet/method.go b/interpreter/dotnet/method.go index 86bbdd0a..2741aebe 100644 --- a/interpreter/dotnet/method.go +++ b/interpreter/dotnet/method.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package dotnet +package dotnet // import "go.opentelemetry.io/ebpf-profiler/interpreter/dotnet" import ( "bytes" @@ -10,7 +10,7 @@ import ( log "github.com/sirupsen/logrus" - npsr "github.com/open-telemetry/opentelemetry-ebpf-profiler/nopanicslicereader" + npsr "go.opentelemetry.io/ebpf-profiler/nopanicslicereader" ) type dotnetMethod struct { diff --git a/interpreter/dotnet/nativereader.go b/interpreter/dotnet/nativereader.go index 66091e28..4eddf126 100644 --- a/interpreter/dotnet/nativereader.go +++ b/interpreter/dotnet/nativereader.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package dotnet +package dotnet // import "go.opentelemetry.io/ebpf-profiler/interpreter/dotnet" import ( "encoding/binary" diff --git a/interpreter/dotnet/nibblereader.go b/interpreter/dotnet/nibblereader.go index 850c64fe..aa2e846b 100644 --- a/interpreter/dotnet/nibblereader.go +++ b/interpreter/dotnet/nibblereader.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package dotnet +package dotnet // import "go.opentelemetry.io/ebpf-profiler/interpreter/dotnet" import ( "errors" diff --git a/interpreter/dotnet/pe.go b/interpreter/dotnet/pe.go index fc17d8b2..292f012a 100644 --- a/interpreter/dotnet/pe.go +++ b/interpreter/dotnet/pe.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package dotnet +package dotnet // import "go.opentelemetry.io/ebpf-profiler/interpreter/dotnet" import ( "bytes" @@ -16,10 +16,10 @@ import ( "time" "github.com/elastic/go-freelru" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/readatbuf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/readatbuf" + "go.opentelemetry.io/ebpf-profiler/process" + "go.opentelemetry.io/ebpf-profiler/util" ) const ( diff --git a/interpreter/hotspot/data.go b/interpreter/hotspot/data.go index a8c307b3..4d4f7902 100644 --- a/interpreter/hotspot/data.go +++ b/interpreter/hotspot/data.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package hotspot +package hotspot // import "go.opentelemetry.io/ebpf-profiler/interpreter/hotspot" import ( "bytes" @@ -16,13 +16,13 @@ import ( "github.com/elastic/go-freelru" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/xsync" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/lpm" - npsr "github.com/open-telemetry/opentelemetry-ebpf-profiler/nopanicslicereader" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/libpf/xsync" + "go.opentelemetry.io/ebpf-profiler/lpm" + npsr "go.opentelemetry.io/ebpf-profiler/nopanicslicereader" + "go.opentelemetry.io/ebpf-profiler/remotememory" ) // hotspotIntrospectionTable contains the resolved ELF symbols for an introspection table diff --git a/interpreter/hotspot/demangle.go b/interpreter/hotspot/demangle.go index bd00e909..a4a1dd3e 100644 --- a/interpreter/hotspot/demangle.go +++ b/interpreter/hotspot/demangle.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package hotspot +package hotspot // import "go.opentelemetry.io/ebpf-profiler/interpreter/hotspot" import ( "io" diff --git a/interpreter/hotspot/hotspot.go b/interpreter/hotspot/hotspot.go index 90e2d1bc..3b8505b8 100644 --- a/interpreter/hotspot/hotspot.go +++ b/interpreter/hotspot/hotspot.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package hotspot +package hotspot // import "go.opentelemetry.io/ebpf-profiler/interpreter/hotspot" // Java HotSpot Unwinder support code (works also with Scala using HotSpot) @@ -110,8 +110,8 @@ import ( log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" ) var ( diff --git a/interpreter/hotspot/instance.go b/interpreter/hotspot/instance.go index c3e8e36c..9a80f15f 100644 --- a/interpreter/hotspot/instance.go +++ b/interpreter/hotspot/instance.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package hotspot +package hotspot // import "go.opentelemetry.io/ebpf-profiler/interpreter/hotspot" import ( "encoding/binary" @@ -17,18 +17,18 @@ import ( "github.com/elastic/go-freelru" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/lpm" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - npsr "github.com/open-telemetry/opentelemetry-ebpf-profiler/nopanicslicereader" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/successfailurecounter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/lpm" + "go.opentelemetry.io/ebpf-profiler/metrics" + npsr "go.opentelemetry.io/ebpf-profiler/nopanicslicereader" + "go.opentelemetry.io/ebpf-profiler/process" + "go.opentelemetry.io/ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/successfailurecounter" + "go.opentelemetry.io/ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/util" ) // #include "../../support/ebpf/types.h" diff --git a/interpreter/hotspot/instance_test.go b/interpreter/hotspot/instance_test.go index 57c25456..0854b227 100644 --- a/interpreter/hotspot/instance_test.go +++ b/interpreter/hotspot/instance_test.go @@ -10,11 +10,11 @@ import ( "testing" "github.com/elastic/go-freelru" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/lpm" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/lpm" + "go.opentelemetry.io/ebpf-profiler/remotememory" ) func TestJavaSymbolExtraction(t *testing.T) { diff --git a/interpreter/hotspot/method.go b/interpreter/hotspot/method.go index 95433fe9..a16c358f 100644 --- a/interpreter/hotspot/method.go +++ b/interpreter/hotspot/method.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package hotspot +package hotspot // import "go.opentelemetry.io/ebpf-profiler/interpreter/hotspot" import ( "bytes" @@ -9,9 +9,9 @@ import ( log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - npsr "github.com/open-telemetry/opentelemetry-ebpf-profiler/nopanicslicereader" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/libpf" + npsr "go.opentelemetry.io/ebpf-profiler/nopanicslicereader" + "go.opentelemetry.io/ebpf-profiler/reporter" ) // Constants for the JVM internals that have never changed diff --git a/interpreter/hotspot/recordingreader.go b/interpreter/hotspot/recordingreader.go index e8e6b881..a357a4ea 100644 --- a/interpreter/hotspot/recordingreader.go +++ b/interpreter/hotspot/recordingreader.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package hotspot +package hotspot // import "go.opentelemetry.io/ebpf-profiler/interpreter/hotspot" import ( "io" diff --git a/interpreter/hotspot/stubs.go b/interpreter/hotspot/stubs.go index 0ed24cf6..1f0e86b2 100644 --- a/interpreter/hotspot/stubs.go +++ b/interpreter/hotspot/stubs.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package hotspot +package hotspot // import "go.opentelemetry.io/ebpf-profiler/interpreter/hotspot" import ( "encoding/binary" @@ -10,10 +10,10 @@ import ( "sort" "strings" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/armhelpers" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/armhelpers" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/support" aa "golang.org/x/arch/arm64/arm64asm" log "github.com/sirupsen/logrus" diff --git a/interpreter/hotspot/unsigned5.go b/interpreter/hotspot/unsigned5.go index 342f5a30..9884beed 100644 --- a/interpreter/hotspot/unsigned5.go +++ b/interpreter/hotspot/unsigned5.go @@ -1,13 +1,13 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package hotspot +package hotspot // import "go.opentelemetry.io/ebpf-profiler/interpreter/hotspot" import ( "fmt" "io" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf" ) // unsigned5Decoder is a decoder for UNSIGNED5 based byte streams. diff --git a/interpreter/instancestubs.go b/interpreter/instancestubs.go index 41a0e879..6fb415c6 100644 --- a/interpreter/instancestubs.go +++ b/interpreter/instancestubs.go @@ -1,15 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package interpreter +package interpreter // import "go.opentelemetry.io/ebpf-profiler/interpreter" import ( - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tpbase" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/metrics" + "go.opentelemetry.io/ebpf-profiler/process" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/tpbase" ) // InstanceStubs provides empty implementations of Instance hooks that are diff --git a/interpreter/loaderinfo.go b/interpreter/loaderinfo.go index d2f3c01a..67b16df1 100644 --- a/interpreter/loaderinfo.go +++ b/interpreter/loaderinfo.go @@ -1,15 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package interpreter +package interpreter // import "go.opentelemetry.io/ebpf-profiler/interpreter" import ( "fmt" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/util" ) // LoaderInfo contains information about an ELF that is passed to diff --git a/interpreter/nodev8/v8.go b/interpreter/nodev8/v8.go index 6af38857..cf4a6103 100644 --- a/interpreter/nodev8/v8.go +++ b/interpreter/nodev8/v8.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package nodev8 +package nodev8 // import "go.opentelemetry.io/ebpf-profiler/interpreter/nodev8" // Google V8 JavaScript Virtual Machine unwinder // @@ -167,19 +167,19 @@ import ( "github.com/elastic/go-freelru" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/lpm" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - npsr "github.com/open-telemetry/opentelemetry-ebpf-profiler/nopanicslicereader" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/successfailurecounter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/lpm" + "go.opentelemetry.io/ebpf-profiler/metrics" + npsr "go.opentelemetry.io/ebpf-profiler/nopanicslicereader" + "go.opentelemetry.io/ebpf-profiler/process" + "go.opentelemetry.io/ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/successfailurecounter" + "go.opentelemetry.io/ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/util" ) // #include "../../support/ebpf/types.h" diff --git a/interpreter/perl/data.go b/interpreter/perl/data.go index 11278db2..fc36f280 100644 --- a/interpreter/perl/data.go +++ b/interpreter/perl/data.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package perl +package perl // import "go.opentelemetry.io/ebpf-profiler/interpreter/perl" import ( "fmt" @@ -10,11 +10,11 @@ import ( "github.com/elastic/go-freelru" log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/support" ) // #include "../../support/ebpf/types.h" diff --git a/interpreter/perl/instance.go b/interpreter/perl/instance.go index 87f95826..7c0fdc46 100644 --- a/interpreter/perl/instance.go +++ b/interpreter/perl/instance.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package perl +package perl // import "go.opentelemetry.io/ebpf-profiler/interpreter/perl" import ( "errors" @@ -15,16 +15,16 @@ import ( "github.com/elastic/go-freelru" log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - npsr "github.com/open-telemetry/opentelemetry-ebpf-profiler/nopanicslicereader" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/successfailurecounter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tpbase" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/metrics" + npsr "go.opentelemetry.io/ebpf-profiler/nopanicslicereader" + "go.opentelemetry.io/ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/successfailurecounter" + "go.opentelemetry.io/ebpf-profiler/tpbase" + "go.opentelemetry.io/ebpf-profiler/util" ) // #include "../../support/ebpf/types.h" diff --git a/interpreter/perl/perl.go b/interpreter/perl/perl.go index 8c4c1859..f3f7108e 100644 --- a/interpreter/perl/perl.go +++ b/interpreter/perl/perl.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package perl +package perl // import "go.opentelemetry.io/ebpf-profiler/interpreter/perl" // Perl interpreter unwinder @@ -49,7 +49,7 @@ import ( "debug/elf" "regexp" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/interpreter" ) //nolint:golint,stylecheck,revive diff --git a/interpreter/php/decode_amd64.go b/interpreter/php/decode_amd64.go index 9a633784..4e1bf0f1 100644 --- a/interpreter/php/decode_amd64.go +++ b/interpreter/php/decode_amd64.go @@ -3,14 +3,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package php +package php // import "go.opentelemetry.io/ebpf-profiler/interpreter/php" import ( "fmt" "unsafe" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - _ "github.com/open-telemetry/opentelemetry-ebpf-profiler/zydis" // links Zydis + "go.opentelemetry.io/ebpf-profiler/libpf" + _ "go.opentelemetry.io/ebpf-profiler/zydis" // links Zydis ) // #cgo CFLAGS: -g -Wall diff --git a/interpreter/php/decode_arm64.go b/interpreter/php/decode_arm64.go index 59c440fb..52ec88e1 100644 --- a/interpreter/php/decode_arm64.go +++ b/interpreter/php/decode_arm64.go @@ -3,14 +3,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package php +package php // import "go.opentelemetry.io/ebpf-profiler/interpreter/php" import ( "errors" "fmt" - ah "github.com/open-telemetry/opentelemetry-ebpf-profiler/armhelpers" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + ah "go.opentelemetry.io/ebpf-profiler/armhelpers" + "go.opentelemetry.io/ebpf-profiler/libpf" aa "golang.org/x/arch/arm64/arm64asm" ) diff --git a/interpreter/php/instance.go b/interpreter/php/instance.go index 6f3d2dfa..1dc49575 100644 --- a/interpreter/php/instance.go +++ b/interpreter/php/instance.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package php +package php // import "go.opentelemetry.io/ebpf-profiler/interpreter/php" import ( "errors" @@ -13,15 +13,15 @@ import ( "github.com/elastic/go-freelru" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - npsr "github.com/open-telemetry/opentelemetry-ebpf-profiler/nopanicslicereader" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/successfailurecounter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/metrics" + npsr "go.opentelemetry.io/ebpf-profiler/nopanicslicereader" + "go.opentelemetry.io/ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/successfailurecounter" + "go.opentelemetry.io/ebpf-profiler/util" ) //nolint:golint,stylecheck,revive diff --git a/interpreter/php/opcache.go b/interpreter/php/opcache.go index 44149716..8bf435e2 100644 --- a/interpreter/php/opcache.go +++ b/interpreter/php/opcache.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package php +package php // import "go.opentelemetry.io/ebpf-profiler/interpreter/php" //nolint:lll // PHP8+ JIT compiler unwinder. @@ -122,15 +122,15 @@ import ( log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/lpm" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/lpm" + "go.opentelemetry.io/ebpf-profiler/process" + "go.opentelemetry.io/ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/util" ) var ( diff --git a/interpreter/php/php.go b/interpreter/php/php.go index 07609800..f7d9b8d3 100644 --- a/interpreter/php/php.go +++ b/interpreter/php/php.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package php +package php // import "go.opentelemetry.io/ebpf-profiler/interpreter/php" import ( "bytes" @@ -15,11 +15,11 @@ import ( "github.com/elastic/go-freelru" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/support" ) // #include "../../support/ebpf/types.h" diff --git a/interpreter/python/decode.go b/interpreter/python/decode.go index 7a97b57e..9412aa59 100644 --- a/interpreter/python/decode.go +++ b/interpreter/python/decode.go @@ -1,13 +1,13 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package python +package python // import "go.opentelemetry.io/ebpf-profiler/interpreter/python" import ( - ah "github.com/open-telemetry/opentelemetry-ebpf-profiler/armhelpers" + ah "go.opentelemetry.io/ebpf-profiler/armhelpers" aa "golang.org/x/arch/arm64/arm64asm" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf" ) // decodeStubArgumentWrapperARM64 disassembles arm64 code and decodes the assumed value diff --git a/interpreter/python/decode_amd64.go b/interpreter/python/decode_amd64.go index 804246cd..55080f24 100644 --- a/interpreter/python/decode_amd64.go +++ b/interpreter/python/decode_amd64.go @@ -3,13 +3,13 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package python +package python // import "go.opentelemetry.io/ebpf-profiler/interpreter/python" import ( "unsafe" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - _ "github.com/open-telemetry/opentelemetry-ebpf-profiler/zydis" // links Zydis + "go.opentelemetry.io/ebpf-profiler/libpf" + _ "go.opentelemetry.io/ebpf-profiler/zydis" // links Zydis ) // #cgo CFLAGS: -g -Wall diff --git a/interpreter/python/decode_arm64.go b/interpreter/python/decode_arm64.go index 2434ac00..a2461af1 100644 --- a/interpreter/python/decode_arm64.go +++ b/interpreter/python/decode_arm64.go @@ -3,10 +3,10 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package python +package python // import "go.opentelemetry.io/ebpf-profiler/interpreter/python" import ( - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf" ) func decodeStubArgumentWrapper(code []byte, argNumber uint8, symbolValue, diff --git a/interpreter/python/decode_test.go b/interpreter/python/decode_test.go index c8cc97a1..96ae9dab 100644 --- a/interpreter/python/decode_test.go +++ b/interpreter/python/decode_test.go @@ -6,8 +6,8 @@ package python import ( "testing" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" "github.com/stretchr/testify/assert" + "go.opentelemetry.io/ebpf-profiler/libpf" ) func TestAnalyzeArm64Stubs(t *testing.T) { diff --git a/interpreter/python/python.go b/interpreter/python/python.go index 874de3b7..31eb0cd3 100644 --- a/interpreter/python/python.go +++ b/interpreter/python/python.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package python +package python // import "go.opentelemetry.io/ebpf-profiler/interpreter/python" import ( "bytes" @@ -21,18 +21,18 @@ import ( "github.com/elastic/go-freelru" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - npsr "github.com/open-telemetry/opentelemetry-ebpf-profiler/nopanicslicereader" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/successfailurecounter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tpbase" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/metrics" + npsr "go.opentelemetry.io/ebpf-profiler/nopanicslicereader" + "go.opentelemetry.io/ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/successfailurecounter" + "go.opentelemetry.io/ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/tpbase" + "go.opentelemetry.io/ebpf-profiler/util" ) // #include diff --git a/interpreter/ruby/ruby.go b/interpreter/ruby/ruby.go index 7c235c79..48d14adb 100644 --- a/interpreter/ruby/ruby.go +++ b/interpreter/ruby/ruby.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package ruby +package ruby // import "go.opentelemetry.io/ebpf-profiler/interpreter/ruby" import ( "encoding/binary" @@ -20,17 +20,17 @@ import ( "github.com/elastic/go-freelru" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/hash" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/successfailurecounter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/hash" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/metrics" + "go.opentelemetry.io/ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/successfailurecounter" + "go.opentelemetry.io/ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/util" ) // #include "../../support/ebpf/types.h" diff --git a/interpreter/types.go b/interpreter/types.go index 37766655..3513dfd5 100644 --- a/interpreter/types.go +++ b/interpreter/types.go @@ -1,21 +1,21 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package interpreter +package interpreter // import "go.opentelemetry.io/ebpf-profiler/interpreter" import ( "errors" "unsafe" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/lpm" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tpbase" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/lpm" + "go.opentelemetry.io/ebpf-profiler/metrics" + "go.opentelemetry.io/ebpf-profiler/process" + "go.opentelemetry.io/ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/tpbase" + "go.opentelemetry.io/ebpf-profiler/util" ) const ( diff --git a/libpf/address.go b/libpf/address.go index 1d7a27fc..023155b9 100644 --- a/libpf/address.go +++ b/libpf/address.go @@ -1,9 +1,9 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package libpf +package libpf // import "go.opentelemetry.io/ebpf-profiler/libpf" -import "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/hash" +import "go.opentelemetry.io/ebpf-profiler/libpf/hash" // Address represents an address, or offset within a process type Address uintptr diff --git a/libpf/apm.go b/libpf/apm.go index 40f2fd75..903316b0 100644 --- a/libpf/apm.go +++ b/libpf/apm.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package libpf +package libpf // import "go.opentelemetry.io/ebpf-profiler/libpf" type APMSpanID [8]byte type APMTraceID [16]byte diff --git a/libpf/basehash/basehash.go b/libpf/basehash/basehash.go index 144e7f4b..a16b7e1e 100644 --- a/libpf/basehash/basehash.go +++ b/libpf/basehash/basehash.go @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // Package basehash provides basic types to implement hash identifiers. -package basehash +package basehash // import "go.opentelemetry.io/ebpf-profiler/libpf/basehash" import ( "fmt" diff --git a/libpf/basehash/hash128.go b/libpf/basehash/hash128.go index 43f3b5ed..5e093243 100644 --- a/libpf/basehash/hash128.go +++ b/libpf/basehash/hash128.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package basehash +package basehash // import "go.opentelemetry.io/ebpf-profiler/libpf/basehash" import ( "encoding" diff --git a/libpf/basehash/hash64.go b/libpf/basehash/hash64.go index 01b2c905..1709511e 100644 --- a/libpf/basehash/hash64.go +++ b/libpf/basehash/hash64.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package basehash +package basehash // import "go.opentelemetry.io/ebpf-profiler/libpf/basehash" import ( "encoding/json" diff --git a/libpf/convenience.go b/libpf/convenience.go index 0c327ef6..02c7cae1 100644 --- a/libpf/convenience.go +++ b/libpf/convenience.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package libpf +package libpf // import "go.opentelemetry.io/ebpf-profiler/libpf" import ( "context" diff --git a/libpf/convenience_test.go b/libpf/convenience_test.go index b37b4740..1fd7a74f 100644 --- a/libpf/convenience_test.go +++ b/libpf/convenience_test.go @@ -6,7 +6,7 @@ package libpf import ( "testing" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/util" "github.com/stretchr/testify/assert" ) diff --git a/libpf/fileid.go b/libpf/fileid.go index f498b371..f58a07a9 100644 --- a/libpf/fileid.go +++ b/libpf/fileid.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package libpf +package libpf // import "go.opentelemetry.io/ebpf-profiler/libpf" import ( "bytes" @@ -15,7 +15,7 @@ import ( "os" sha256 "github.com/minio/sha256-simd" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/basehash" + "go.opentelemetry.io/ebpf-profiler/libpf/basehash" ) // FileID is used for unique identifiers for files diff --git a/libpf/frameid.go b/libpf/frameid.go index 006c6b51..8905d306 100644 --- a/libpf/frameid.go +++ b/libpf/frameid.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package libpf +package libpf // import "go.opentelemetry.io/ebpf-profiler/libpf" import ( "encoding/base64" diff --git a/libpf/frametype.go b/libpf/frametype.go index 56345072..cc3cf045 100644 --- a/libpf/frametype.go +++ b/libpf/frametype.go @@ -1,12 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package libpf +package libpf // import "go.opentelemetry.io/ebpf-profiler/libpf" import ( "fmt" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/support" ) // FrameType defines the type of frame. This usually corresponds to the interpreter type that diff --git a/libpf/generics.go b/libpf/generics.go index 2a472f19..6a57009d 100644 --- a/libpf/generics.go +++ b/libpf/generics.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package libpf +package libpf // import "go.opentelemetry.io/ebpf-profiler/libpf" // Set is a convenience alias for a map with a `Void` key. type Set[T comparable] map[T]Void diff --git a/libpf/hash/hash.go b/libpf/hash/hash.go index a72a8322..21819d83 100644 --- a/libpf/hash/hash.go +++ b/libpf/hash/hash.go @@ -3,7 +3,7 @@ // Package hash provides the same hash primitives as used by the eBPF. // This file should be kept in sync with the eBPF tracemgmt.h. -package hash +package hash // import "go.opentelemetry.io/ebpf-profiler/libpf/hash" // Uint32 computes a hash of a 32-bit uint using the finalizer function for Murmur. // 32-bit via https://en.wikipedia.org/wiki/MurmurHash#Algorithm diff --git a/libpf/interpretertype.go b/libpf/interpretertype.go index 48db6474..5bbca6ca 100644 --- a/libpf/interpretertype.go +++ b/libpf/interpretertype.go @@ -1,9 +1,9 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package libpf +package libpf // import "go.opentelemetry.io/ebpf-profiler/libpf" -import "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" +import "go.opentelemetry.io/ebpf-profiler/support" // InterpreterType variables can hold one of the interpreter type values defined below. type InterpreterType int diff --git a/libpf/libpf.go b/libpf/libpf.go index 42f0a95f..653d9ef5 100644 --- a/libpf/libpf.go +++ b/libpf/libpf.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package libpf +package libpf // import "go.opentelemetry.io/ebpf-profiler/libpf" import ( "encoding/json" diff --git a/libpf/pfelf/addressmapper.go b/libpf/pfelf/addressmapper.go index e7488d2b..86511e9a 100644 --- a/libpf/pfelf/addressmapper.go +++ b/libpf/pfelf/addressmapper.go @@ -3,7 +3,7 @@ // package pfelf implements functions for processing of ELF files and extracting data from // them. This file provides a cacheable file offset to virtual address mapping. -package pfelf +package pfelf // import "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" import ( "debug/elf" diff --git a/libpf/pfelf/addressmapper_test.go b/libpf/pfelf/addressmapper_test.go index 2d8bd7c5..23713da2 100644 --- a/libpf/pfelf/addressmapper_test.go +++ b/libpf/pfelf/addressmapper_test.go @@ -7,9 +7,9 @@ import ( "os" "testing" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/testsupport" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.opentelemetry.io/ebpf-profiler/testsupport" ) func assertFileToVA(t *testing.T, mapper AddressMapper, fileAddress, virtualAddress uint64) { diff --git a/libpf/pfelf/elfopener.go b/libpf/pfelf/elfopener.go index 867d2590..16beca6c 100644 --- a/libpf/pfelf/elfopener.go +++ b/libpf/pfelf/elfopener.go @@ -4,7 +4,7 @@ // package pfelf implements functions for processing of ELF files and extracting data from // them. This file implements an interface to open ELF files from arbitrary location with name. -package pfelf +package pfelf // import "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" // ELFOpener is the interface to open ELF files from arbitrary location with given filename. // diff --git a/libpf/pfelf/file.go b/libpf/pfelf/file.go index 361b975e..538884e1 100644 --- a/libpf/pfelf/file.go +++ b/libpf/pfelf/file.go @@ -17,7 +17,7 @@ // - DT_GNU_HASH symbol index: https://flapenguin.me/elf-dt-gnu-hash // - NT_FILE coredump mappings: https://www.gabriel.urdhr.fr/2015/05/29/core-file/ -package pfelf +package pfelf // import "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" import ( "bytes" @@ -32,9 +32,9 @@ import ( "syscall" "unsafe" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/readatbuf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/readatbuf" + "go.opentelemetry.io/ebpf-profiler/remotememory" ) const ( @@ -113,6 +113,12 @@ type File struct { Type elf.Type Machine elf.Machine Entry uint64 + + // Path to the debuglink exe, + // or empty if none exists + debuglinkPath string + // Whether we have checked for a debuglink + debuglinkChecked bool } var _ libpf.SymbolFinder = &File{} @@ -483,6 +489,18 @@ func (f *File) GetBuildID() (string, error) { return getBuildIDFromNotes(data) } +// DebuglinkFileName returns the debug file linked by .gnu_debuglink if any +func (f *File) DebuglinkFileName(elfFilePath string, elfOpener ELFOpener) string { + if f.debuglinkChecked { + return f.debuglinkPath + } + file, path := f.OpenDebugLink(elfFilePath, elfOpener) + if file != nil { + file.Close() + } + return path +} + // TLSDescriptors returns a map of all TLS descriptor symbol -> address // mappings in the executable. func (f *File) TLSDescriptors() (map[string]libpf.Address, error) { @@ -590,6 +608,7 @@ func (f *File) GetDebugLink() (linkName string, crc int32, err error) { // OpenDebugLink tries to locate and open the corresponding debug ELF for this DSO. func (f *File) OpenDebugLink(elfFilePath string, elfOpener ELFOpener) ( debugELF *File, debugFile string) { + f.debuglinkChecked = true // Get the debug link linkName, linkCRC32, err := f.GetDebugLink() if err != nil { @@ -605,15 +624,12 @@ func (f *File) OpenDebugLink(elfFilePath string, elfOpener ELFOpener) ( if err != nil { continue } - if debugELF.Section(".debug_frame") == nil { - debugELF.Close() - continue - } fileCRC32, err := debugELF.CRC32() if err != nil || fileCRC32 != linkCRC32 { debugELF.Close() continue } + f.debuglinkPath = debugFile return debugELF, debugFile } return diff --git a/libpf/pfelf/file_test.go b/libpf/pfelf/file_test.go index 94910e25..5da84019 100644 --- a/libpf/pfelf/file_test.go +++ b/libpf/pfelf/file_test.go @@ -7,11 +7,11 @@ import ( "os" "testing" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/testsupport" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.opentelemetry.io/ebpf-profiler/testsupport" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf" ) func getPFELF(path string, t *testing.T) *File { diff --git a/libpf/pfelf/pfelf.go b/libpf/pfelf/pfelf.go index ea2e7976..c3c66e08 100644 --- a/libpf/pfelf/pfelf.go +++ b/libpf/pfelf/pfelf.go @@ -3,7 +3,7 @@ // package pfelf implements functions for processing of ELF files and extracting data from // them. This file provides convenience functions for golang debug/elf standard library. -package pfelf +package pfelf // import "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" import ( "bytes" @@ -17,7 +17,7 @@ import ( "regexp" "strings" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf" ) // SafeOpenELF opens the given ELF file in a safely way in that diff --git a/libpf/pfelf/pfelf_test.go b/libpf/pfelf/pfelf_test.go index 7260e542..4d5b4231 100644 --- a/libpf/pfelf/pfelf_test.go +++ b/libpf/pfelf/pfelf_test.go @@ -9,12 +9,12 @@ import ( "os" "testing" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/testsupport" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.opentelemetry.io/ebpf-profiler/testsupport" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" ) var ( diff --git a/libpf/pfelf/reference.go b/libpf/pfelf/reference.go index 29576504..5a40f2fb 100644 --- a/libpf/pfelf/reference.go +++ b/libpf/pfelf/reference.go @@ -4,7 +4,7 @@ // package pfelf implements functions for processing of ELF files and extracting data from // them. This file implements Reference which opens and caches a File on demand. -package pfelf +package pfelf // import "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" // Reference is a reference to an ELF file which is loaded and cached on demand. type Reference struct { diff --git a/libpf/pid.go b/libpf/pid.go index 6a784277..168a2d16 100644 --- a/libpf/pid.go +++ b/libpf/pid.go @@ -1,4 +1,4 @@ -package libpf +package libpf // import "go.opentelemetry.io/ebpf-profiler/libpf" // PID represent Unix Process ID (pid_t) type PID uint32 diff --git a/libpf/readatbuf/readatbuf.go b/libpf/readatbuf/readatbuf.go index bee070b3..0955e527 100644 --- a/libpf/readatbuf/readatbuf.go +++ b/libpf/readatbuf/readatbuf.go @@ -3,7 +3,7 @@ // readatbuf providers wrappers adding caching to types that implement the `ReaderAt` interface. -package readatbuf +package readatbuf // import "go.opentelemetry.io/ebpf-profiler/libpf/readatbuf" import ( "errors" @@ -12,7 +12,7 @@ import ( lru "github.com/elastic/go-freelru" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/hash" + "go.opentelemetry.io/ebpf-profiler/libpf/hash" ) // page represents a cached region from the underlying reader. diff --git a/libpf/readatbuf/readatbuf_test.go b/libpf/readatbuf/readatbuf_test.go index 78b3ef1f..b3d38e70 100644 --- a/libpf/readatbuf/readatbuf_test.go +++ b/libpf/readatbuf/readatbuf_test.go @@ -7,9 +7,9 @@ import ( "bytes" "testing" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/readatbuf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/testsupport" "github.com/stretchr/testify/require" + "go.opentelemetry.io/ebpf-profiler/libpf/readatbuf" + "go.opentelemetry.io/ebpf-profiler/testsupport" ) func testVariant(t *testing.T, fileSize, granularity, cacheSize uint) { diff --git a/libpf/symbol.go b/libpf/symbol.go index 38366007..af8802d9 100644 --- a/libpf/symbol.go +++ b/libpf/symbol.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package libpf +package libpf // import "go.opentelemetry.io/ebpf-profiler/libpf" import ( "fmt" diff --git a/libpf/trace.go b/libpf/trace.go index da17fd57..9a8aaa24 100644 --- a/libpf/trace.go +++ b/libpf/trace.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package libpf +package libpf // import "go.opentelemetry.io/ebpf-profiler/libpf" // Trace represents a stack trace. Each tuple (Files[i], Linenos[i]) represents a // stack frame via the file ID and line number at the offset i in the trace. The diff --git a/libpf/tracehash.go b/libpf/tracehash.go index 4b104def..71d1df22 100644 --- a/libpf/tracehash.go +++ b/libpf/tracehash.go @@ -1,13 +1,13 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package libpf +package libpf // import "go.opentelemetry.io/ebpf-profiler/libpf" import ( "encoding" "encoding/base64" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/basehash" + "go.opentelemetry.io/ebpf-profiler/libpf/basehash" ) // TraceHash represents the unique hash of a trace diff --git a/libpf/xsync/doc.go b/libpf/xsync/doc.go index 4bddded5..67385902 100644 --- a/libpf/xsync/doc.go +++ b/libpf/xsync/doc.go @@ -3,4 +3,4 @@ // Package xsync provides thin wrappers around locking primitives in an effort towards better // documenting the relationship between locks and the data they protect. -package xsync +package xsync // import "go.opentelemetry.io/ebpf-profiler/libpf/xsync" diff --git a/libpf/xsync/once.go b/libpf/xsync/once.go index 61e28ddb..d1706f06 100644 --- a/libpf/xsync/once.go +++ b/libpf/xsync/once.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package xsync +package xsync // import "go.opentelemetry.io/ebpf-profiler/libpf/xsync" import ( "sync" diff --git a/libpf/xsync/once_test.go b/libpf/xsync/once_test.go index 13a34cce..16ebb03d 100644 --- a/libpf/xsync/once_test.go +++ b/libpf/xsync/once_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/xsync" + "go.opentelemetry.io/ebpf-profiler/libpf/xsync" ) func TestOnceLock(t *testing.T) { diff --git a/libpf/xsync/rwlock.go b/libpf/xsync/rwlock.go index a9453f1c..8ff3c415 100644 --- a/libpf/xsync/rwlock.go +++ b/libpf/xsync/rwlock.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package xsync +package xsync // import "go.opentelemetry.io/ebpf-profiler/libpf/xsync" import "sync" diff --git a/libpf/xsync/rwlock_test.go b/libpf/xsync/rwlock_test.go index fd0c0293..50e379db 100644 --- a/libpf/xsync/rwlock_test.go +++ b/libpf/xsync/rwlock_test.go @@ -8,8 +8,8 @@ import ( "sync/atomic" "testing" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/xsync" "github.com/stretchr/testify/assert" + "go.opentelemetry.io/ebpf-profiler/libpf/xsync" ) type SharedResourceMutable struct { diff --git a/lpm/lpm.go b/lpm/lpm.go index c70eb596..987b65f6 100644 --- a/lpm/lpm.go +++ b/lpm/lpm.go @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // lpm package provides helpers for calculating prefix lists from ranges -package lpm +package lpm // import "go.opentelemetry.io/ebpf-profiler/lpm" import ( "fmt" diff --git a/maccess/maccess.go b/maccess/maccess.go index 9a08da93..9b15bb33 100644 --- a/maccess/maccess.go +++ b/maccess/maccess.go @@ -9,4 +9,4 @@ // https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d319f344561de23e810515d109c7278919bff7b0 // //nolint:lll -package maccess +package maccess // import "go.opentelemetry.io/ebpf-profiler/maccess" diff --git a/maccess/maccess_amd64.go b/maccess/maccess_amd64.go index 7345debb..c701c8a4 100644 --- a/maccess/maccess_amd64.go +++ b/maccess/maccess_amd64.go @@ -3,7 +3,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package maccess +package maccess // import "go.opentelemetry.io/ebpf-profiler/maccess" import ( "bytes" diff --git a/maccess/maccess_arm64.go b/maccess/maccess_arm64.go index e9155d23..7b68b984 100644 --- a/maccess/maccess_arm64.go +++ b/maccess/maccess_arm64.go @@ -3,12 +3,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package maccess +package maccess // import "go.opentelemetry.io/ebpf-profiler/maccess" import ( "errors" - ah "github.com/open-telemetry/opentelemetry-ebpf-profiler/armhelpers" + ah "go.opentelemetry.io/ebpf-profiler/armhelpers" aa "golang.org/x/arch/arm64/arm64asm" ) diff --git a/main.go b/main.go index 92b6594a..f5d40f95 100644 --- a/main.go +++ b/main.go @@ -18,20 +18,20 @@ import ( "github.com/tklauser/numcpus" "golang.org/x/sys/unix" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/times" - tracertypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracer/types" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/vc" + "go.opentelemetry.io/ebpf-profiler/times" + tracertypes "go.opentelemetry.io/ebpf-profiler/tracer/types" + "go.opentelemetry.io/ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/vc" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracehandler" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/tracehandler" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/hostmetadata" + "go.opentelemetry.io/ebpf-profiler/hostmetadata" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/metrics" + "go.opentelemetry.io/ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracer" + "go.opentelemetry.io/ebpf-profiler/tracer" log "github.com/sirupsen/logrus" ) @@ -41,7 +41,7 @@ var copyright = `Copyright The OpenTelemetry Authors. For the eBPF code loaded by Universal Profiling Agent into the kernel, the following license applies (GPLv2 only). You can obtain a copy of the GPLv2 code at: -https://github.com/open-telemetry/opentelemetry-ebpf-profiler/tree/main/support/ebpf +https://go.opentelemetry.io/ebpf-profiler/tree/main/support/ebpf This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, diff --git a/metrics/doc.go b/metrics/doc.go index 5efa244c..972ffb9f 100644 --- a/metrics/doc.go +++ b/metrics/doc.go @@ -65,4 +65,4 @@ Clickhouse Docs https://clickhouse.tech/docs/en/sql-reference/statements/create/#create-query-specialized-codecs */ -package metrics +package metrics // import "go.opentelemetry.io/ebpf-profiler/metrics" diff --git a/metrics/metrics.go b/metrics/metrics.go index 731e918d..53a74ff9 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metrics +package metrics // import "go.opentelemetry.io/ebpf-profiler/metrics" import ( "bytes" @@ -11,8 +11,8 @@ import ( log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/reporter" ) var ( diff --git a/metrics/types.go b/metrics/types.go index 0d6aed69..fe7c0405 100644 --- a/metrics/types.go +++ b/metrics/types.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package metrics +package metrics // import "go.opentelemetry.io/ebpf-profiler/metrics" // Create ids.go from metrics.json //go:generate go run genids/main.go metrics.json ids.go diff --git a/nativeunwind/elfunwindinfo/elfehframe.go b/nativeunwind/elfunwindinfo/elfehframe.go index 729d8aa7..a80be83f 100644 --- a/nativeunwind/elfunwindinfo/elfehframe.go +++ b/nativeunwind/elfunwindinfo/elfehframe.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package elfunwindinfo +package elfunwindinfo // import "go.opentelemetry.io/ebpf-profiler/nativeunwind/elfunwindinfo" import ( "bytes" @@ -14,9 +14,9 @@ import ( lru "github.com/elastic/go-freelru" log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/hash" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" + "go.opentelemetry.io/ebpf-profiler/libpf/hash" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" ) const ( diff --git a/nativeunwind/elfunwindinfo/elfehframe_aarch64.go b/nativeunwind/elfunwindinfo/elfehframe_aarch64.go index 997fa9b0..abced91f 100644 --- a/nativeunwind/elfunwindinfo/elfehframe_aarch64.go +++ b/nativeunwind/elfunwindinfo/elfehframe_aarch64.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package elfunwindinfo +package elfunwindinfo // import "go.opentelemetry.io/ebpf-profiler/nativeunwind/elfunwindinfo" // ARM64 specific code for handling DWARF / stack delta extraction. // The filename ends with `_aarch64` instead of `_arm64`, so that the code @@ -11,7 +11,7 @@ import ( "debug/elf" "fmt" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" ) //nolint:deadcode,varcheck diff --git a/nativeunwind/elfunwindinfo/elfehframe_test.go b/nativeunwind/elfunwindinfo/elfehframe_test.go index cf201fb7..5aef1c96 100644 --- a/nativeunwind/elfunwindinfo/elfehframe_test.go +++ b/nativeunwind/elfunwindinfo/elfehframe_test.go @@ -6,8 +6,8 @@ package elfunwindinfo import ( "testing" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/nativeunwind/elfunwindinfo/elfehframe_x86.go b/nativeunwind/elfunwindinfo/elfehframe_x86.go index fcd46a31..4da9a4f6 100644 --- a/nativeunwind/elfunwindinfo/elfehframe_x86.go +++ b/nativeunwind/elfunwindinfo/elfehframe_x86.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package elfunwindinfo +package elfunwindinfo // import "go.opentelemetry.io/ebpf-profiler/nativeunwind/elfunwindinfo" // x86-64 specific code for handling DWARF / stack delta extraction. // The filename ends with `_x86` instead of `_amd64`, so that the code @@ -11,7 +11,7 @@ import ( "debug/elf" "fmt" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" ) //nolint:deadcode,varcheck diff --git a/nativeunwind/elfunwindinfo/elfgopclntab.go b/nativeunwind/elfunwindinfo/elfgopclntab.go index f19719c0..0ed4ee93 100644 --- a/nativeunwind/elfunwindinfo/elfgopclntab.go +++ b/nativeunwind/elfunwindinfo/elfgopclntab.go @@ -5,7 +5,7 @@ // in http://golang.org/s/go12symtab. The Golang runtime implementation of // this is in go/src/runtime/symtab.go, but unfortunately it is not exported. -package elfunwindinfo +package elfunwindinfo // import "go.opentelemetry.io/ebpf-profiler/nativeunwind/elfunwindinfo" import ( "bytes" @@ -13,9 +13,9 @@ import ( "fmt" "unsafe" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" log "github.com/sirupsen/logrus" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" ) // Go runtime functions for which we should not attempt to unwind further diff --git a/nativeunwind/elfunwindinfo/elfgopclntab_test.go b/nativeunwind/elfunwindinfo/elfgopclntab_test.go index 3af18b2d..30869826 100644 --- a/nativeunwind/elfunwindinfo/elfgopclntab_test.go +++ b/nativeunwind/elfunwindinfo/elfgopclntab_test.go @@ -7,8 +7,8 @@ import ( "debug/elf" "testing" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/nativeunwind/elfunwindinfo/stackdeltaextraction.go b/nativeunwind/elfunwindinfo/stackdeltaextraction.go index da19dd28..c1cf8758 100644 --- a/nativeunwind/elfunwindinfo/stackdeltaextraction.go +++ b/nativeunwind/elfunwindinfo/stackdeltaextraction.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package elfunwindinfo +package elfunwindinfo // import "go.opentelemetry.io/ebpf-profiler/nativeunwind/elfunwindinfo" import ( "debug/elf" @@ -9,8 +9,8 @@ import ( "sort" "strings" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" ) const ( diff --git a/nativeunwind/elfunwindinfo/stackdeltaextraction_test.go b/nativeunwind/elfunwindinfo/stackdeltaextraction_test.go index 2514ed9c..04738ce8 100644 --- a/nativeunwind/elfunwindinfo/stackdeltaextraction_test.go +++ b/nativeunwind/elfunwindinfo/stackdeltaextraction_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" "github.com/stretchr/testify/require" ) diff --git a/nativeunwind/elfunwindinfo/stackdeltaprovider.go b/nativeunwind/elfunwindinfo/stackdeltaprovider.go index 1bc4cc4a..4a150686 100644 --- a/nativeunwind/elfunwindinfo/stackdeltaprovider.go +++ b/nativeunwind/elfunwindinfo/stackdeltaprovider.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package elfunwindinfo +package elfunwindinfo // import "go.opentelemetry.io/ebpf-profiler/nativeunwind/elfunwindinfo" import ( "errors" @@ -9,10 +9,10 @@ import ( "os" "sync/atomic" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/nativeunwind" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" ) // ELFStackDeltaProvider extracts stack deltas from ELF executables available diff --git a/nativeunwind/stackdeltaprovider.go b/nativeunwind/stackdeltaprovider.go index bf88cf09..d46f55bb 100644 --- a/nativeunwind/stackdeltaprovider.go +++ b/nativeunwind/stackdeltaprovider.go @@ -1,12 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package nativeunwind +package nativeunwind // import "go.opentelemetry.io/ebpf-profiler/nativeunwind" import ( - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" ) type Statistics struct { diff --git a/nativeunwind/stackdeltatypes/stackdeltatypes.go b/nativeunwind/stackdeltatypes/stackdeltatypes.go index c00ea505..6969263b 100644 --- a/nativeunwind/stackdeltatypes/stackdeltatypes.go +++ b/nativeunwind/stackdeltatypes/stackdeltatypes.go @@ -4,7 +4,7 @@ // Package stackdeltatypes provides types used to represent stack delta information as constructed // by `nativeunwind.GetIntervalStructures` This information is a post-processed form of the // stack delta information that is used in all relevant packages. -package stackdeltatypes +package stackdeltatypes // import "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" // #include "../../support/ebpf/stackdeltatypes.h" import "C" diff --git a/nopanicslicereader/nopanicslicereader.go b/nopanicslicereader/nopanicslicereader.go index 01e235f5..96c1d8e5 100644 --- a/nopanicslicereader/nopanicslicereader.go +++ b/nopanicslicereader/nopanicslicereader.go @@ -4,12 +4,12 @@ // nopanicslicereader provides little convenience utilities to read "native" endian // values from a slice at given offset. Zeroes are returned on out of bounds access // instead of panic. -package nopanicslicereader +package nopanicslicereader // import "go.opentelemetry.io/ebpf-profiler/nopanicslicereader" import ( "encoding/binary" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf" ) // Uint8 reads one 8-bit unsigned integer from given byte slice offset diff --git a/nopanicslicereader/nopanicslicereader_test.go b/nopanicslicereader/nopanicslicereader_test.go index 5bad0eaf..703ed159 100644 --- a/nopanicslicereader/nopanicslicereader_test.go +++ b/nopanicslicereader/nopanicslicereader_test.go @@ -6,7 +6,7 @@ package nopanicslicereader import ( "testing" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf" "github.com/stretchr/testify/assert" ) diff --git a/pacmask/pacmask_arm64.go b/pacmask/pacmask_arm64.go index d7a3d1d5..4b963e45 100644 --- a/pacmask/pacmask_arm64.go +++ b/pacmask/pacmask_arm64.go @@ -3,7 +3,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package pacmask +package pacmask // import "go.opentelemetry.io/ebpf-profiler/pacmask" import ( "math/rand/v2" diff --git a/pacmask/pacmask_other.go b/pacmask/pacmask_other.go index 527c0b20..f05c92d5 100644 --- a/pacmask/pacmask_other.go +++ b/pacmask/pacmask_other.go @@ -3,7 +3,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package pacmask +package pacmask // import "go.opentelemetry.io/ebpf-profiler/pacmask" // GetPACMask always returns 0 on this platform. func GetPACMask() uint64 { diff --git a/periodiccaller/periodiccaller.go b/periodiccaller/periodiccaller.go index 1f5a9738..62ebd7ee 100644 --- a/periodiccaller/periodiccaller.go +++ b/periodiccaller/periodiccaller.go @@ -2,13 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // Package periodiccaller allows periodic calls of functions. -package periodiccaller +package periodiccaller // import "go.opentelemetry.io/ebpf-profiler/periodiccaller" import ( "context" "time" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf" ) // Start starts a timer that calls every until the is canceled. diff --git a/proc/proc.go b/proc/proc.go index 10edf6b6..6b791a44 100644 --- a/proc/proc.go +++ b/proc/proc.go @@ -3,7 +3,7 @@ // Package proc provides functionality for retrieving kallsyms, modules and // executable mappings via /proc. -package proc +package proc // import "go.opentelemetry.io/ebpf-profiler/proc" import ( "bufio" @@ -17,8 +17,8 @@ import ( log "github.com/sirupsen/logrus" "golang.org/x/sys/unix" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/stringutil" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/stringutil" ) const defaultMountPoint = "/proc" diff --git a/proc/proc_test.go b/proc/proc_test.go index 413afad6..ce9c3d07 100644 --- a/proc/proc_test.go +++ b/proc/proc_test.go @@ -6,7 +6,7 @@ package proc import ( "testing" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/process/coredump.go b/process/coredump.go index 25a7fe4b..9901d79d 100644 --- a/process/coredump.go +++ b/process/coredump.go @@ -5,7 +5,7 @@ // For NT_FILE coredump mappings: https://www.gabriel.urdhr.fr/2015/05/29/core-file/ -package process +package process // import "go.opentelemetry.io/ebpf-profiler/process" import ( "bytes" @@ -18,8 +18,8 @@ import ( "strings" "unsafe" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" ) const ( diff --git a/process/debug.go b/process/debug.go index 3087954b..c3efa657 100644 --- a/process/debug.go +++ b/process/debug.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package process +package process // import "go.opentelemetry.io/ebpf-profiler/process" import ( "fmt" @@ -12,8 +12,8 @@ import ( "golang.org/x/sys/unix" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/remotememory" ) type ptraceProcess struct { diff --git a/process/debug_amd64.go b/process/debug_amd64.go index c6ca7762..769ce877 100644 --- a/process/debug_amd64.go +++ b/process/debug_amd64.go @@ -3,7 +3,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package process +package process // import "go.opentelemetry.io/ebpf-profiler/process" import ( "debug/elf" diff --git a/process/debug_arm64.go b/process/debug_arm64.go index ed52cb07..17024e25 100644 --- a/process/debug_arm64.go +++ b/process/debug_arm64.go @@ -3,7 +3,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package process +package process // import "go.opentelemetry.io/ebpf-profiler/process" import ( "debug/elf" diff --git a/process/process.go b/process/process.go index b1a8fc43..0fe9d035 100644 --- a/process/process.go +++ b/process/process.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package process +package process // import "go.opentelemetry.io/ebpf-profiler/process" import ( "bufio" @@ -15,11 +15,11 @@ import ( "golang.org/x/sys/unix" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/stringutil" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/stringutil" + "go.opentelemetry.io/ebpf-profiler/util" ) // systemProcess provides an implementation of the Process interface for a diff --git a/process/process_test.go b/process/process_test.go index a2a43a8f..3cd2b7d1 100644 --- a/process/process_test.go +++ b/process/process_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf" ) //nolint:lll diff --git a/process/types.go b/process/types.go index b3360615..b1c9fc9f 100644 --- a/process/types.go +++ b/process/types.go @@ -3,17 +3,17 @@ // This file defines the interface to access a Process state. -package process +package process // import "go.opentelemetry.io/ebpf-profiler/process" import ( "debug/elf" "io" "strings" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/util" ) // vdsoPathName is the path to use for VDSO mappings diff --git a/processmanager/ebpf/asyncupdate.go b/processmanager/ebpf/asyncupdate.go index 1b24f7fb..da7c91f4 100644 --- a/processmanager/ebpf/asyncupdate.go +++ b/processmanager/ebpf/asyncupdate.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package ebpf +package ebpf // import "go.opentelemetry.io/ebpf-profiler/processmanager/ebpf" import ( "context" @@ -9,8 +9,8 @@ import ( "unsafe" cebpf "github.com/cilium/ebpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" log "github.com/sirupsen/logrus" + "go.opentelemetry.io/ebpf-profiler/host" ) // asyncMapUpdaterPool is a pool of goroutines for doing non-blocking updates diff --git a/processmanager/ebpf/asyncupdate_integration_test.go b/processmanager/ebpf/asyncupdate_integration_test.go index 746c134e..9c469d28 100644 --- a/processmanager/ebpf/asyncupdate_integration_test.go +++ b/processmanager/ebpf/asyncupdate_integration_test.go @@ -12,8 +12,8 @@ import ( "github.com/cilium/ebpf" "golang.org/x/sync/errgroup" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/rlimit" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/rlimit" "github.com/stretchr/testify/require" ) diff --git a/processmanager/ebpf/ebpf.go b/processmanager/ebpf/ebpf.go index 19cb54a7..9f9dc90b 100644 --- a/processmanager/ebpf/ebpf.go +++ b/processmanager/ebpf/ebpf.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package ebpf +package ebpf // import "go.opentelemetry.io/ebpf-profiler/processmanager/ebpf" import ( "context" @@ -16,15 +16,15 @@ import ( "golang.org/x/exp/constraints" "golang.org/x/sys/unix" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/lpm" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/rlimit" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/lpm" + "go.opentelemetry.io/ebpf-profiler/metrics" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" + "go.opentelemetry.io/ebpf-profiler/rlimit" + "go.opentelemetry.io/ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/util" ) /* diff --git a/processmanager/ebpf/ebpf_integration_test.go b/processmanager/ebpf/ebpf_integration_test.go index 4517e393..c1af9a3c 100644 --- a/processmanager/ebpf/ebpf_integration_test.go +++ b/processmanager/ebpf/ebpf_integration_test.go @@ -13,10 +13,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/lpm" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/rlimit" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/lpm" + "go.opentelemetry.io/ebpf-profiler/rlimit" + "go.opentelemetry.io/ebpf-profiler/support" ) func loadTracers(t *testing.T) *ebpfMapsImpl { diff --git a/processmanager/ebpf/types.go b/processmanager/ebpf/types.go index f2610ede..bd5de07d 100644 --- a/processmanager/ebpf/types.go +++ b/processmanager/ebpf/types.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package ebpf +package ebpf // import "go.opentelemetry.io/ebpf-profiler/processmanager/ebpf" // StackDeltaEBPF represents stack deltas preprocessed by the ProcessManager which are // then loaded to the eBPF map. This is Go equivalent of 'struct StackDelta' in eBPF types.h. diff --git a/processmanager/execinfomanager/manager.go b/processmanager/execinfomanager/manager.go index ffbc90d2..135da84d 100644 --- a/processmanager/execinfomanager/manager.go +++ b/processmanager/execinfomanager/manager.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package execinfomanager +package execinfomanager // import "go.opentelemetry.io/ebpf-profiler/processmanager/execinfomanager" import ( "errors" @@ -9,31 +9,31 @@ import ( "os" "time" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracer/types" log "github.com/sirupsen/logrus" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/tracer/types" lru "github.com/elastic/go-freelru" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter/apmint" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter/dotnet" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter/hotspot" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter/nodev8" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter/perl" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter/php" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter/python" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter/ruby" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/xsync" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" - pmebpf "github.com/open-telemetry/opentelemetry-ebpf-profiler/processmanager/ebpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tpbase" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/interpreter/apmint" + "go.opentelemetry.io/ebpf-profiler/interpreter/dotnet" + "go.opentelemetry.io/ebpf-profiler/interpreter/hotspot" + "go.opentelemetry.io/ebpf-profiler/interpreter/nodev8" + "go.opentelemetry.io/ebpf-profiler/interpreter/perl" + "go.opentelemetry.io/ebpf-profiler/interpreter/php" + "go.opentelemetry.io/ebpf-profiler/interpreter/python" + "go.opentelemetry.io/ebpf-profiler/interpreter/ruby" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/libpf/xsync" + "go.opentelemetry.io/ebpf-profiler/metrics" + "go.opentelemetry.io/ebpf-profiler/nativeunwind" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" + pmebpf "go.opentelemetry.io/ebpf-profiler/processmanager/ebpf" + "go.opentelemetry.io/ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/tpbase" + "go.opentelemetry.io/ebpf-profiler/util" ) const ( diff --git a/processmanager/helpers.go b/processmanager/helpers.go index 272af851..6f4b7022 100644 --- a/processmanager/helpers.go +++ b/processmanager/helpers.go @@ -1,14 +1,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package processmanager +package processmanager // import "go.opentelemetry.io/ebpf-profiler/processmanager" import ( lru "github.com/elastic/go-freelru" log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/libpf" ) type lruFileIDMapper struct { diff --git a/processmanager/manager.go b/processmanager/manager.go index 5a18225f..e14e182a 100644 --- a/processmanager/manager.go +++ b/processmanager/manager.go @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // Package processmanager manages the loading and unloading of information related to processes. -package processmanager +package processmanager // import "go.opentelemetry.io/ebpf-profiler/processmanager" import ( "context" @@ -13,24 +13,24 @@ import ( lru "github.com/elastic/go-freelru" log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracer/types" - - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter/apmint" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/lpm" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/periodiccaller" - pmebpf "github.com/open-telemetry/opentelemetry-ebpf-profiler/processmanager/ebpf" - eim "github.com/open-telemetry/opentelemetry-ebpf-profiler/processmanager/execinfomanager" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/times" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracehandler" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/traceutil" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/tracer/types" + + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/interpreter/apmint" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/lpm" + "go.opentelemetry.io/ebpf-profiler/metrics" + "go.opentelemetry.io/ebpf-profiler/nativeunwind" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" + "go.opentelemetry.io/ebpf-profiler/periodiccaller" + pmebpf "go.opentelemetry.io/ebpf-profiler/processmanager/ebpf" + eim "go.opentelemetry.io/ebpf-profiler/processmanager/execinfomanager" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/times" + "go.opentelemetry.io/ebpf-profiler/tracehandler" + "go.opentelemetry.io/ebpf-profiler/traceutil" + "go.opentelemetry.io/ebpf-profiler/util" ) const ( diff --git a/processmanager/manager_test.go b/processmanager/manager_test.go index 82ffa4b5..d3817c42 100644 --- a/processmanager/manager_test.go +++ b/processmanager/manager_test.go @@ -15,21 +15,21 @@ import ( "time" "unsafe" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/lpm" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" - pmebpf "github.com/open-telemetry/opentelemetry-ebpf-profiler/processmanager/ebpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - tracertypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracer/types" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/traceutil" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/lpm" + "go.opentelemetry.io/ebpf-profiler/metrics" + "go.opentelemetry.io/ebpf-profiler/nativeunwind" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" + "go.opentelemetry.io/ebpf-profiler/process" + pmebpf "go.opentelemetry.io/ebpf-profiler/processmanager/ebpf" + "go.opentelemetry.io/ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/reporter" + tracertypes "go.opentelemetry.io/ebpf-profiler/tracer/types" + "go.opentelemetry.io/ebpf-profiler/traceutil" + "go.opentelemetry.io/ebpf-profiler/util" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -251,8 +251,7 @@ type symbolReporterMockup struct{} func (s *symbolReporterMockup) ReportFallbackSymbol(_ libpf.FrameID, _ string) {} -func (s *symbolReporterMockup) ExecutableMetadata(_ libpf.FileID, _, _ string, - _ libpf.InterpreterType, _ reporter.ExecutableOpener) { +func (s *symbolReporterMockup) ExecutableMetadata(_ *reporter.ExecutableMetadataArgs) { } func (s *symbolReporterMockup) FrameMetadata(_ libpf.FileID, _ libpf.AddressOrLineno, diff --git a/processmanager/processinfo.go b/processmanager/processinfo.go index 94b16530..0f3c1841 100644 --- a/processmanager/processinfo.go +++ b/processmanager/processinfo.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package processmanager +package processmanager // import "go.opentelemetry.io/ebpf-profiler/processmanager" // This file is the only place that should access pidToProcessInfo. // The map is used to synchronize state between eBPF maps and process @@ -21,17 +21,18 @@ import ( log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/lpm" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/proc" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" - eim "github.com/open-telemetry/opentelemetry-ebpf-profiler/processmanager/execinfomanager" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/times" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tpbase" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/lpm" + "go.opentelemetry.io/ebpf-profiler/proc" + "go.opentelemetry.io/ebpf-profiler/process" + eim "go.opentelemetry.io/ebpf-profiler/processmanager/execinfomanager" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/times" + "go.opentelemetry.io/ebpf-profiler/tpbase" + "go.opentelemetry.io/ebpf-profiler/util" ) // assignTSDInfo updates the TSDInfo for the Interpreters on given PID. @@ -302,8 +303,14 @@ func (pm *ProcessManager) getELFInfo(pr process.Process, mapping *process.Mappin open := func() (process.ReadAtCloser, error) { return pr.OpenMappingFile(&mapping2) } - pm.reporter.ExecutableMetadata(fileID, baseName, gnuBuildID, libpf.Native, open) - + pm.reporter.ExecutableMetadata(&reporter.ExecutableMetadataArgs{ + FileID: fileID, + FileName: baseName, + GnuBuildID: gnuBuildID, + DebuglinkFileName: ef.DebuglinkFileName(elfRef.FileName(), elfRef), + Interp: libpf.Native, + Open: open, + }) return info } diff --git a/processmanager/synthdeltas_arm64.go b/processmanager/synthdeltas_arm64.go index 141f160c..9a385205 100644 --- a/processmanager/synthdeltas_arm64.go +++ b/processmanager/synthdeltas_arm64.go @@ -3,14 +3,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package processmanager +package processmanager // import "go.opentelemetry.io/ebpf-profiler/processmanager" import ( "fmt" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" ) // createVDSOSyntheticRecord creates a generated stack-delta record spanning the entire vDSO binary, diff --git a/processmanager/synthdeltas_other.go b/processmanager/synthdeltas_other.go index f7a0e308..fa45a503 100644 --- a/processmanager/synthdeltas_other.go +++ b/processmanager/synthdeltas_other.go @@ -3,11 +3,11 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package processmanager +package processmanager // import "go.opentelemetry.io/ebpf-profiler/processmanager" import ( - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" ) // insertSynthStackDeltas adds synthetic stack-deltas to the given SDMM. On non-ARM64, this is diff --git a/processmanager/types.go b/processmanager/types.go index 01e6a86d..d890ab38 100644 --- a/processmanager/types.go +++ b/processmanager/types.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package processmanager +package processmanager // import "go.opentelemetry.io/ebpf-profiler/processmanager" import ( "sync" @@ -9,17 +9,17 @@ import ( lru "github.com/elastic/go-freelru" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - pmebpf "github.com/open-telemetry/opentelemetry-ebpf-profiler/processmanager/ebpf" - eim "github.com/open-telemetry/opentelemetry-ebpf-profiler/processmanager/execinfomanager" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/times" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tpbase" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/metrics" + pmebpf "go.opentelemetry.io/ebpf-profiler/processmanager/ebpf" + eim "go.opentelemetry.io/ebpf-profiler/processmanager/execinfomanager" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/times" + "go.opentelemetry.io/ebpf-profiler/tpbase" + "go.opentelemetry.io/ebpf-profiler/util" ) // elfInfo contains cached data from an executable needed for processing mappings. diff --git a/remotememory/remotememory.go b/remotememory/remotememory.go index 6ab4ee96..00ca1ed7 100644 --- a/remotememory/remotememory.go +++ b/remotememory/remotememory.go @@ -4,7 +4,7 @@ // remotememory provides access to memory space of a process. The ReaderAt // interface is used for the basic access, and various convenience functions are // provided to help reading specific data types. -package remotememory +package remotememory // import "go.opentelemetry.io/ebpf-profiler/remotememory" import ( "bytes" @@ -14,7 +14,7 @@ import ( "golang.org/x/sys/unix" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf" ) // RemoteMemory implements a set of convenience functions to access the remote memory diff --git a/remotememory/remotememory_test.go b/remotememory/remotememory_test.go index 54d8297f..fcbfa0ab 100644 --- a/remotememory/remotememory_test.go +++ b/remotememory/remotememory_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf" ) func RemoteMemTests(t *testing.T, rm RemoteMemory) { diff --git a/reporter/config.go b/reporter/config.go index 0cb038e0..794dcd8f 100644 --- a/reporter/config.go +++ b/reporter/config.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package reporter +package reporter // import "go.opentelemetry.io/ebpf-profiler/reporter" import ( "time" diff --git a/reporter/fifo.go b/reporter/fifo.go index cb2d5144..e6c871b7 100644 --- a/reporter/fifo.go +++ b/reporter/fifo.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package reporter +package reporter // import "go.opentelemetry.io/ebpf-profiler/reporter" import ( "fmt" diff --git a/reporter/iface.go b/reporter/iface.go index cb96b9d9..8e67c944 100644 --- a/reporter/iface.go +++ b/reporter/iface.go @@ -1,14 +1,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package reporter +package reporter // import "go.opentelemetry.io/ebpf-profiler/reporter" import ( "context" "time" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/process" ) // Reporter is the top-level interface implemented by a full reporter. @@ -50,21 +50,42 @@ type TraceReporter interface { SupportsReportTraceEvent() bool } +// ExecutableOpener is a function that attempts to open an executable. type ExecutableOpener = func() (process.ReadAtCloser, error) +// ExecutableMetadataArgs collects metadata about a discovered +// executable, for reporting to a SymbolReporter via the ExecutableMetadata function. +type ExecutableMetadataArgs struct { + // FileID is a unique identifier of the executable. + FileID libpf.FileID + // FileName is the base filename of the executable. + FileName string + // GnuBuildID is the GNU build ID from .note.gnu.build-id, if any. + GnuBuildID string + // DebuglinkFileName is the path to the matching debug file + // from the .gnu.debuglink, if any. The caller should + // verify that the file in question matches the GnuBuildID of this executable.. + DebuglinkFileName string + // Interp is the discovered interpreter type of this executable, if any. + Interp libpf.InterpreterType + // Open is a function that can be used to open the executable for reading, + // or nil for interpreters that don't support this. + Open ExecutableOpener +} + type SymbolReporter interface { // ReportFallbackSymbol enqueues a fallback symbol for reporting, for a given frame. ReportFallbackSymbol(frameID libpf.FrameID, symbol string) - // ExecutableMetadata accepts a fileID with the corresponding filename - // and caches this information before a periodic reporting to the backend. + // ExecutableMetadata accepts a FileID with the corresponding filename + // and takes some action with it (for example, it might cache it for + // periodic reporting to a backend). // - // The `open` argument can be used to open the executable for reading. Interpreters + // The `Open` argument can be used to open the executable for reading. Interpreters // that don't support this may pass a `nil` function pointer. Implementations that // wish to upload executables should NOT block this function to do so and instead just // open the file and then enqueue the upload in the background. - ExecutableMetadata(fileID libpf.FileID, fileName, gnuBuildID string, - interp libpf.InterpreterType, open ExecutableOpener) + ExecutableMetadata(args *ExecutableMetadataArgs) // FrameMetadata accepts metadata associated with a frame and caches this information before // a periodic reporting to the backend. diff --git a/reporter/metrics.go b/reporter/metrics.go index ee3cd37c..107047b3 100644 --- a/reporter/metrics.go +++ b/reporter/metrics.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package reporter +package reporter // import "go.opentelemetry.io/ebpf-profiler/reporter" import ( "context" @@ -10,7 +10,7 @@ import ( "google.golang.org/grpc/stats" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/xsync" + "go.opentelemetry.io/ebpf-profiler/libpf/xsync" ) type StatsHandlerImpl struct { diff --git a/reporter/otlp_reporter.go b/reporter/otlp_reporter.go index f23968e9..0470d573 100644 --- a/reporter/otlp_reporter.go +++ b/reporter/otlp_reporter.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package reporter +package reporter // import "go.opentelemetry.io/ebpf-profiler/reporter" import ( "bufio" @@ -29,8 +29,8 @@ import ( "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/xsync" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/xsync" ) var ( @@ -208,11 +208,10 @@ func (r *OTLPReporter) ReportFallbackSymbol(frameID libpf.FrameID, symbol string // ExecutableMetadata accepts a fileID with the corresponding filename // and caches this information. -func (r *OTLPReporter) ExecutableMetadata(fileID libpf.FileID, fileName, - gnuBuildID string, _ libpf.InterpreterType, _ ExecutableOpener) { - r.executables.Add(fileID, execInfo{ - fileName: fileName, - gnuBuildID: gnuBuildID, +func (r *OTLPReporter) ExecutableMetadata(args *ExecutableMetadataArgs) { + r.executables.Add(args.FileID, execInfo{ + fileName: args.FileName, + gnuBuildID: args.GnuBuildID, }) } diff --git a/reporter/otlp_reporter_test.go b/reporter/otlp_reporter_test.go index a1484115..d9c2844f 100644 --- a/reporter/otlp_reporter_test.go +++ b/reporter/otlp_reporter_test.go @@ -3,8 +3,8 @@ package reporter import ( "testing" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" "github.com/stretchr/testify/require" + "go.opentelemetry.io/ebpf-profiler/libpf" semconv "go.opentelemetry.io/otel/semconv/v1.25.0" common "go.opentelemetry.io/proto/otlp/common/v1" profiles "go.opentelemetry.io/proto/otlp/profiles/v1experimental" diff --git a/reporter/times.go b/reporter/times.go index 6a97d0a8..2fa33d8b 100644 --- a/reporter/times.go +++ b/reporter/times.go @@ -1,12 +1,12 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package reporter +package reporter // import "go.opentelemetry.io/ebpf-profiler/reporter" import ( "time" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/times" + "go.opentelemetry.io/ebpf-profiler/times" ) // Compile time check to make sure config.Times satisfies the interfaces. diff --git a/rlimit/rlimit.go b/rlimit/rlimit.go index 7ea7bba2..efbf1af2 100644 --- a/rlimit/rlimit.go +++ b/rlimit/rlimit.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package rlimit +package rlimit // import "go.opentelemetry.io/ebpf-profiler/rlimit" import ( "fmt" diff --git a/stringutil/stringutil.go b/stringutil/stringutil.go index 163ed580..3d8b4a88 100644 --- a/stringutil/stringutil.go +++ b/stringutil/stringutil.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package stringutil +package stringutil // import "go.opentelemetry.io/ebpf-profiler/stringutil" import ( "strings" diff --git a/successfailurecounter/successfailurecounter.go b/successfailurecounter/successfailurecounter.go index b2118b14..15819c92 100644 --- a/successfailurecounter/successfailurecounter.go +++ b/successfailurecounter/successfailurecounter.go @@ -5,7 +5,7 @@ // // This package is **not** thread safe. Multiple increments to the same SuccessFailureCounter from // different threads can result in incorrect counter results. -package successfailurecounter +package successfailurecounter // import "go.opentelemetry.io/ebpf-profiler/successfailurecounter" import ( "sync/atomic" diff --git a/support/ebpf_integration_test.go b/support/ebpf_integration_test.go index 2bde0e23..98486c57 100644 --- a/support/ebpf_integration_test.go +++ b/support/ebpf_integration_test.go @@ -10,7 +10,7 @@ import ( cebpf "github.com/cilium/ebpf" "github.com/cilium/ebpf/link" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/rlimit" + "go.opentelemetry.io/ebpf-profiler/rlimit" "github.com/stretchr/testify/require" ) diff --git a/support/support.go b/support/support.go index 3dad27f4..d2e97f9b 100644 --- a/support/support.go +++ b/support/support.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package support +package support // import "go.opentelemetry.io/ebpf-profiler/support" import ( "bytes" diff --git a/support/support_amd64.go b/support/support_amd64.go index dfb2895d..f884f54b 100644 --- a/support/support_amd64.go +++ b/support/support_amd64.go @@ -3,7 +3,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package support +package support // import "go.opentelemetry.io/ebpf-profiler/support" import ( _ "embed" diff --git a/support/support_arm64.go b/support/support_arm64.go index a514a397..6b0b5a64 100644 --- a/support/support_arm64.go +++ b/support/support_arm64.go @@ -3,7 +3,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package support +package support // import "go.opentelemetry.io/ebpf-profiler/support" import ( _ "embed" diff --git a/support/support_dummy.go b/support/support_dummy.go index 5fdf4eb0..17e9abb5 100644 --- a/support/support_dummy.go +++ b/support/support_dummy.go @@ -3,7 +3,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package support +package support // import "go.opentelemetry.io/ebpf-profiler/support" // support_dummy.go satisfies build requirements where the eBPF tracers file does not exist. diff --git a/support/types.go b/support/types.go index 3a2e16a6..6387e4d0 100644 --- a/support/types.go +++ b/support/types.go @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // support maps the definitions from headers in the C world into a nice go way -package support +package support // import "go.opentelemetry.io/ebpf-profiler/support" /* #include "./ebpf/types.h" diff --git a/testsupport/io.go b/testsupport/io.go index 0b67b5e3..5477b76c 100644 --- a/testsupport/io.go +++ b/testsupport/io.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package testsupport +package testsupport // import "go.opentelemetry.io/ebpf-profiler/testsupport" import ( "bytes" diff --git a/testsupport/testfiles.go b/testsupport/testfiles.go index 3b93f789..c19c099d 100644 --- a/testsupport/testfiles.go +++ b/testsupport/testfiles.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package testsupport +package testsupport // import "go.opentelemetry.io/ebpf-profiler/testsupport" import ( "encoding/base64" diff --git a/times/ktime.go b/times/ktime.go index 9bdf330f..b2fd3cc4 100644 --- a/times/ktime.go +++ b/times/ktime.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package times +package times // import "go.opentelemetry.io/ebpf-profiler/times" import ( "time" diff --git a/times/times.go b/times/times.go index f635fe33..d7f2c889 100644 --- a/times/times.go +++ b/times/times.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package times +package times // import "go.opentelemetry.io/ebpf-profiler/times" import ( "context" @@ -10,7 +10,7 @@ import ( "sync/atomic" "time" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/periodiccaller" + "go.opentelemetry.io/ebpf-profiler/periodiccaller" ) const ( diff --git a/tools/coredump/analyze.go b/tools/coredump/analyze.go index d225f136..bb2c37fe 100644 --- a/tools/coredump/analyze.go +++ b/tools/coredump/analyze.go @@ -16,9 +16,9 @@ import ( "github.com/peterbourgon/ff/v3/ffcli" log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tools/coredump/modulestore" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/process" + "go.opentelemetry.io/ebpf-profiler/tools/coredump/modulestore" ) type analyzeCmd struct { diff --git a/tools/coredump/clean.go b/tools/coredump/clean.go index 3e7a7d6f..66889c05 100644 --- a/tools/coredump/clean.go +++ b/tools/coredump/clean.go @@ -13,8 +13,8 @@ import ( "github.com/peterbourgon/ff/v3/ffcli" log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tools/coredump/modulestore" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/tools/coredump/modulestore" ) type cleanCmd struct { diff --git a/tools/coredump/coredump.go b/tools/coredump/coredump.go index c9b5c3d0..0aa863ec 100644 --- a/tools/coredump/coredump.go +++ b/tools/coredump/coredump.go @@ -15,14 +15,14 @@ import ( cebpf "github.com/cilium/ebpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/xsync" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/elfunwindinfo" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" - pm "github.com/open-telemetry/opentelemetry-ebpf-profiler/processmanager" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" - tracertypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracer/types" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/xsync" + "go.opentelemetry.io/ebpf-profiler/nativeunwind/elfunwindinfo" + "go.opentelemetry.io/ebpf-profiler/process" + pm "go.opentelemetry.io/ebpf-profiler/processmanager" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/support" + tracertypes "go.opentelemetry.io/ebpf-profiler/tracer/types" ) // #include @@ -61,9 +61,8 @@ func newSymbolizationCache() *symbolizationCache { } } -func (c *symbolizationCache) ExecutableMetadata(fileID libpf.FileID, - fileName, _ string, _ libpf.InterpreterType, _ reporter.ExecutableOpener) { - c.files[fileID] = fileName +func (c *symbolizationCache) ExecutableMetadata(args *reporter.ExecutableMetadataArgs) { + c.files[args.FileID] = args.FileName } func (c *symbolizationCache) FrameMetadata(fileID libpf.FileID, diff --git a/tools/coredump/ebpfcontext.go b/tools/coredump/ebpfcontext.go index ed3bce4d..b18e26e0 100644 --- a/tools/coredump/ebpfcontext.go +++ b/tools/coredump/ebpfcontext.go @@ -6,9 +6,9 @@ package main import ( "unsafe" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/remotememory" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/process" + "go.opentelemetry.io/ebpf-profiler/remotememory" ) /* diff --git a/tools/coredump/ebpfhelpers.go b/tools/coredump/ebpfhelpers.go index 2b322d9c..3f3ef07a 100644 --- a/tools/coredump/ebpfhelpers.go +++ b/tools/coredump/ebpfhelpers.go @@ -16,10 +16,10 @@ import ( "math/bits" "unsafe" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/times" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/times" log "github.com/sirupsen/logrus" ) diff --git a/tools/coredump/ebpfmaps.go b/tools/coredump/ebpfmaps.go index 6804547d..e478be97 100644 --- a/tools/coredump/ebpfmaps.go +++ b/tools/coredump/ebpfmaps.go @@ -8,15 +8,15 @@ import ( "math/bits" "unsafe" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/interpreter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/lpm" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" - pmebpf "github.com/open-telemetry/opentelemetry-ebpf-profiler/processmanager/ebpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/interpreter" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/lpm" + "go.opentelemetry.io/ebpf-profiler/metrics" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" + pmebpf "go.opentelemetry.io/ebpf-profiler/processmanager/ebpf" + "go.opentelemetry.io/ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/util" ) /* diff --git a/tools/coredump/exportmodule.go b/tools/coredump/exportmodule.go index 71cdaac8..d0186caa 100644 --- a/tools/coredump/exportmodule.go +++ b/tools/coredump/exportmodule.go @@ -11,7 +11,7 @@ import ( "github.com/peterbourgon/ff/v3/ffcli" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tools/coredump/modulestore" + "go.opentelemetry.io/ebpf-profiler/tools/coredump/modulestore" ) type exportModuleCmd struct { diff --git a/tools/coredump/gdb.go b/tools/coredump/gdb.go index 517bf669..54cf7754 100644 --- a/tools/coredump/gdb.go +++ b/tools/coredump/gdb.go @@ -18,9 +18,9 @@ import ( "github.com/peterbourgon/ff/v3/ffcli" log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tools/coredump/modulestore" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/process" + "go.opentelemetry.io/ebpf-profiler/tools/coredump/modulestore" ) type gdbCmd struct { diff --git a/tools/coredump/json.go b/tools/coredump/json.go index cf053cfe..388691de 100644 --- a/tools/coredump/json.go +++ b/tools/coredump/json.go @@ -12,7 +12,7 @@ import ( "path/filepath" "runtime" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tools/coredump/modulestore" + "go.opentelemetry.io/ebpf-profiler/tools/coredump/modulestore" ) // CoredumpTestCase is the data structure generated from the core dump. diff --git a/tools/coredump/main.go b/tools/coredump/main.go index 8ac426b1..173cb2ec 100644 --- a/tools/coredump/main.go +++ b/tools/coredump/main.go @@ -16,9 +16,9 @@ import ( awsconfig "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/service/s3" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tools/coredump/modulestore" "github.com/peterbourgon/ff/v3/ffcli" log "github.com/sirupsen/logrus" + "go.opentelemetry.io/ebpf-profiler/tools/coredump/modulestore" ) // moduleStoreS3Bucket defines the S3 bucket used for the module store. diff --git a/tools/coredump/modulestore/id.go b/tools/coredump/modulestore/id.go index a728e480..9a3e8cd8 100644 --- a/tools/coredump/modulestore/id.go +++ b/tools/coredump/modulestore/id.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package modulestore +package modulestore // import "go.opentelemetry.io/ebpf-profiler/tools/coredump/modulestore" import ( "crypto/sha256" diff --git a/tools/coredump/modulestore/reader.go b/tools/coredump/modulestore/reader.go index aea276d7..ae5b4b35 100644 --- a/tools/coredump/modulestore/reader.go +++ b/tools/coredump/modulestore/reader.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package modulestore +package modulestore // import "go.opentelemetry.io/ebpf-profiler/tools/coredump/modulestore" import "io" diff --git a/tools/coredump/modulestore/store.go b/tools/coredump/modulestore/store.go index 5fa13c91..b169f469 100644 --- a/tools/coredump/modulestore/store.go +++ b/tools/coredump/modulestore/store.go @@ -4,7 +4,7 @@ // The modulestore package implements `Store`, a storage for large binary files (modules). // For more information, please refer to the documentation on the `Store` type. -package modulestore +package modulestore // import "go.opentelemetry.io/ebpf-profiler/tools/coredump/modulestore" import ( "context" @@ -24,9 +24,9 @@ import ( log "github.com/sirupsen/logrus" "golang.org/x/sys/unix" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/readatbuf" - zstpak "github.com/open-telemetry/opentelemetry-ebpf-profiler/tools/zstpak/lib" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/readatbuf" + zstpak "go.opentelemetry.io/ebpf-profiler/tools/zstpak/lib" ) const ( diff --git a/tools/coredump/modulestore/util.go b/tools/coredump/modulestore/util.go index aa0c5e02..08c43ba0 100644 --- a/tools/coredump/modulestore/util.go +++ b/tools/coredump/modulestore/util.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package modulestore +package modulestore // import "go.opentelemetry.io/ebpf-profiler/tools/coredump/modulestore" import ( "context" diff --git a/tools/coredump/new.go b/tools/coredump/new.go index 288172e1..7025ecfb 100644 --- a/tools/coredump/new.go +++ b/tools/coredump/new.go @@ -15,10 +15,10 @@ import ( "github.com/peterbourgon/ff/v3/ffcli" log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tools/coredump/modulestore" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/process" + "go.opentelemetry.io/ebpf-profiler/tools/coredump/modulestore" ) // gcorePathPrefix specifies the path prefix we ask gcore to use when creating coredumps. diff --git a/tools/coredump/rebase.go b/tools/coredump/rebase.go index 066ed2e4..04110bff 100644 --- a/tools/coredump/rebase.go +++ b/tools/coredump/rebase.go @@ -12,7 +12,7 @@ import ( "github.com/peterbourgon/ff/v3/ffcli" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tools/coredump/modulestore" + "go.opentelemetry.io/ebpf-profiler/tools/coredump/modulestore" ) type rebaseCmd struct { diff --git a/tools/coredump/storecoredump.go b/tools/coredump/storecoredump.go index 43e50201..c189760a 100644 --- a/tools/coredump/storecoredump.go +++ b/tools/coredump/storecoredump.go @@ -8,9 +8,9 @@ import ( "fmt" "os" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tools/coredump/modulestore" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/process" + "go.opentelemetry.io/ebpf-profiler/tools/coredump/modulestore" log "github.com/sirupsen/logrus" ) diff --git a/tools/coredump/upload.go b/tools/coredump/upload.go index 42837b83..4134b8a8 100644 --- a/tools/coredump/upload.go +++ b/tools/coredump/upload.go @@ -13,7 +13,7 @@ import ( log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tools/coredump/modulestore" + "go.opentelemetry.io/ebpf-profiler/tools/coredump/modulestore" ) type uploadCmd struct { diff --git a/tools/stackdeltas/stackdeltas.go b/tools/stackdeltas/stackdeltas.go index 836aa80a..d9c16b44 100644 --- a/tools/stackdeltas/stackdeltas.go +++ b/tools/stackdeltas/stackdeltas.go @@ -12,10 +12,10 @@ import ( "fmt" "path/filepath" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/elfunwindinfo" - sdtypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/stackdeltatypes" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/nativeunwind/elfunwindinfo" + sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes" + "go.opentelemetry.io/ebpf-profiler/support" ) var ( diff --git a/tools/zstpak/lib/zstpak.go b/tools/zstpak/lib/zstpak.go index 4ee3491a..a3db4f2e 100644 --- a/tools/zstpak/lib/zstpak.go +++ b/tools/zstpak/lib/zstpak.go @@ -19,7 +19,7 @@ // Using relative offsets and variable size ints in the footer could shave off a few more bytes, // but was omitted for simplicity. -package zstpak +package zstpak // import "go.opentelemetry.io/ebpf-profiler/tools/zstpak/lib" import ( "bytes" diff --git a/tools/zstpak/lib/zstpak_test.go b/tools/zstpak/lib/zstpak_test.go index 4971a062..76862924 100644 --- a/tools/zstpak/lib/zstpak_test.go +++ b/tools/zstpak/lib/zstpak_test.go @@ -8,9 +8,9 @@ import ( "os" "testing" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/testsupport" - zstpak "github.com/open-telemetry/opentelemetry-ebpf-profiler/tools/zstpak/lib" "github.com/stretchr/testify/require" + "go.opentelemetry.io/ebpf-profiler/testsupport" + zstpak "go.opentelemetry.io/ebpf-profiler/tools/zstpak/lib" ) func generateInputFile(seqLen uint8, outputSize uint64) []byte { diff --git a/tools/zstpak/main.go b/tools/zstpak/main.go index 063a6854..bb95a991 100644 --- a/tools/zstpak/main.go +++ b/tools/zstpak/main.go @@ -11,7 +11,7 @@ import ( "fmt" "os" - zstpak "github.com/open-telemetry/opentelemetry-ebpf-profiler/tools/zstpak/lib" + zstpak "go.opentelemetry.io/ebpf-profiler/tools/zstpak/lib" ) func tryMain() error { diff --git a/tpbase/assembly_decode.go b/tpbase/assembly_decode.go index 668c269e..b3641db4 100644 --- a/tpbase/assembly_decode.go +++ b/tpbase/assembly_decode.go @@ -1,13 +1,13 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tpbase +package tpbase // import "go.opentelemetry.io/ebpf-profiler/tpbase" import ( "errors" "fmt" - ah "github.com/open-telemetry/opentelemetry-ebpf-profiler/armhelpers" + ah "go.opentelemetry.io/ebpf-profiler/armhelpers" aa "golang.org/x/arch/arm64/arm64asm" ) diff --git a/tpbase/assembly_decode_amd64.go b/tpbase/assembly_decode_amd64.go index d75040eb..c8eb3d6d 100644 --- a/tpbase/assembly_decode_amd64.go +++ b/tpbase/assembly_decode_amd64.go @@ -3,7 +3,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tpbase +package tpbase // import "go.opentelemetry.io/ebpf-profiler/tpbase" import ( "bytes" @@ -11,7 +11,7 @@ import ( "errors" "unsafe" - _ "github.com/open-telemetry/opentelemetry-ebpf-profiler/zydis" // links Zydis + _ "go.opentelemetry.io/ebpf-profiler/zydis" // links Zydis ) // #cgo CFLAGS: -g -Wall diff --git a/tpbase/assembly_decode_arm64.go b/tpbase/assembly_decode_arm64.go index de0fbf78..695dce09 100644 --- a/tpbase/assembly_decode_arm64.go +++ b/tpbase/assembly_decode_arm64.go @@ -3,7 +3,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tpbase +package tpbase // import "go.opentelemetry.io/ebpf-profiler/tpbase" func GetAnalyzers() []Analyzer { return arm64GetAnalyzers() diff --git a/tpbase/libc.go b/tpbase/libc.go index cab9cf3e..b5e3bc5f 100644 --- a/tpbase/libc.go +++ b/tpbase/libc.go @@ -1,16 +1,16 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tpbase +package tpbase // import "go.opentelemetry.io/ebpf-profiler/tpbase" import ( "errors" "fmt" "regexp" - ah "github.com/open-telemetry/opentelemetry-ebpf-profiler/armhelpers" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/stringutil" + ah "go.opentelemetry.io/ebpf-profiler/armhelpers" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/stringutil" aa "golang.org/x/arch/arm64/arm64asm" ) @@ -123,6 +123,7 @@ const ( TSDElementBase TSDIndex TSDValue + TSDConstant ) type regState struct { @@ -169,12 +170,27 @@ func ExtractTSDInfoARM64(code []byte) (TSDInfo, error) { resetReg = destReg switch inst.Op { case aa.MOV: - // Track register moves - srcReg, ok := ah.Xreg2num(inst.Args[1]) - if !ok { - continue + switch val := inst.Args[1].(type) { + case aa.Imm64: + regs[destReg] = regState{ + status: TSDConstant, + offset: int(val.Imm), + multiplier: 1, + } + case aa.Imm: + regs[destReg] = regState{ + status: TSDConstant, + offset: int(val.Imm), + multiplier: 1, + } + default: + // Track register moves + srcReg, ok := ah.Xreg2num(inst.Args[1]) + if !ok { + continue + } + regs[destReg] = regs[srcReg] } - regs[destReg] = regs[srcReg] case aa.MRS: // MRS X1, S3_3_C13_C0_2 if inst.Args[1].String() == "S3_3_C13_C0_2" { @@ -288,7 +304,10 @@ func ExtractTSDInfoARM64(code []byte) (TSDInfo, error) { regStr = fields[0] n, err := fmt.Sscanf(fields[1], " LSL #%v", &shift) if n != 1 || err != nil { - continue + n, err := fmt.Sscanf(fields[1], " UXTW #%v", &shift) + if n != 1 || err != nil { + continue + } } } reg, ok := ah.DecodeRegister(regStr) @@ -306,6 +325,12 @@ func ExtractTSDInfoARM64(code []byte) (TSDInfo, error) { multiplier: regs[srcReg2].multiplier << shift, indirect: regs[srcReg].indirect, } + } else if regs[srcReg].status == TSDConstant && regs[srcReg2].status == TSDIndex { + regs[destReg] = regState{ + status: TSDIndex, + offset: regs[srcReg].offset + regs[srcReg2].offset< // b.pmore + 0x28, 0x02, 0x00, 0x54, + // mov x0, #0xfffffffffffff9d0 // #-1584 + 0xe0, 0xc5, 0x80, 0x92, + 0x42, 0xd0, 0x3b, 0xd5, // mrs x2, tpidr_el0 + 0x00, 0x50, 0x21, 0x8b, // add x0, x0, w1, uxtw #4 + 0x42, 0x00, 0x00, 0x8b, // add x2, x2, x0 + 0x40, 0x04, 0x40, 0xf9, // ldr x0, [x2, #8] + // cbz x0, 91dcc <__pthread_getspecific@GLIBC_2.17+0x8c> + 0x00, 0x03, 0x00, 0xb4, + 0x21, 0x7c, 0x7c, 0xd3, // ubfiz x1, x1, #4, #32 + 0x83, 0x09, 0x00, 0xb0, // adrp x3, 1c2000 + 0x63, 0x40, 0x17, 0x91, // add x3, x3, #0x5d0 + 0x44, 0x00, 0x40, 0xf9, // ldr x4, [x2] + 0x61, 0x68, 0x61, 0xf8, // ldr x1, [x3, x1] + 0x3f, 0x00, 0x04, 0xeb, // cmp x1, x4 + // b.ne 91dc8 <__pthread_getspecific@GLIBC_2.17+0x88> // b.any + 0x01, 0x02, 0x00, 0x54, + 0xfd, 0x7b, 0xc1, 0xa8, // ldp x29, x30, [sp], #16 + 0xbf, 0x23, 0x03, 0xd5, // autiasp + 0xc0, 0x03, 0x5f, 0xd6, // ret + // code skipped handling keys >0x1f + }, + info: TSDInfo{ + Offset: -1584 + 8, + Multiplier: 16, + }, + }, "booking coredump glibc": { machine: elf.EM_X86_64, code: []byte{ diff --git a/tpbase/tpbase.go b/tpbase/tpbase.go index 9a6ecc27..f9aea289 100644 --- a/tpbase/tpbase.go +++ b/tpbase/tpbase.go @@ -7,7 +7,7 @@ // relative to the 'struct task_struct'. This is needed to support Thread Local // Storage access in eBPF. -package tpbase +package tpbase // import "go.opentelemetry.io/ebpf-profiler/tpbase" type Analyzer struct { // FunctionName is the kernel function which can be analyzed diff --git a/tracehandler/metrics.go b/tracehandler/metrics.go index f71a8c89..055d40df 100644 --- a/tracehandler/metrics.go +++ b/tracehandler/metrics.go @@ -1,9 +1,9 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tracehandler +package tracehandler // import "go.opentelemetry.io/ebpf-profiler/tracehandler" -import "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" +import "go.opentelemetry.io/ebpf-profiler/metrics" func (m *traceHandler) collectMetrics() { metrics.AddSlice([]metrics.Metric{ diff --git a/tracehandler/tracehandler.go b/tracehandler/tracehandler.go index 4dd85296..c1a6e391 100644 --- a/tracehandler/tracehandler.go +++ b/tracehandler/tracehandler.go @@ -3,7 +3,7 @@ // Package tracehandler converts raw BPF traces into the enriched user-mode // format and then forwards them to the reporter. -package tracehandler +package tracehandler // import "go.opentelemetry.io/ebpf-profiler/tracehandler" import ( "context" @@ -13,11 +13,11 @@ import ( lru "github.com/elastic/go-freelru" log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/times" + "go.opentelemetry.io/ebpf-profiler/times" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/reporter" ) // metadataWarnInhibDuration defines the minimum duration between warnings printed diff --git a/tracehandler/tracehandler_test.go b/tracehandler/tracehandler_test.go index 01d478df..42579063 100644 --- a/tracehandler/tracehandler_test.go +++ b/tracehandler/tracehandler_test.go @@ -11,11 +11,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/times" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracehandler" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/times" + "go.opentelemetry.io/ebpf-profiler/tracehandler" ) type fakeTimes struct { diff --git a/tracer/ebpf_integration_test.go b/tracer/ebpf_integration_test.go index 28db0ed4..d85e6512 100644 --- a/tracer/ebpf_integration_test.go +++ b/tracer/ebpf_integration_test.go @@ -17,12 +17,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/rlimit" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" - tracertypes "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracer/types" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/rlimit" + "go.opentelemetry.io/ebpf-profiler/support" + tracertypes "go.opentelemetry.io/ebpf-profiler/tracer/types" ) // forceContextSwitch makes sure two Go threads are running concurrently @@ -91,9 +91,9 @@ func (f mockIntervals) PIDCleanupInterval() time.Duration { return 1 * time.Seco type mockReporter struct{} -func (f mockReporter) ExecutableMetadata(_ libpf.FileID, _, _ string, - _ libpf.InterpreterType, _ reporter.ExecutableOpener) { +func (f mockReporter) ExecutableMetadata(_ *reporter.ExecutableMetadataArgs) { } + func (f mockReporter) ReportFallbackSymbol(_ libpf.FrameID, _ string) {} func (f mockReporter) FrameMetadata(_ libpf.FileID, _ libpf.AddressOrLineno, _ libpf.SourceLineno, _ uint32, _, _ string) { diff --git a/tracer/events.go b/tracer/events.go index 50cdfd75..863bb10f 100644 --- a/tracer/events.go +++ b/tracer/events.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tracer +package tracer // import "go.opentelemetry.io/ebpf-profiler/tracer" import ( "context" @@ -15,9 +15,9 @@ import ( "github.com/cilium/ebpf/perf" log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/process" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/metrics" + "go.opentelemetry.io/ebpf-profiler/process" + "go.opentelemetry.io/ebpf-profiler/support" ) /* diff --git a/tracer/helper.go b/tracer/helper.go index 454e8ef6..99d93a38 100644 --- a/tracer/helper.go +++ b/tracer/helper.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tracer +package tracer // import "go.opentelemetry.io/ebpf-profiler/tracer" import ( "fmt" diff --git a/tracer/maccess.go b/tracer/maccess.go index 68a00e47..37633688 100644 --- a/tracer/maccess.go +++ b/tracer/maccess.go @@ -1,15 +1,15 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tracer +package tracer // import "go.opentelemetry.io/ebpf-profiler/tracer" import ( "runtime" cebpf "github.com/cilium/ebpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/maccess" log "github.com/sirupsen/logrus" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/maccess" ) // checkForMmaccessPatch validates if a Linux kernel function is patched by diff --git a/tracer/probe_linux.go b/tracer/probe_linux.go index 838a657b..8c37a22c 100644 --- a/tracer/probe_linux.go +++ b/tracer/probe_linux.go @@ -4,7 +4,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tracer +package tracer // import "go.opentelemetry.io/ebpf-profiler/tracer" import ( "bytes" @@ -13,8 +13,8 @@ import ( "os" "strings" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/rlimit" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/rlimit" + "go.opentelemetry.io/ebpf-profiler/util" "golang.org/x/sys/unix" diff --git a/tracer/probe_other.go b/tracer/probe_other.go index f90b280c..3d974921 100644 --- a/tracer/probe_other.go +++ b/tracer/probe_other.go @@ -4,7 +4,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tracer +package tracer // import "go.opentelemetry.io/ebpf-profiler/tracer" import ( "fmt" diff --git a/tracer/systemconfig.go b/tracer/systemconfig.go index 514f89a0..7fab17be 100644 --- a/tracer/systemconfig.go +++ b/tracer/systemconfig.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tracer +package tracer // import "go.opentelemetry.io/ebpf-profiler/tracer" import ( "encoding/binary" @@ -12,16 +12,16 @@ import ( "strings" "unsafe" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/rlimit" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracer/types" + "go.opentelemetry.io/ebpf-profiler/rlimit" + "go.opentelemetry.io/ebpf-profiler/tracer/types" cebpf "github.com/cilium/ebpf" "github.com/cilium/ebpf/btf" "github.com/cilium/ebpf/link" log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/pacmask" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/pacmask" ) // #include "../support/ebpf/types.h" diff --git a/tracer/tpbase.go b/tracer/tpbase.go index 60fd0959..f39f2d06 100644 --- a/tracer/tpbase.go +++ b/tracer/tpbase.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tracer +package tracer // import "go.opentelemetry.io/ebpf-profiler/tracer" import ( "encoding/hex" @@ -11,8 +11,8 @@ import ( cebpf "github.com/cilium/ebpf" log "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tpbase" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/tpbase" ) // This file contains code to extract the offset of the thread pointer base variable in diff --git a/tracer/tracepoints.go b/tracer/tracepoints.go index e663c852..dc812c93 100644 --- a/tracer/tracepoints.go +++ b/tracer/tracepoints.go @@ -1,14 +1,14 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package tracer +package tracer // import "go.opentelemetry.io/ebpf-profiler/tracer" import ( "fmt" "github.com/cilium/ebpf" "github.com/cilium/ebpf/link" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/rlimit" + "go.opentelemetry.io/ebpf-profiler/rlimit" ) // attachToTracepoint attaches an eBPF program of type tracepoint to a tracepoint in the kernel diff --git a/tracer/tracer.go b/tracer/tracer.go index 3ffc6f12..24af94f2 100644 --- a/tracer/tracer.go +++ b/tracer/tracer.go @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // Package tracer contains functionality for populating tracers. -package tracer +package tracer // import "go.opentelemetry.io/ebpf-profiler/tracer" import ( "bufio" @@ -25,23 +25,23 @@ import ( log "github.com/sirupsen/logrus" "github.com/zeebo/xxh3" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/host" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/pfelf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/xsync" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/nativeunwind/elfunwindinfo" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/periodiccaller" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/proc" - pm "github.com/open-telemetry/opentelemetry-ebpf-profiler/processmanager" - pmebpf "github.com/open-telemetry/opentelemetry-ebpf-profiler/processmanager/ebpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/reporter" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/rlimit" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/times" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracehandler" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/tracer/types" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/util" + "go.opentelemetry.io/ebpf-profiler/host" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf/pfelf" + "go.opentelemetry.io/ebpf-profiler/libpf/xsync" + "go.opentelemetry.io/ebpf-profiler/metrics" + "go.opentelemetry.io/ebpf-profiler/nativeunwind/elfunwindinfo" + "go.opentelemetry.io/ebpf-profiler/periodiccaller" + "go.opentelemetry.io/ebpf-profiler/proc" + pm "go.opentelemetry.io/ebpf-profiler/processmanager" + pmebpf "go.opentelemetry.io/ebpf-profiler/processmanager/ebpf" + "go.opentelemetry.io/ebpf-profiler/reporter" + "go.opentelemetry.io/ebpf-profiler/rlimit" + "go.opentelemetry.io/ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/times" + "go.opentelemetry.io/ebpf-profiler/tracehandler" + "go.opentelemetry.io/ebpf-profiler/tracer/types" + "go.opentelemetry.io/ebpf-profiler/util" ) /* @@ -197,7 +197,13 @@ func processKernelModulesMetadata(rep reporter.SymbolReporter, kernelModules *li } result[nameStr] = fileID - rep.ExecutableMetadata(fileID, nameStr, buildID, libpf.Kernel, nil) + rep.ExecutableMetadata(&reporter.ExecutableMetadataArgs{ + FileID: fileID, + FileName: nameStr, + GnuBuildID: buildID, + DebuglinkFileName: "", + Interp: libpf.Kernel, + }) }) return result, nil diff --git a/tracer/types/parse.go b/tracer/types/parse.go index eb04c2c9..fbe7787a 100644 --- a/tracer/types/parse.go +++ b/tracer/types/parse.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package types +package types // import "go.opentelemetry.io/ebpf-profiler/tracer/types" import ( "fmt" diff --git a/traceutil/traceutil.go b/traceutil/traceutil.go index 35847229..6768b7e1 100644 --- a/traceutil/traceutil.go +++ b/traceutil/traceutil.go @@ -1,13 +1,13 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package traceutil +package traceutil // import "go.opentelemetry.io/ebpf-profiler/traceutil" import ( "hash/fnv" "strconv" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/libpf" ) // HashTrace calculates the hash of a trace and returns it. diff --git a/traceutil/traceutil_test.go b/traceutil/traceutil_test.go index b8d7d7f8..6bd65916 100644 --- a/traceutil/traceutil_test.go +++ b/traceutil/traceutil_test.go @@ -6,8 +6,8 @@ package traceutil import ( "testing" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/support" + "go.opentelemetry.io/ebpf-profiler/libpf" + "go.opentelemetry.io/ebpf-profiler/support" "github.com/stretchr/testify/assert" ) diff --git a/util/util.go b/util/util.go index ca489fc6..26fa723f 100644 --- a/util/util.go +++ b/util/util.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package util +package util // import "go.opentelemetry.io/ebpf-profiler/util" import ( "math/bits" @@ -12,7 +12,7 @@ import ( "github.com/sirupsen/logrus" - "github.com/open-telemetry/opentelemetry-ebpf-profiler/libpf/hash" + "go.opentelemetry.io/ebpf-profiler/libpf/hash" ) // HexToUint64 is a convenience function to extract a hex string to a uint64 and diff --git a/vc/vc.go b/vc/vc.go index e0921e2c..a66bafdd 100644 --- a/vc/vc.go +++ b/vc/vc.go @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // Package vc provides buildtime information. -package vc +package vc // import "go.opentelemetry.io/ebpf-profiler/vc" var ( // The following variables are going to be set at link time using ldflags diff --git a/zydis/zydis.go b/zydis/zydis.go index 80129227..a82e9cf4 100644 --- a/zydis/zydis.go +++ b/zydis/zydis.go @@ -1,4 +1,4 @@ // Package zydis simply builds and links the Zydis library via CGo. -package zydis +package zydis // import "go.opentelemetry.io/ebpf-profiler/zydis" import "C"