From b26886300ccba81983df97b2442b680919e95c41 Mon Sep 17 00:00:00 2001 From: Goutham Veeramachaneni Date: Fri, 20 Jan 2023 10:06:30 +0100 Subject: [PATCH] [otlp] Update OTel Collector to latest release (#3852) * [otlp] Update otel collector dependecy to latest * Update code to deal with deprecated functions Signed-off-by: Goutham Veeramachaneni --- go.mod | 17 +- go.sum | 40 +- pkg/util/push/otel.go | 20 +- pkg/util/push/push_test.go | 48 +- .../pkg/translator/prometheus/README.md | 2 +- .../translator/prometheus/normalize_label.go | 19 +- .../translator/prometheus/normalize_name.go | 101 +- .../prometheusremotewrite/helper.go | 133 +- .../prometheusremotewrite/metrics_to_prw.go | 17 +- .../collector/featuregate/LICENSE | 202 ++ .../collector/featuregate/Makefile | 1 + .../{service => }/featuregate/README.md | 22 +- .../{service => }/featuregate/flags.go | 9 +- .../collector/featuregate/gate.go | 56 + .../collector/featuregate/registry.go | 154 ++ .../collector/featuregate/stage.go | 48 + .../collector/pdata/internal/common.go | 926 --------- .../collector/pdata/internal/data/bytesid.go | 11 - .../collector/logs/v1/logs_service.pb.go | 332 +++- .../metrics/v1/metrics_service.pb.go | 332 +++- .../collector/trace/v1/trace_config.pb.go | 1250 ------------ .../collector/trace/v1/trace_service.pb.go | 331 +++- .../data/protogen/common/v1/common.pb.go | 327 +-- .../internal/data/protogen/logs/v1/logs.pb.go | 480 +---- .../data/protogen/metrics/v1/metrics.pb.go | 692 ++----- .../data/protogen/resource/v1/resource.pb.go | 9 +- .../data/protogen/trace/v1/trace.pb.go | 508 +---- .../collector/pdata/internal/data/spanid.go | 60 +- .../collector/pdata/internal/data/traceid.go | 62 +- .../internal/generated_immutable_slice.go | 126 -- .../internal/generated_wrapper_common.go | 74 + .../pdata/internal/generated_wrapper_logs.go | 186 ++ .../internal/generated_wrapper_logs_otlp.go | 46 + .../internal/generated_wrapper_metrics.go | 661 ++++++ .../generated_wrapper_metrics_otlp.go | 46 + .../generated_wrapper_primitive_slice.go | 54 + .../generated_wrapper_resource.go} | 38 +- .../internal/generated_wrapper_traces.go | 322 +++ .../internal/generated_wrapper_traces_otlp.go | 46 + .../pdata/internal/json/attribute.go | 121 ++ .../collector/pdata/internal/json/enum.go | 40 + .../collector/pdata/internal/json/number.go | 114 ++ .../collector/pdata/internal/json/resource.go | 38 + .../collector/pdata/internal/json/scope.go | 42 + .../collector/pdata/internal/logs.go | 123 -- .../collector/pdata/internal/metrics.go | 390 ---- .../collector/pdata/internal/otlp/logs.go | 26 +- .../collector/pdata/internal/otlp/metrics.go | 26 +- .../collector/pdata/internal/otlp/traces.go | 26 +- .../pdata/internal/wrapper_common.go | 89 + .../collector/pdata/internal/wrapper_logs.go | 46 + .../pdata/internal/wrapper_metrics.go | 46 + .../pdata/internal/wrapper_traces.go | 46 + .../collector/pdata/pcommon/alias.go | 92 - .../collector/pdata/pcommon/common.go | 833 ++++++++ .../{internal => pcommon}/generated_common.go | 123 +- .../pdata/pcommon/generated_common_alias.go | 45 - .../generated_immutable_slice_alias.go | 38 - .../pcommon/generated_primitive_slice.go | 275 +++ .../generated_resource.go | 28 +- .../pdata/{internal => pcommon}/spanid.go | 44 +- .../collector/pdata/pcommon/spanid_alias.go | 26 - .../pdata/{internal => pcommon}/timestamp.go | 2 +- .../pdata/pcommon/timestamp_alias.go | 24 - .../collector/pdata/pcommon/trace_state.go | 52 + .../pdata/{internal => pcommon}/traceid.go | 43 +- .../collector/pdata/pcommon/traceid_alias.go | 26 - .../collector/pdata/plog/alias.go | 57 - .../collector/pdata/plog/encoding.go | 6 + .../collector/pdata/plog/generated_alias.go | 96 - .../generated_logs.go} | 415 ++-- .../pdata/plog/internal/plogjson/json.go | 189 ++ .../collector/pdata/plog/json.go | 45 +- .../collector/pdata/plog/log_record_flags.go | 39 + .../collector/pdata/plog/logs.go | 158 ++ .../collector/pdata/plog/pb.go | 37 +- .../collector/pdata/pmetric/alias.go | 104 - .../collector/pdata/pmetric/encoding.go | 6 + .../pdata/pmetric/generated_alias.go | 325 --- .../generated_metrics.go} | 1765 +++++++++-------- .../pmetric/internal/pmetricjson/json.go | 527 +++++ .../collector/pdata/pmetric/json.go | 44 +- .../pdata/pmetric/metric_data_point_flags.go | 39 + .../collector/pdata/pmetric/metrics.go | 203 ++ .../collector/pdata/pmetric/pb.go | 37 +- .../pmetricotlp/generated_metrics_otlp.go | 82 + .../pdata/pmetric/pmetricotlp/grpc.go | 73 + .../pdata/pmetric/pmetricotlp/metrics.go | 164 -- .../pdata/pmetric/pmetricotlp/request.go | 70 + .../pdata/pmetric/pmetricotlp/response.go | 61 + .../collector/pdata/ptrace/alias.go | 80 - .../collector/pdata/ptrace/encoding.go | 6 + .../collector/pdata/ptrace/generated_alias.go | 162 -- .../generated_traces.go} | 770 ++++--- .../pdata/ptrace/internal/ptracejson/json.go | 268 +++ .../collector/pdata/ptrace/json.go | 384 +--- .../collector/pdata/ptrace/pb.go | 37 +- .../pdata/{internal => ptrace}/traces.go | 104 +- .../collector/service/featuregate/gates.go | 114 -- vendor/go.uber.org/multierr/CHANGELOG.md | 8 + vendor/go.uber.org/multierr/error.go | 345 ++-- vendor/golang.org/x/net/http2/flow.go | 88 +- vendor/golang.org/x/net/http2/server.go | 85 +- vendor/golang.org/x/net/http2/transport.go | 86 +- .../golang.org/x/sys/cpu/cpu_linux_arm64.go | 44 +- vendor/golang.org/x/sys/cpu/parse.go | 43 + .../x/sys/cpu/proc_cpuinfo_linux.go | 54 + vendor/golang.org/x/sys/unix/gccgo.go | 4 +- vendor/golang.org/x/sys/unix/gccgo_c.c | 4 +- vendor/golang.org/x/sys/unix/ioctl.go | 4 +- vendor/golang.org/x/sys/unix/mkall.sh | 4 +- .../x/sys/unix/syscall_dragonfly.go | 1 + .../golang.org/x/sys/unix/syscall_freebsd.go | 1 + vendor/golang.org/x/sys/unix/syscall_hurd.go | 22 + .../golang.org/x/sys/unix/syscall_hurd_386.go | 29 + vendor/golang.org/x/sys/unix/syscall_linux.go | 50 +- .../golang.org/x/sys/unix/syscall_netbsd.go | 15 + .../golang.org/x/sys/unix/syscall_openbsd.go | 1 + .../x/sys/unix/syscall_openbsd_libc.go | 4 +- .../golang.org/x/sys/unix/syscall_solaris.go | 1 + vendor/golang.org/x/sys/unix/syscall_unix.go | 55 +- .../x/sys/unix/zerrors_openbsd_386.go | 356 +++- .../x/sys/unix/zerrors_openbsd_amd64.go | 189 +- .../x/sys/unix/zerrors_openbsd_arm.go | 348 +++- .../x/sys/unix/zerrors_openbsd_arm64.go | 160 +- .../x/sys/unix/zerrors_openbsd_mips64.go | 95 +- .../x/sys/unix/zsyscall_dragonfly_amd64.go | 10 + .../x/sys/unix/zsyscall_freebsd_386.go | 10 + .../x/sys/unix/zsyscall_freebsd_amd64.go | 10 + .../x/sys/unix/zsyscall_freebsd_arm.go | 10 + .../x/sys/unix/zsyscall_freebsd_arm64.go | 10 + .../x/sys/unix/zsyscall_freebsd_riscv64.go | 10 + .../x/sys/unix/zsyscall_netbsd_386.go | 10 + .../x/sys/unix/zsyscall_netbsd_amd64.go | 10 + .../x/sys/unix/zsyscall_netbsd_arm.go | 10 + .../x/sys/unix/zsyscall_netbsd_arm64.go | 10 + .../x/sys/unix/zsyscall_openbsd_386.go | 14 + .../x/sys/unix/zsyscall_openbsd_386.s | 137 +- .../x/sys/unix/zsyscall_openbsd_amd64.go | 14 + .../x/sys/unix/zsyscall_openbsd_amd64.s | 137 +- .../x/sys/unix/zsyscall_openbsd_arm.go | 14 + .../x/sys/unix/zsyscall_openbsd_arm.s | 137 +- .../x/sys/unix/zsyscall_openbsd_arm64.go | 14 + .../x/sys/unix/zsyscall_openbsd_arm64.s | 137 +- .../x/sys/unix/zsyscall_openbsd_mips64.go | 812 ++++++-- .../x/sys/unix/zsyscall_openbsd_mips64.s | 669 +++++++ .../x/sys/unix/zsyscall_openbsd_ppc64.go | 14 + .../x/sys/unix/zsyscall_openbsd_ppc64.s | 6 + .../x/sys/unix/zsyscall_openbsd_riscv64.go | 14 + .../x/sys/unix/zsyscall_openbsd_riscv64.s | 137 +- .../x/sys/unix/zsyscall_solaris_amd64.go | 13 + .../x/sys/unix/zsysctl_openbsd_386.go | 51 +- .../x/sys/unix/zsysctl_openbsd_amd64.go | 17 +- .../x/sys/unix/zsysctl_openbsd_arm.go | 51 +- .../x/sys/unix/zsysctl_openbsd_arm64.go | 11 +- .../x/sys/unix/zsysctl_openbsd_mips64.go | 3 +- .../x/sys/unix/zsysnum_openbsd_mips64.go | 1 + .../x/sys/unix/ztypes_netbsd_386.go | 84 + .../x/sys/unix/ztypes_netbsd_amd64.go | 84 + .../x/sys/unix/ztypes_netbsd_arm.go | 84 + .../x/sys/unix/ztypes_netbsd_arm64.go | 84 + .../x/sys/unix/ztypes_openbsd_386.go | 97 +- .../x/sys/unix/ztypes_openbsd_amd64.go | 33 +- .../x/sys/unix/ztypes_openbsd_arm.go | 9 +- .../x/sys/unix/ztypes_openbsd_arm64.go | 9 +- .../x/sys/unix/ztypes_openbsd_mips64.go | 9 +- vendor/modules.txt | 34 +- 167 files changed, 12527 insertions(+), 9698 deletions(-) create mode 100644 vendor/go.opentelemetry.io/collector/featuregate/LICENSE create mode 100644 vendor/go.opentelemetry.io/collector/featuregate/Makefile rename vendor/go.opentelemetry.io/collector/{service => }/featuregate/README.md (75%) rename vendor/go.opentelemetry.io/collector/{service => }/featuregate/flags.go (89%) create mode 100644 vendor/go.opentelemetry.io/collector/featuregate/gate.go create mode 100644 vendor/go.opentelemetry.io/collector/featuregate/registry.go create mode 100644 vendor/go.opentelemetry.io/collector/featuregate/stage.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/common.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1/trace_config.pb.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/generated_immutable_slice.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_common.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_logs.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_logs_otlp.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_metrics.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_metrics_otlp.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_primitive_slice.go rename vendor/go.opentelemetry.io/collector/pdata/{pcommon/generated_resource_alias.go => internal/generated_wrapper_resource.go} (55%) create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_traces.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_traces_otlp.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/json/attribute.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/json/enum.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/json/number.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/json/resource.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/json/scope.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/logs.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/metrics.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_common.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_logs.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_metrics.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_traces.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/pcommon/alias.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/pcommon/common.go rename vendor/go.opentelemetry.io/collector/pdata/{internal => pcommon}/generated_common.go (61%) delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_common_alias.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_immutable_slice_alias.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_primitive_slice.go rename vendor/go.opentelemetry.io/collector/pdata/{internal => pcommon}/generated_resource.go (77%) rename vendor/go.opentelemetry.io/collector/pdata/{internal => pcommon}/spanid.go (52%) delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/pcommon/spanid_alias.go rename vendor/go.opentelemetry.io/collector/pdata/{internal => pcommon}/timestamp.go (94%) delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/pcommon/timestamp_alias.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/pcommon/trace_state.go rename vendor/go.opentelemetry.io/collector/pdata/{internal => pcommon}/traceid.go (52%) delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/pcommon/traceid_alias.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/plog/alias.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/plog/generated_alias.go rename vendor/go.opentelemetry.io/collector/pdata/{internal/generated_plog.go => plog/generated_logs.go} (63%) create mode 100644 vendor/go.opentelemetry.io/collector/pdata/plog/internal/plogjson/json.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/plog/log_record_flags.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/plog/logs.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/pmetric/alias.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_alias.go rename vendor/go.opentelemetry.io/collector/pdata/{internal/generated_pmetric.go => pmetric/generated_metrics.go} (56%) create mode 100644 vendor/go.opentelemetry.io/collector/pdata/pmetric/internal/pmetricjson/json.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/pmetric/metric_data_point_flags.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/pmetric/metrics.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/generated_metrics_otlp.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/grpc.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/metrics.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/request.go create mode 100644 vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/response.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/ptrace/alias.go delete mode 100644 vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_alias.go rename vendor/go.opentelemetry.io/collector/pdata/{internal/generated_ptrace.go => ptrace/generated_traces.go} (61%) create mode 100644 vendor/go.opentelemetry.io/collector/pdata/ptrace/internal/ptracejson/json.go rename vendor/go.opentelemetry.io/collector/pdata/{internal => ptrace}/traces.go (63%) delete mode 100644 vendor/go.opentelemetry.io/collector/service/featuregate/gates.go create mode 100644 vendor/golang.org/x/sys/cpu/parse.go create mode 100644 vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_hurd.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_hurd_386.go create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s diff --git a/go.mod b/go.mod index 5b0f93f9f5e..4781a149c51 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ require ( go.uber.org/atomic v1.10.0 go.uber.org/goleak v1.2.0 golang.org/x/crypto v0.3.0 - golang.org/x/net v0.4.0 + golang.org/x/net v0.5.0 golang.org/x/sync v0.1.0 golang.org/x/time v0.3.0 google.golang.org/grpc v1.51.0 @@ -60,14 +60,14 @@ require ( github.com/grafana-tools/sdk v0.0.0-20211220201350-966b3088eec9 github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.57.2 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.69.0 github.com/thanos-io/objstore v0.0.0-20221213124554-e4d8ba6bc6f3 - go.opentelemetry.io/collector/pdata v0.57.2 + go.opentelemetry.io/collector/pdata v1.0.0-rc3.0.20230109164642-7d168dd20efd go.opentelemetry.io/otel v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 - go.uber.org/multierr v1.8.0 + go.uber.org/multierr v1.9.0 golang.org/x/exp v0.0.0-20221212164502-fae10dda9338 - golang.org/x/sys v0.3.0 + golang.org/x/sys v0.4.0 google.golang.org/api v0.104.0 gopkg.in/alecthomas/kingpin.v2 v2.2.6 sigs.k8s.io/kustomize/kyaml v0.13.7 @@ -180,7 +180,7 @@ require ( github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/ncw/swift v1.0.53 // indirect github.com/oklog/run v1.1.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.57.2 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.69.0 // indirect github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/common/sigv4 v0.1.0 // indirect @@ -206,13 +206,14 @@ require ( go.mongodb.org/mongo-driver v1.11.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.57.2 // indirect - go.opentelemetry.io/collector/semconv v0.57.2 // indirect + go.opentelemetry.io/collector/featuregate v0.69.0 // indirect + go.opentelemetry.io/collector/semconv v0.69.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0 // indirect go.opentelemetry.io/otel/metric v0.34.0 // indirect go.uber.org/zap v1.21.0 // indirect golang.org/x/mod v0.7.0 // indirect golang.org/x/oauth2 v0.3.0 // indirect - golang.org/x/text v0.5.0 // indirect + golang.org/x/text v0.6.0 // indirect golang.org/x/tools v0.4.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index 9d648a97cea..8869c2d5ad0 100644 --- a/go.sum +++ b/go.sum @@ -725,12 +725,12 @@ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.24.0 h1:+0glovB9Jd6z3VR+ScSwQqXVTIfJcGA9UBM8yzQxhqg= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.57.2 h1:DBdJtRrjhzx7zuqFAjAXs90gJJ4IgIxYKvnlr54nQfg= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.57.2 h1:4HeNNbZnqz15hj4oGm1O1x+yP+hPnvhz2UYqrApvPDk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.57.2 h1:po61A+HQ1KnJ/s3TuOQGMo1haiKjDS/oh7QuBhoCfMY= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.57.2/go.mod h1:e2DoTAc1lTBWM06sptbNqEAuSzajjnK6vrtWKYebhAM= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.57.2 h1:YcDLWVe2XmeawzGu5Yo/ykpuSpGMxIPFwNLm4MZr+38= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.57.2/go.mod h1:usczt8Eymx/wg3hHWBksX/fWZ5VGdVgli8FM7sFmyCw= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.69.0 h1:dFApx4qc1INp2e14m9IeQaF0XVTQChuWX3wYNAYhamQ= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.69.0 h1:XRJPHV+JHf+8PGVd9UncG+S3w1Ym39Ztu8ZGE0ZXmxE= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.69.0 h1:YFJj77LUvaxI81Gd85Ko0OA5S0/NV10gSG6utbi5/3M= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.69.0/go.mod h1:/6u/f+pwP618Uo5PCv42Py++BfGas2dP4I8U0C4Z/0I= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.69.0 h1:1KdOrloLENn8OXnFZpg3ixhgt6RnL/rbSokuoD2nUyY= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.69.0/go.mod h1:JOUp6I3dlrtXffEUS74ZBsRq5z03axnf0CRyjPwFkVM= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02/go.mod h1:JNdpVEzCpXBgIiv4ds+TzhN1hrtxq6ClLrTlT9OQRSc= @@ -942,10 +942,12 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/collector v0.57.2 h1:/J7twI5BlIK3I4GfDfLhqPgfgSjnhiDesXf24bmrXYM= go.opentelemetry.io/collector v0.57.2/go.mod h1:9TwWyMRhbFNzaaGLtm/6poWNDJw+etvQMS6Fy+8/8Xs= -go.opentelemetry.io/collector/pdata v0.57.2 h1:w2w3NE7/3WzHloT1xV5caRmifV3qt95gc5iJhO/Bues= -go.opentelemetry.io/collector/pdata v0.57.2/go.mod h1:RU9I8lwBUxucwOsSYzHEcHi15M9QaX78hgQ2PRdSxV0= -go.opentelemetry.io/collector/semconv v0.57.2 h1:+lcI4yi8xUzoSNZgGTs0vytZcEAH95Tb33Ig+gooBV8= -go.opentelemetry.io/collector/semconv v0.57.2/go.mod h1:84YnUjmm+nhGu4YTDLnHCbxnL74ooWpismPG79tFD7w= +go.opentelemetry.io/collector/featuregate v0.69.0 h1:TI6zcWszEbAP1UGyVIWFDKoltaPx4VprjGbd5jsDBj8= +go.opentelemetry.io/collector/featuregate v0.69.0/go.mod h1:tewuFKJYalWBU0bmNKg++MC1ipINXUr6szYzOw2p1GI= +go.opentelemetry.io/collector/pdata v1.0.0-rc3.0.20230109164642-7d168dd20efd h1:Mv0AhUDD10YS9620bxXBf0zoTkQjwANcaqWJyxr88ks= +go.opentelemetry.io/collector/pdata v1.0.0-rc3.0.20230109164642-7d168dd20efd/go.mod h1:NggifanH3PY9reO9gUtcP8IqNpAabT+aDOCFZoIa7Ts= +go.opentelemetry.io/collector/semconv v0.69.0 h1:B4eMTnWM4ZRQS4RI/SZaTRoDcT6eFVPEymH7qJ31Pmk= +go.opentelemetry.io/collector/semconv v0.69.0/go.mod h1:5o9yhOa+ABt7g2E5JABDxGZ1PQPbtfxrKNbYn+LOTXU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0 h1:yt2NKzK7Vyo6h0+X8BA4FpreZQTlVEIarnsBP/H5mzs= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0/go.mod h1:+ARmXlUlc51J7sZeCBkBJNdHGySrdOzgzxp6VWRWM1U= go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= @@ -966,8 +968,8 @@ go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= @@ -1094,8 +1096,8 @@ golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= -golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1232,12 +1234,12 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= +golang.org/x/term v0.4.0 h1:O7UWfv5+A2qiuulQk30kVinPoMtoIPeVaKLEgLpVkvg= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1248,8 +1250,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/pkg/util/push/otel.go b/pkg/util/push/otel.go index 110890e3335..395759039bb 100644 --- a/pkg/util/push/otel.go +++ b/pkg/util/push/otel.go @@ -48,21 +48,21 @@ func OTLPHandler( discardedDueToOtelParseError := validation.DiscardedSamplesCounter(reg, otelParseError) return handler(maxRecvMsgSize, sourceIPs, allowSkipLabelNameValidation, push, func(ctx context.Context, r *http.Request, maxRecvMsgSize int, dst []byte, req *mimirpb.PreallocWriteRequest) ([]byte, error) { - var decoderFunc func(buf []byte) (pmetricotlp.Request, error) + var decoderFunc func(buf []byte) (pmetricotlp.ExportRequest, error) logger := log.WithContext(ctx, log.Logger) contentType := r.Header.Get("Content-Type") switch contentType { case pbContentType: - decoderFunc = func(buf []byte) (pmetricotlp.Request, error) { - req := pmetricotlp.NewRequest() + decoderFunc = func(buf []byte) (pmetricotlp.ExportRequest, error) { + req := pmetricotlp.NewExportRequest() return req, req.UnmarshalProto(buf) } case jsonContentType: - decoderFunc = func(buf []byte) (pmetricotlp.Request, error) { - req := pmetricotlp.NewRequest() + decoderFunc = func(buf []byte) (pmetricotlp.ExportRequest, error) { + req := pmetricotlp.NewExportRequest() return req, req.UnmarshalJSON(buf) } @@ -199,7 +199,7 @@ func promToMimirTimeseries(promTs *prompb.TimeSeries) mimirpb.PreallocTimeseries } // TimeseriesToOTLPRequest is used in tests. -func TimeseriesToOTLPRequest(timeseries []prompb.TimeSeries) pmetricotlp.Request { +func TimeseriesToOTLPRequest(timeseries []prompb.TimeSeries) pmetricotlp.ExportRequest { d := pmetric.NewMetrics() for _, ts := range timeseries { @@ -212,20 +212,20 @@ func TimeseriesToOTLPRequest(timeseries []prompb.TimeSeries) pmetricotlp.Request continue } - attributes.InsertString(l.Name, l.Value) + attributes.PutStr(l.Name, l.Value) } metric := d.ResourceMetrics().AppendEmpty().ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() metric.SetName(name) - metric.SetDataType(pmetric.MetricDataTypeGauge) + metric.SetEmptyGauge() for _, sample := range ts.Samples { datapoint := metric.Gauge().DataPoints().AppendEmpty() datapoint.SetTimestamp(pcommon.NewTimestampFromTime(time.Unix(0, int64(sample.Timestamp)*1000000))) - datapoint.SetDoubleVal(sample.Value) + datapoint.SetDoubleValue(sample.Value) attributes.CopyTo(datapoint.Attributes()) } } - return pmetricotlp.NewRequestFromMetrics(d) + return pmetricotlp.NewExportRequestFromMetrics(d) } diff --git a/pkg/util/push/push_test.go b/pkg/util/push/push_test.go index 2713ad12403..086bfc3c4d6 100644 --- a/pkg/util/push/push_test.go +++ b/pkg/util/push/push_test.go @@ -58,35 +58,35 @@ func TestHandler_otlpDroppedMetricsPanic(t *testing.T) { md := pmetric.NewMetrics() const name = "foo" attributes := pcommon.NewMap() - attributes.InsertString(model.MetricNameLabel, name) + attributes.PutStr(model.MetricNameLabel, name) metric1 := md.ResourceMetrics().AppendEmpty().ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() metric1.SetName(name) - metric1.SetDataType(pmetric.MetricDataTypeGauge) + metric1.SetEmptyGauge() datapoint1 := metric1.Gauge().DataPoints().AppendEmpty() datapoint1.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) - datapoint1.SetDoubleVal(0) + datapoint1.SetDoubleValue(0) attributes.CopyTo(datapoint1.Attributes()) - datapoint1.Attributes().InsertString("diff_label", "bar") + datapoint1.Attributes().PutStr("diff_label", "bar") datapoint2 := metric1.Gauge().DataPoints().AppendEmpty() datapoint2.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) - datapoint2.SetDoubleVal(0) + datapoint2.SetDoubleValue(0) attributes.CopyTo(datapoint2.Attributes()) - datapoint2.Attributes().InsertString("diff_label", "baz") + datapoint2.Attributes().PutStr("diff_label", "baz") datapoint3 := metric1.Gauge().DataPoints().AppendEmpty() datapoint3.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) - datapoint3.SetDoubleVal(0) + datapoint3.SetDoubleValue(0) attributes.CopyTo(datapoint3.Attributes()) - datapoint3.Attributes().InsertString("diff_label", "food") + datapoint3.Attributes().PutStr("diff_label", "food") metric2 := md.ResourceMetrics().AppendEmpty().ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() metric2.SetName(name) - metric2.SetDataType(pmetric.MetricDataTypeGauge) + metric2.SetEmptyGauge() - req := createOTLPRequest(t, pmetricotlp.NewRequestFromMetrics(md), false) + req := createOTLPRequest(t, pmetricotlp.NewExportRequestFromMetrics(md), false) resp := httptest.NewRecorder() handler := OTLPHandler(100000, nil, false, nil, func(ctx context.Context, pushReq *Request) (response *mimirpb.WriteResponse, err error) { request, err := pushReq.WriteRequest() @@ -108,25 +108,25 @@ func TestHandler_otlpDroppedMetricsPanic2(t *testing.T) { md := pmetric.NewMetrics() const name = "foo" attributes := pcommon.NewMap() - attributes.InsertString(model.MetricNameLabel, name) + attributes.PutStr(model.MetricNameLabel, name) resource1 := md.ResourceMetrics().AppendEmpty() - resource1.Resource().Attributes().InsertString("region", "us-central1") + resource1.Resource().Attributes().PutStr("region", "us-central1") metric1 := resource1.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() metric1.SetName(name) - metric1.SetDataType(pmetric.MetricDataTypeGauge) + metric1.SetEmptyGauge() datapoint1 := metric1.Gauge().DataPoints().AppendEmpty() datapoint1.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) - datapoint1.SetDoubleVal(0) + datapoint1.SetDoubleValue(0) attributes.CopyTo(datapoint1.Attributes()) - datapoint1.Attributes().InsertString("diff_label", "bar") + datapoint1.Attributes().PutStr("diff_label", "bar") metric2 := resource1.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() metric2.SetName(name) - metric2.SetDataType(pmetric.MetricDataTypeGauge) + metric2.SetEmptyGauge() - req := createOTLPRequest(t, pmetricotlp.NewRequestFromMetrics(md), false) + req := createOTLPRequest(t, pmetricotlp.NewExportRequestFromMetrics(md), false) resp := httptest.NewRecorder() handler := OTLPHandler(100000, nil, false, nil, func(ctx context.Context, pushReq *Request) (response *mimirpb.WriteResponse, err error) { request, err := pushReq.WriteRequest() @@ -142,17 +142,17 @@ func TestHandler_otlpDroppedMetricsPanic2(t *testing.T) { // Second case is to make sure that histogram metrics are counted correctly. metric3 := resource1.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() metric3.SetName("http_request_duration_seconds") - metric3.SetDataType(pmetric.MetricDataTypeHistogram) - metric3.Histogram().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) + metric3.SetEmptyHistogram() + metric3.Histogram().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative) datapoint3 := metric3.Histogram().DataPoints().AppendEmpty() datapoint3.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) datapoint3.SetCount(50) datapoint3.SetSum(100) - datapoint3.SetExplicitBounds(pcommon.NewImmutableFloat64Slice([]float64{0.1, 0.2, 0.3, 0.4, 0.5})) - datapoint3.SetBucketCounts(pcommon.NewImmutableUInt64Slice([]uint64{10, 20, 30, 40, 50})) + datapoint3.ExplicitBounds().FromRaw([]float64{0.1, 0.2, 0.3, 0.4, 0.5}) + datapoint3.BucketCounts().FromRaw([]uint64{10, 20, 30, 40, 50}) attributes.CopyTo(datapoint3.Attributes()) - req = createOTLPRequest(t, pmetricotlp.NewRequestFromMetrics(md), false) + req = createOTLPRequest(t, pmetricotlp.NewExportRequestFromMetrics(md), false) resp = httptest.NewRecorder() handler = OTLPHandler(100000, nil, false, nil, func(ctx context.Context, pushReq *Request) (response *mimirpb.WriteResponse, err error) { request, err := pushReq.WriteRequest() @@ -386,7 +386,7 @@ func createRequest(t testing.TB, protobuf []byte) *http.Request { return req } -func createOTLPRequest(t testing.TB, metricRequest pmetricotlp.Request, compress bool) *http.Request { +func createOTLPRequest(t testing.TB, metricRequest pmetricotlp.ExportRequest, compress bool) *http.Request { t.Helper() rawBytes, err := metricRequest.MarshalProto() @@ -421,7 +421,7 @@ func createOTLPRequest(t testing.TB, metricRequest pmetricotlp.Request, compress return req } -func createOTLPMetricRequest(t testing.TB) pmetricotlp.Request { +func createOTLPMetricRequest(t testing.TB) pmetricotlp.ExportRequest { input := createPrometheusRemoteWriteProtobuf(t) prwReq := &prompb.WriteRequest{} require.NoError(t, proto.Unmarshal(input, prwReq)) diff --git a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus/README.md b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus/README.md index 5512db53ce3..07ffee9b1d2 100644 --- a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus/README.md +++ b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus/README.md @@ -11,7 +11,7 @@ > **Warning** > -> This feature must be enabled with [feature gate](https://github.com/open-telemetry/opentelemetry-collector/tree/main/service/featuregate) `pkg.translator.prometheus.NormalizeName`. It is disabled by default (alpha stage). +> This feature must be enabled with [feature gate](https://github.com/open-telemetry/opentelemetry-collector/tree/main/featuregate) `pkg.translator.prometheus.NormalizeName`. It is disabled by default (alpha stage). > > ```shell-session > $ otelcol --config=config.yaml --feature-gates=pkg.translator.prometheus.NormalizeName diff --git a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus/normalize_label.go b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus/normalize_label.go index aff29369255..ac32e04b928 100644 --- a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus/normalize_label.go +++ b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus/normalize_label.go @@ -1,4 +1,4 @@ -// Copyright The OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,17 +18,18 @@ import ( "strings" "unicode" - "go.opentelemetry.io/collector/service/featuregate" + "go.opentelemetry.io/collector/featuregate" ) -var dropSanitizationGate = featuregate.Gate{ - ID: "pkg.translator.prometheus.PermissiveLabelSanitization", - Enabled: false, - Description: "Controls whether to change labels starting with '_' to 'key_'", -} +const dropSanitizationGate = "pkg.translator.prometheus.PermissiveLabelSanitization" func init() { - featuregate.GetRegistry().MustRegister(dropSanitizationGate) + featuregate.GetRegistry().MustRegisterID( + dropSanitizationGate, + featuregate.StageAlpha, + featuregate.WithRegisterDescription("Controls whether to change labels starting with '_' to 'key_'."), + featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/8950"), + ) } // Normalizes the specified label to follow Prometheus label names standard @@ -51,7 +52,7 @@ func NormalizeLabel(label string) string { // If label starts with a number, prepend with "key_" if unicode.IsDigit(rune(label[0])) { label = "key_" + label - } else if strings.HasPrefix(label, "_") && !strings.HasPrefix(label, "__") && !featuregate.GetRegistry().IsEnabled(dropSanitizationGate.ID) { + } else if strings.HasPrefix(label, "_") && !strings.HasPrefix(label, "__") && !featuregate.GetRegistry().IsEnabled(dropSanitizationGate) { label = "key" + label } diff --git a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus/normalize_name.go b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus/normalize_name.go index 5589f3a6c37..dd68b8db35a 100644 --- a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus/normalize_name.go +++ b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus/normalize_name.go @@ -18,8 +18,8 @@ import ( "strings" "unicode" + "go.opentelemetry.io/collector/featuregate" "go.opentelemetry.io/collector/pdata/pmetric" - "go.opentelemetry.io/collector/service/featuregate" ) // The map to translate OTLP units to Prometheus units @@ -82,15 +82,16 @@ var perUnitMap = map[string]string{ "y": "year", } -var normalizeNameGate = featuregate.Gate{ - ID: "pkg.translator.prometheus.NormalizeName", - Enabled: false, - Description: "Controls whether metrics names are automatically normalized to follow Prometheus naming convention", -} +const normalizeNameGateID = "pkg.translator.prometheus.NormalizeName" func init() { // Register the feature gates - featuregate.GetRegistry().MustRegister(normalizeNameGate) + featuregate.GetRegistry().MustRegisterID( + normalizeNameGateID, + featuregate.StageAlpha, + featuregate.WithRegisterDescription("Controls whether metrics names are automatically normalized to follow Prometheus naming convention"), + featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/8950"), + ) } // Build a Prometheus-compliant metric name for the specified metric @@ -105,12 +106,12 @@ func BuildPromCompliantName(metric pmetric.Metric, namespace string) string { var metricName string // Full normalization following standard Prometheus naming conventions - if featuregate.GetRegistry().IsEnabled(normalizeNameGate.ID) { + if featuregate.GetRegistry().IsEnabled(normalizeNameGateID) { return normalizeName(metric, namespace) } // Simple case (no full normalization, no units, etc.), we simply trim out forbidden chars - metricName = CleanUpString(metric.Name()) + metricName = RemovePromForbiddenRunes(metric.Name()) // Namespace? if namespace != "" { @@ -163,7 +164,7 @@ func normalizeName(metric pmetric.Metric, namespace string) string { } // Append _total for Counters - if metric.DataType() == pmetric.MetricDataTypeSum && metric.Sum().IsMonotonic() { + if metric.Type() == pmetric.MetricTypeSum && metric.Sum().IsMonotonic() { nameTokens = append(removeItem(nameTokens, "total"), "total") } @@ -172,7 +173,7 @@ func normalizeName(metric pmetric.Metric, namespace string) string { // See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aissue+some+metric+units+don%27t+follow+otel+semantic+conventions // Until these issues have been fixed, we're appending `_ratio` for gauges ONLY // Theoretically, counters could be ratios as well, but it's absurd (for mathematical reasons) - if metric.Unit() == "1" && metric.DataType() == pmetric.MetricDataTypeGauge { + if metric.Unit() == "1" && metric.Type() == pmetric.MetricTypeGauge { nameTokens = append(removeItem(nameTokens, "ratio"), "ratio") } @@ -192,11 +193,89 @@ func normalizeName(metric pmetric.Metric, namespace string) string { return normalizedName } +type Normalizer struct { + registry *featuregate.Registry +} + +func NewNormalizer(registry *featuregate.Registry) *Normalizer { + return &Normalizer{ + registry: registry, + } +} + +// TrimPromSuffixes trims type and unit prometheus suffixes from a metric name. +// Following the [OpenTelemetry specs] for converting Prometheus Metric points to OTLP. +// +// [OpenTelemetry specs]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/data-model.md#metric-metadata +func (n *Normalizer) TrimPromSuffixes(promName string, metricType pmetric.MetricType, unit string) string { + if !n.registry.IsEnabled(normalizeNameGateID) { + return promName + } + + nameTokens := strings.Split(promName, "_") + if len(nameTokens) == 1 { + return promName + } + + nameTokens = removeTypeSuffixes(nameTokens, metricType) + nameTokens = removeUnitSuffixes(nameTokens, unit) + + return strings.Join(nameTokens, "_") +} + +func removeTypeSuffixes(tokens []string, metricType pmetric.MetricType) []string { + switch metricType { + case pmetric.MetricTypeSum: + // Only counters are expected to have a type suffix at this point. + // for other types, suffixes are removed during scrape. + return removeSuffix(tokens, "total") + default: + return tokens + } +} + +func removeUnitSuffixes(nameTokens []string, unit string) []string { + l := len(nameTokens) + unitTokens := strings.Split(unit, "_") + lu := len(unitTokens) + + if lu == 0 || l <= lu { + return nameTokens + } + + suffixed := true + for i := range unitTokens { + if nameTokens[l-i-1] != unitTokens[lu-i-1] { + suffixed = false + break + } + } + + if suffixed { + return nameTokens[:l-lu] + } + + return nameTokens +} + +func removeSuffix(tokens []string, suffix string) []string { + l := len(tokens) + if tokens[l-1] == suffix { + return tokens[:l-1] + } + + return tokens +} + // Clean up specified string so it's Prometheus compliant func CleanUpString(s string) string { return strings.Join(strings.FieldsFunc(s, func(r rune) bool { return !unicode.IsLetter(r) && !unicode.IsDigit(r) }), "_") } +func RemovePromForbiddenRunes(s string) string { + return strings.Join(strings.FieldsFunc(s, func(r rune) bool { return !unicode.IsLetter(r) && !unicode.IsDigit(r) && r != '_' && r != ':' }), "_") +} + // Retrieve the Prometheus "basic" unit corresponding to the specified "basic" unit // Returns the specified unit if not found in unitMap func unitMapGetOrDefault(unit string) string { diff --git a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite/helper.go b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite/helper.go index 24ef8696c11..9fe5c1790a6 100644 --- a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite/helper.go +++ b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite/helper.go @@ -1,4 +1,4 @@ -// Copyright The OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package prometheusremotewrite // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite" import ( + "encoding/hex" "fmt" "log" "math" @@ -123,10 +124,6 @@ func addExemplar(tsMap map[string]*prompb.TimeSeries, bucketBounds []bucketBound _, ok := tsMap[sig] if ok { if tsMap[sig].Samples != nil { - if tsMap[sig].Exemplars == nil { - tsMap[sig].Exemplars = make([]prompb.Exemplar, 0) - } - if exemplar.Value <= bound { tsMap[sig].Exemplars = append(tsMap[sig].Exemplars, exemplar) return @@ -137,7 +134,9 @@ func addExemplar(tsMap map[string]*prompb.TimeSeries, bucketBounds []bucketBound } // timeSeries return a string signature in the form of: -// TYPE-label1-value1- ... -labelN-valueN +// +// TYPE-label1-value1- ... -labelN-valueN +// // the label slice should not contain duplicate label names; this method sorts the slice by label name before creating // the signature. func timeSeriesSignature(datatype string, labels *[]prompb.Label) string { @@ -245,14 +244,14 @@ func createAttributes(resource pcommon.Resource, attributes pcommon.Map, externa // validateMetrics returns a bool representing whether the metric has a valid type and temporality combination and a // matching metric type and field func validateMetrics(metric pmetric.Metric) bool { - switch metric.DataType() { - case pmetric.MetricDataTypeGauge: + switch metric.Type() { + case pmetric.MetricTypeGauge: return metric.Gauge().DataPoints().Len() != 0 - case pmetric.MetricDataTypeSum: - return metric.Sum().DataPoints().Len() != 0 && metric.Sum().AggregationTemporality() == pmetric.MetricAggregationTemporalityCumulative - case pmetric.MetricDataTypeHistogram: - return metric.Histogram().DataPoints().Len() != 0 && metric.Histogram().AggregationTemporality() == pmetric.MetricAggregationTemporalityCumulative - case pmetric.MetricDataTypeSummary: + case pmetric.MetricTypeSum: + return metric.Sum().DataPoints().Len() != 0 && metric.Sum().AggregationTemporality() == pmetric.AggregationTemporalityCumulative + case pmetric.MetricTypeHistogram: + return metric.Histogram().DataPoints().Len() != 0 && metric.Histogram().AggregationTemporality() == pmetric.AggregationTemporalityCumulative + case pmetric.MetricTypeSummary: return metric.Summary().DataPoints().Len() != 0 } return false @@ -270,14 +269,14 @@ func addSingleNumberDataPoint(pt pmetric.NumberDataPoint, resource pcommon.Resou } switch pt.ValueType() { case pmetric.NumberDataPointValueTypeInt: - sample.Value = float64(pt.IntVal()) + sample.Value = float64(pt.IntValue()) case pmetric.NumberDataPointValueTypeDouble: - sample.Value = pt.DoubleVal() + sample.Value = pt.DoubleValue() } - if pt.FlagsStruct().NoRecordedValue() { + if pt.Flags().NoRecordedValue() { sample.Value = math.Float64frombits(value.StaleNaN) } - addSample(tsMap, sample, labels, metric.DataType().String()) + addSample(tsMap, sample, labels, metric.Type().String()) } // addSingleHistogramDataPoint converts pt to 2 + min(len(ExplicitBounds), len(BucketCount)) + 1 samples. It @@ -286,53 +285,56 @@ func addSingleHistogramDataPoint(pt pmetric.HistogramDataPoint, resource pcommon time := convertTimeStamp(pt.Timestamp()) // sum, count, and buckets of the histogram should append suffix to baseName baseName := prometheustranslator.BuildPromCompliantName(metric, settings.Namespace) - // treat sum as a sample in an individual TimeSeries - sum := &prompb.Sample{ - Value: pt.Sum(), - Timestamp: time, - } - if pt.FlagsStruct().NoRecordedValue() { - sum.Value = math.Float64frombits(value.StaleNaN) - } - sumlabels := createAttributes(resource, pt.Attributes(), settings.ExternalLabels, nameStr, baseName+sumStr) - addSample(tsMap, sum, sumlabels, metric.DataType().String()) + // If the sum is unset, it indicates the _sum metric point should be + // omitted + if pt.HasSum() { + // treat sum as a sample in an individual TimeSeries + sum := &prompb.Sample{ + Value: pt.Sum(), + Timestamp: time, + } + if pt.Flags().NoRecordedValue() { + sum.Value = math.Float64frombits(value.StaleNaN) + } + + sumlabels := createAttributes(resource, pt.Attributes(), settings.ExternalLabels, nameStr, baseName+sumStr) + addSample(tsMap, sum, sumlabels, metric.Type().String()) + } // treat count as a sample in an individual TimeSeries count := &prompb.Sample{ Value: float64(pt.Count()), Timestamp: time, } - if pt.FlagsStruct().NoRecordedValue() { + if pt.Flags().NoRecordedValue() { count.Value = math.Float64frombits(value.StaleNaN) } countlabels := createAttributes(resource, pt.Attributes(), settings.ExternalLabels, nameStr, baseName+countStr) - addSample(tsMap, count, countlabels, metric.DataType().String()) + addSample(tsMap, count, countlabels, metric.Type().String()) // cumulative count for conversion to cumulative histogram var cumulativeCount uint64 promExemplars := getPromExemplars(pt) - bucketBounds := make([]bucketBoundsData, 0) + var bucketBounds []bucketBoundsData // process each bound, based on histograms proto definition, # of buckets = # of explicit bounds + 1 - for index, bound := range pt.ExplicitBounds().AsRaw() { - if index >= pt.BucketCounts().Len() { - break - } - cumulativeCount += pt.BucketCounts().At(index) + for i := 0; i < pt.ExplicitBounds().Len() && i < pt.BucketCounts().Len(); i++ { + bound := pt.ExplicitBounds().At(i) + cumulativeCount += pt.BucketCounts().At(i) bucket := &prompb.Sample{ Value: float64(cumulativeCount), Timestamp: time, } - if pt.FlagsStruct().NoRecordedValue() { + if pt.Flags().NoRecordedValue() { bucket.Value = math.Float64frombits(value.StaleNaN) } boundStr := strconv.FormatFloat(bound, 'f', -1, 64) labels := createAttributes(resource, pt.Attributes(), settings.ExternalLabels, nameStr, baseName+bucketStr, leStr, boundStr) - sig := addSample(tsMap, bucket, labels, metric.DataType().String()) + sig := addSample(tsMap, bucket, labels, metric.Type().String()) bucketBounds = append(bucketBounds, bucketBoundsData{sig: sig, bound: bound}) } @@ -340,16 +342,13 @@ func addSingleHistogramDataPoint(pt pmetric.HistogramDataPoint, resource pcommon infBucket := &prompb.Sample{ Timestamp: time, } - if pt.FlagsStruct().NoRecordedValue() { + if pt.Flags().NoRecordedValue() { infBucket.Value = math.Float64frombits(value.StaleNaN) } else { - if pt.BucketCounts().Len() > 0 { - cumulativeCount += pt.BucketCounts().At(pt.BucketCounts().Len() - 1) - } - infBucket.Value = float64(cumulativeCount) + infBucket.Value = float64(pt.Count()) } infLabels := createAttributes(resource, pt.Attributes(), settings.ExternalLabels, nameStr, baseName+bucketStr, leStr, pInfStr) - sig := addSample(tsMap, infBucket, infLabels, metric.DataType().String()) + sig := addSample(tsMap, infBucket, infLabels, metric.Type().String()) bucketBounds = append(bucketBounds, bucketBoundsData{sig: sig, bound: math.Inf(1)}) addExemplars(tsMap, promExemplars, bucketBounds) @@ -363,11 +362,11 @@ func getPromExemplars(pt pmetric.HistogramDataPoint) []prompb.Exemplar { exemplarRunes := 0 promExemplar := &prompb.Exemplar{ - Value: exemplar.DoubleVal(), + Value: exemplar.DoubleValue(), Timestamp: timestamp.FromTime(exemplar.Timestamp().AsTime()), } - if !exemplar.TraceID().IsEmpty() { - val := exemplar.TraceID().HexString() + if traceID := exemplar.TraceID(); !traceID.IsEmpty() { + val := hex.EncodeToString(traceID[:]) exemplarRunes += utf8.RuneCountInString(traceIDKey) + utf8.RuneCountInString(val) promLabel := prompb.Label{ Name: traceIDKey, @@ -375,8 +374,8 @@ func getPromExemplars(pt pmetric.HistogramDataPoint) []prompb.Exemplar { } promExemplar.Labels = append(promExemplar.Labels, promLabel) } - if !exemplar.SpanID().IsEmpty() { - val := exemplar.SpanID().HexString() + if spanID := exemplar.SpanID(); !spanID.IsEmpty() { + val := hex.EncodeToString(spanID[:]) exemplarRunes += utf8.RuneCountInString(spanIDKey) + utf8.RuneCountInString(val) promLabel := prompb.Label{ Name: spanIDKey, @@ -414,23 +413,23 @@ func getPromExemplars(pt pmetric.HistogramDataPoint) []prompb.Exemplar { func mostRecentTimestampInMetric(metric pmetric.Metric) pcommon.Timestamp { var ts pcommon.Timestamp // handle individual metric based on type - switch metric.DataType() { - case pmetric.MetricDataTypeGauge: + switch metric.Type() { + case pmetric.MetricTypeGauge: dataPoints := metric.Gauge().DataPoints() for x := 0; x < dataPoints.Len(); x++ { ts = maxTimestamp(ts, dataPoints.At(x).Timestamp()) } - case pmetric.MetricDataTypeSum: + case pmetric.MetricTypeSum: dataPoints := metric.Sum().DataPoints() for x := 0; x < dataPoints.Len(); x++ { ts = maxTimestamp(ts, dataPoints.At(x).Timestamp()) } - case pmetric.MetricDataTypeHistogram: + case pmetric.MetricTypeHistogram: dataPoints := metric.Histogram().DataPoints() for x := 0; x < dataPoints.Len(); x++ { ts = maxTimestamp(ts, dataPoints.At(x).Timestamp()) } - case pmetric.MetricDataTypeSummary: + case pmetric.MetricTypeSummary: dataPoints := metric.Summary().DataPoints() for x := 0; x < dataPoints.Len(); x++ { ts = maxTimestamp(ts, dataPoints.At(x).Timestamp()) @@ -457,22 +456,22 @@ func addSingleSummaryDataPoint(pt pmetric.SummaryDataPoint, resource pcommon.Res Value: pt.Sum(), Timestamp: time, } - if pt.FlagsStruct().NoRecordedValue() { + if pt.Flags().NoRecordedValue() { sum.Value = math.Float64frombits(value.StaleNaN) } sumlabels := createAttributes(resource, pt.Attributes(), settings.ExternalLabels, nameStr, baseName+sumStr) - addSample(tsMap, sum, sumlabels, metric.DataType().String()) + addSample(tsMap, sum, sumlabels, metric.Type().String()) // treat count as a sample in an individual TimeSeries count := &prompb.Sample{ Value: float64(pt.Count()), Timestamp: time, } - if pt.FlagsStruct().NoRecordedValue() { + if pt.Flags().NoRecordedValue() { count.Value = math.Float64frombits(value.StaleNaN) } countlabels := createAttributes(resource, pt.Attributes(), settings.ExternalLabels, nameStr, baseName+countStr) - addSample(tsMap, count, countlabels, metric.DataType().String()) + addSample(tsMap, count, countlabels, metric.Type().String()) // process each percentile/quantile for i := 0; i < pt.QuantileValues().Len(); i++ { @@ -481,25 +480,20 @@ func addSingleSummaryDataPoint(pt pmetric.SummaryDataPoint, resource pcommon.Res Value: qt.Value(), Timestamp: time, } - if pt.FlagsStruct().NoRecordedValue() { + if pt.Flags().NoRecordedValue() { quantile.Value = math.Float64frombits(value.StaleNaN) } percentileStr := strconv.FormatFloat(qt.Quantile(), 'f', -1, 64) qtlabels := createAttributes(resource, pt.Attributes(), settings.ExternalLabels, nameStr, baseName, quantileStr, percentileStr) - addSample(tsMap, quantile, qtlabels, metric.DataType().String()) + addSample(tsMap, quantile, qtlabels, metric.Type().String()) } } // addResourceTargetInfo converts the resource to the target info metric func addResourceTargetInfo(resource pcommon.Resource, settings Settings, timestamp pcommon.Timestamp, tsMap map[string]*prompb.TimeSeries) { - if resource.Attributes().Len() == 0 { + if settings.DisableTargetInfo { return } - // create parameters for addSample - name := targetMetricName - if len(settings.Namespace) > 0 { - name = settings.Namespace + "_" + name - } // Use resource attributes (other than those used for job+instance) as the // metric labels for the target info metric attributes := pcommon.NewMap() @@ -513,6 +507,15 @@ func addResourceTargetInfo(resource pcommon.Resource, settings Settings, timesta return false } }) + if attributes.Len() == 0 { + // If we only have job + instance, then target_info isn't useful, so don't add it. + return + } + // create parameters for addSample + name := targetMetricName + if len(settings.Namespace) > 0 { + name = settings.Namespace + "_" + name + } labels := createAttributes(resource, attributes, settings.ExternalLabels, nameStr, name) sample := &prompb.Sample{ Value: float64(1), diff --git a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite/metrics_to_prw.go b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite/metrics_to_prw.go index 9d8644ec5ee..33279735520 100644 --- a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite/metrics_to_prw.go +++ b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite/metrics_to_prw.go @@ -1,4 +1,4 @@ -// Copyright The OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,8 +35,9 @@ func MetricsToPRW(namespace string, externalLabels map[string]string, md pmetric } type Settings struct { - Namespace string - ExternalLabels map[string]string + Namespace string + ExternalLabels map[string]string + DisableTargetInfo bool } // FromMetrics converts pmetric.Metrics to prometheus remote write format. @@ -67,19 +68,19 @@ func FromMetrics(md pmetric.Metrics, settings Settings) (tsMap map[string]*promp } // handle individual metric based on type - switch metric.DataType() { - case pmetric.MetricDataTypeGauge: + switch metric.Type() { + case pmetric.MetricTypeGauge: dataPoints := metric.Gauge().DataPoints() if err := addNumberDataPointSlice(dataPoints, resource, metric, settings, tsMap); err != nil { errs = multierr.Append(errs, err) } - case pmetric.MetricDataTypeSum: + case pmetric.MetricTypeSum: dataPoints := metric.Sum().DataPoints() if err := addNumberDataPointSlice(dataPoints, resource, metric, settings, tsMap); err != nil { errs = multierr.Append(errs, err) } - case pmetric.MetricDataTypeHistogram: + case pmetric.MetricTypeHistogram: dataPoints := metric.Histogram().DataPoints() if dataPoints.Len() == 0 { errs = multierr.Append(errs, fmt.Errorf("empty data points. %s is dropped", metric.Name())) @@ -87,7 +88,7 @@ func FromMetrics(md pmetric.Metrics, settings Settings) (tsMap map[string]*promp for x := 0; x < dataPoints.Len(); x++ { addSingleHistogramDataPoint(dataPoints.At(x), resource, metric, settings, tsMap) } - case pmetric.MetricDataTypeSummary: + case pmetric.MetricTypeSummary: dataPoints := metric.Summary().DataPoints() if dataPoints.Len() == 0 { errs = multierr.Append(errs, fmt.Errorf("empty data points. %s is dropped", metric.Name())) diff --git a/vendor/go.opentelemetry.io/collector/featuregate/LICENSE b/vendor/go.opentelemetry.io/collector/featuregate/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/featuregate/LICENSE @@ -0,0 +1,202 @@ + + 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/vendor/go.opentelemetry.io/collector/featuregate/Makefile b/vendor/go.opentelemetry.io/collector/featuregate/Makefile new file mode 100644 index 00000000000..39734bfaebb --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/featuregate/Makefile @@ -0,0 +1 @@ +include ../Makefile.Common diff --git a/vendor/go.opentelemetry.io/collector/service/featuregate/README.md b/vendor/go.opentelemetry.io/collector/featuregate/README.md similarity index 75% rename from vendor/go.opentelemetry.io/collector/service/featuregate/README.md rename to vendor/go.opentelemetry.io/collector/featuregate/README.md index af7bf9b3385..7e849ceb482 100644 --- a/vendor/go.opentelemetry.io/collector/service/featuregate/README.md +++ b/vendor/go.opentelemetry.io/collector/featuregate/README.md @@ -10,17 +10,25 @@ based on flags at the component level. Feature gates must be defined and registered with the global registry in an `init()` function. This makes the `Gate` available to be configured and -queried with a default value of its `Enabled` property. +queried with the defined [`Stage`](#feature-lifecycle) default value. +A `Gate` can have a list of associated issues that allow users to refer to +the issue and report any additional problems or understand the context of the `Gate`. +Once a `Gate` has been marked as `Stable`, it must have a `RemovalVersion` set. ```go -const myFeatureGateID = "namespaced.uniqueIdentifier" +const ( + myFeatureGateID = "namespaced.uniqueIdentifier" + myFeatureStage = featuregate.Stable +) func init() { - featuregate.Register(featuregate.Gate{ - ID: fancyNewFeatureGate, - Description: "A brief description of what the gate controls", - Enabled: false, - }) + featuregate.MustRegisterID( + myFeatureGateID, + myFeatureStage, + featuregate.WithRegisterDescription("A brief description of what the gate controls"), + featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/opentelemetry-collector/issues/6167"), + featuregate.WithRegisterRemovalVersion("v0.70.0"), + ) } ``` diff --git a/vendor/go.opentelemetry.io/collector/service/featuregate/flags.go b/vendor/go.opentelemetry.io/collector/featuregate/flags.go similarity index 89% rename from vendor/go.opentelemetry.io/collector/service/featuregate/flags.go rename to vendor/go.opentelemetry.io/collector/featuregate/flags.go index 6d4b9fa48d6..a1c9ec4306b 100644 --- a/vendor/go.opentelemetry.io/collector/service/featuregate/flags.go +++ b/vendor/go.opentelemetry.io/collector/featuregate/flags.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package featuregate // import "go.opentelemetry.io/collector/service/featuregate" +package featuregate // import "go.opentelemetry.io/collector/featuregate" import ( "flag" @@ -48,11 +48,8 @@ func (f FlagValue) Set(s string) error { return nil } - return f.setSlice(strings.Split(s, ",")) -} - -func (f FlagValue) setSlice(s []string) error { - for _, v := range s { + ss := strings.Split(s, ",") + for _, v := range ss { var id string var val bool switch v[0] { diff --git a/vendor/go.opentelemetry.io/collector/featuregate/gate.go b/vendor/go.opentelemetry.io/collector/featuregate/gate.go new file mode 100644 index 00000000000..09b65ea12e3 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/featuregate/gate.go @@ -0,0 +1,56 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package featuregate // import "go.opentelemetry.io/collector/featuregate" + +// Gate is an immutable object that is owned by the Registry and represents an individual feature that +// may be enabled or disabled based on the lifecycle state of the feature and CLI flags specified by the user. +type Gate struct { + id string + description string + referenceURL string + removalVersion string + stage Stage + enabled bool +} + +// ID returns the id of the Gate. +func (g *Gate) ID() string { + return g.id +} + +// IsEnabled returns true if the feature described by the Gate is enabled. +func (g *Gate) IsEnabled() bool { + return g.enabled +} + +// Description returns the description for the Gate. +func (g *Gate) Description() string { + return g.description +} + +// Stage returns the Gate's lifecycle stage. +func (g *Gate) Stage() Stage { + return g.stage +} + +// ReferenceURL returns the URL to the contextual information about the Gate. +func (g *Gate) ReferenceURL() string { + return g.referenceURL +} + +// RemovalVersion returns the removal version information for Gate's in StageStable. +func (g *Gate) RemovalVersion() string { + return g.removalVersion +} diff --git a/vendor/go.opentelemetry.io/collector/featuregate/registry.go b/vendor/go.opentelemetry.io/collector/featuregate/registry.go new file mode 100644 index 00000000000..c1d4c26c728 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/featuregate/registry.go @@ -0,0 +1,154 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package featuregate // import "go.opentelemetry.io/collector/featuregate" + +import ( + "fmt" + "sync" +) + +var reg = NewRegistry() + +// GetRegistry returns the global Registry. +func GetRegistry() *Registry { + return reg +} + +type Registry struct { + mu sync.RWMutex + gates map[string]Gate +} + +// NewRegistry returns a new empty Registry. +func NewRegistry() *Registry { + return &Registry{gates: make(map[string]Gate)} +} + +// RegistryOption allows to configure additional information about a Gate during registration. +type RegistryOption interface { + apply(g *Gate) +} + +type registerOption struct { + applyFunc func(g *Gate) +} + +func (ro registerOption) apply(g *Gate) { + ro.applyFunc(g) +} + +// WithRegisterDescription adds description for the Gate. +func WithRegisterDescription(description string) RegistryOption { + return registerOption{ + applyFunc: func(g *Gate) { + g.description = description + }, + } +} + +// WithRegisterReferenceURL adds an URL that has all the contextual information about the Gate. +func WithRegisterReferenceURL(url string) RegistryOption { + return registerOption{ + applyFunc: func(g *Gate) { + g.referenceURL = url + }, + } +} + +// WithRegisterRemovalVersion is used when the Gate is considered StageStable, +// to inform users that referencing the gate is no longer needed. +func WithRegisterRemovalVersion(version string) RegistryOption { + return registerOption{ + applyFunc: func(g *Gate) { + g.removalVersion = version + }, + } +} + +// Apply a configuration in the form of a map of Gate identifiers to boolean values. +// Sets only those values provided in the map, other gate values are not changed. +func (r *Registry) Apply(cfg map[string]bool) error { + r.mu.Lock() + defer r.mu.Unlock() + for id, val := range cfg { + g, ok := r.gates[id] + if !ok { + return fmt.Errorf("feature gate %s is unregistered", id) + } + if g.stage == StageStable { + return fmt.Errorf("feature gate %s is stable, can not be modified", id) + } + g.enabled = val + r.gates[g.id] = g + } + return nil +} + +// IsEnabled returns true if a registered feature gate is enabled and false otherwise. +func (r *Registry) IsEnabled(id string) bool { + r.mu.RLock() + defer r.mu.RUnlock() + g, ok := r.gates[id] + return ok && g.enabled +} + +// MustRegisterID like RegisterID but panics if an invalid ID or gate options are provided. +func (r *Registry) MustRegisterID(id string, stage Stage, opts ...RegistryOption) { + if err := r.RegisterID(id, stage, opts...); err != nil { + panic(err) + } +} + +func (r *Registry) RegisterID(id string, stage Stage, opts ...RegistryOption) error { + r.mu.Lock() + defer r.mu.Unlock() + if _, ok := r.gates[id]; ok { + return fmt.Errorf("attempted to add pre-existing gate %q", id) + } + g := Gate{ + id: id, + stage: stage, + } + for _, opt := range opts { + opt.apply(&g) + } + switch g.stage { + case StageAlpha: + g.enabled = false + case StageBeta, StageStable: + g.enabled = true + default: + return fmt.Errorf("unknown stage value %q for gate %q", stage, id) + } + if g.stage == StageStable && g.removalVersion == "" { + return fmt.Errorf("no removal version set for stable gate %q", id) + } + r.gates[id] = g + return nil +} + +// List returns a slice of copies of all registered Gates. +func (r *Registry) List() []Gate { + r.mu.RLock() + defer r.mu.RUnlock() + ret := make([]Gate, len(r.gates)) + i := 0 + for _, gate := range r.gates { + ret[i] = gate + i++ + } + + return ret +} diff --git a/vendor/go.opentelemetry.io/collector/featuregate/stage.go b/vendor/go.opentelemetry.io/collector/featuregate/stage.go new file mode 100644 index 00000000000..3508562ec05 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/featuregate/stage.go @@ -0,0 +1,48 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package featuregate // import "go.opentelemetry.io/collector/featuregate" + +// Stage represents the Gate's lifecycle and what is the expected state of it. +type Stage int8 + +const ( + // StageAlpha is used when creating a new feature and the Gate must be explicitly enabled + // by the operator. + // + // The Gate will be disabled by default. + StageAlpha Stage = iota + // StageBeta is used when the feature flag is well tested and is enabled by default, + // but can be disabled by a Gate. + // + // The Gate will be enabled by default. + StageBeta + // StageStable is used when feature is permanently enabled and can not be disabled by a Gate. + // This value is used to provide feedback to the user that the gate will be removed in the next version. + // + // The Gate will be enabled by default and will return an error if modified. + StageStable +) + +func (s Stage) String() string { + switch s { + case StageAlpha: + return "Alpha" + case StageBeta: + return "Beta" + case StageStable: + return "Stable" + } + return "Unknown" +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/common.go b/vendor/go.opentelemetry.io/collector/pdata/internal/common.go deleted file mode 100644 index 3d4fac53065..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/common.go +++ /dev/null @@ -1,926 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -package internal // import "go.opentelemetry.io/collector/pdata/internal" - -// This file contains data structures that are common for all telemetry types, -// such as timestamps, attributes, etc. - -import ( - "bytes" - "encoding/base64" - "encoding/json" - "fmt" - "math" - "sort" - "strconv" - - otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" -) - -// ValueType specifies the type of Value. -type ValueType int32 - -const ( - ValueTypeEmpty ValueType = iota - ValueTypeString - ValueTypeInt - ValueTypeDouble - ValueTypeBool - ValueTypeMap - ValueTypeSlice - ValueTypeBytes -) - -// String returns the string representation of the ValueType. -func (avt ValueType) String() string { - switch avt { - case ValueTypeEmpty: - return "EMPTY" - case ValueTypeString: - return "STRING" - case ValueTypeBool: - return "BOOL" - case ValueTypeInt: - return "INT" - case ValueTypeDouble: - return "DOUBLE" - case ValueTypeMap: - return "MAP" - case ValueTypeSlice: - return "SLICE" - case ValueTypeBytes: - return "BYTES" - } - return "" -} - -// Value is a mutable cell containing any value. Typically used as an element of Map or Slice. -// Must use one of NewValue+ functions below to create new instances. -// -// Intended to be passed by value since internally it is just a pointer to actual -// value representation. For the same reason passing by value and calling setters -// will modify the original, e.g.: -// -// func f1(val Value) { val.SetIntVal(234) } -// func f2() { -// v := NewValueString("a string") -// f1(v) -// _ := v.Type() // this will return ValueTypeInt -// } -// -// Important: zero-initialized instance is not valid for use. All Value functions below must -// be called only on instances that are created via NewValue+ functions. -type Value struct { - orig *otlpcommon.AnyValue -} - -func newValue(orig *otlpcommon.AnyValue) Value { - return Value{orig} -} - -// NewValueEmpty creates a new Value with an empty value. -func NewValueEmpty() Value { - return Value{orig: &otlpcommon.AnyValue{}} -} - -// NewValueString creates a new Value with the given string value. -func NewValueString(v string) Value { - return Value{orig: &otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_StringValue{StringValue: v}}} -} - -// NewValueInt creates a new Value with the given int64 value. -func NewValueInt(v int64) Value { - return Value{orig: &otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_IntValue{IntValue: v}}} -} - -// NewValueDouble creates a new Value with the given float64 value. -func NewValueDouble(v float64) Value { - return Value{orig: &otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_DoubleValue{DoubleValue: v}}} -} - -// NewValueBool creates a new Value with the given bool value. -func NewValueBool(v bool) Value { - return Value{orig: &otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_BoolValue{BoolValue: v}}} -} - -// NewValueMap creates a new Value of map type. -func NewValueMap() Value { - return Value{orig: &otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_KvlistValue{KvlistValue: &otlpcommon.KeyValueList{}}}} -} - -// NewValueSlice creates a new Value of array type. -func NewValueSlice() Value { - return Value{orig: &otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_ArrayValue{ArrayValue: &otlpcommon.ArrayValue{}}}} -} - -// NewValueBytes creates a new Value with the given ImmutableByteSlice value. -func NewValueBytes(v ImmutableByteSlice) Value { - return Value{orig: &otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_BytesValue{BytesValue: v.value}}} -} - -func newValueFromRaw(iv interface{}) Value { - switch tv := iv.(type) { - case nil: - return NewValueEmpty() - case string: - return NewValueString(tv) - case int: - return NewValueInt(int64(tv)) - case int8: - return NewValueInt(int64(tv)) - case int16: - return NewValueInt(int64(tv)) - case int32: - return NewValueInt(int64(tv)) - case int64: - return NewValueInt(tv) - case uint: - return NewValueInt(int64(tv)) - case uint8: - return NewValueInt(int64(tv)) - case uint16: - return NewValueInt(int64(tv)) - case uint32: - return NewValueInt(int64(tv)) - case uint64: - return NewValueInt(int64(tv)) - case float32: - return NewValueDouble(float64(tv)) - case float64: - return NewValueDouble(tv) - case bool: - return NewValueBool(tv) - case []byte: - return NewValueBytes(NewImmutableByteSlice(tv)) - case map[string]interface{}: - mv := NewValueMap() - NewMapFromRaw(tv).CopyTo(mv.MapVal()) - return mv - case []interface{}: - av := NewValueSlice() - NewSliceFromRaw(tv).CopyTo(av.SliceVal()) - return av - default: - return NewValueString(fmt.Sprintf("", tv)) - } -} - -// Type returns the type of the value for this Value. -// Calling this function on zero-initialized Value will cause a panic. -func (v Value) Type() ValueType { - if v.orig.Value == nil { - return ValueTypeEmpty - } - switch v.orig.Value.(type) { - case *otlpcommon.AnyValue_StringValue: - return ValueTypeString - case *otlpcommon.AnyValue_BoolValue: - return ValueTypeBool - case *otlpcommon.AnyValue_IntValue: - return ValueTypeInt - case *otlpcommon.AnyValue_DoubleValue: - return ValueTypeDouble - case *otlpcommon.AnyValue_KvlistValue: - return ValueTypeMap - case *otlpcommon.AnyValue_ArrayValue: - return ValueTypeSlice - case *otlpcommon.AnyValue_BytesValue: - return ValueTypeBytes - } - return ValueTypeEmpty -} - -// StringVal returns the string value associated with this Value. -// If the Type() is not ValueTypeString then returns empty string. -// Calling this function on zero-initialized Value will cause a panic. -func (v Value) StringVal() string { - return v.orig.GetStringValue() -} - -// IntVal returns the int64 value associated with this Value. -// If the Type() is not ValueTypeInt then returns int64(0). -// Calling this function on zero-initialized Value will cause a panic. -func (v Value) IntVal() int64 { - return v.orig.GetIntValue() -} - -// DoubleVal returns the float64 value associated with this Value. -// If the Type() is not ValueTypeDouble then returns float64(0). -// Calling this function on zero-initialized Value will cause a panic. -func (v Value) DoubleVal() float64 { - return v.orig.GetDoubleValue() -} - -// BoolVal returns the bool value associated with this Value. -// If the Type() is not ValueTypeBool then returns false. -// Calling this function on zero-initialized Value will cause a panic. -func (v Value) BoolVal() bool { - return v.orig.GetBoolValue() -} - -// MapVal returns the map value associated with this Value. -// If the Type() is not ValueTypeMap then returns an invalid map. Note that using -// such map can cause panic. -// -// Calling this function on zero-initialized Value will cause a panic. -func (v Value) MapVal() Map { - kvlist := v.orig.GetKvlistValue() - if kvlist == nil { - return Map{} - } - return newMap(&kvlist.Values) -} - -// SliceVal returns the slice value associated with this Value. -// If the Type() is not ValueTypeSlice then returns an invalid slice. Note that using -// such slice can cause panic. -// -// Calling this function on zero-initialized Value will cause a panic. -func (v Value) SliceVal() Slice { - arr := v.orig.GetArrayValue() - if arr == nil { - return Slice{} - } - return newSlice(&arr.Values) -} - -// BytesVal returns the ImmutableByteSlice value associated with this Value. -// If the Type() is not ValueTypeBytes then returns an empty slice. -// Calling this function on zero-initialized Value will cause a panic. -func (v Value) BytesVal() ImmutableByteSlice { - return ImmutableByteSlice{value: v.orig.GetBytesValue()} -} - -// SetStringVal replaces the string value associated with this Value, -// it also changes the type to be ValueTypeString. -// Calling this function on zero-initialized Value will cause a panic. -func (v Value) SetStringVal(sv string) { - v.orig.Value = &otlpcommon.AnyValue_StringValue{StringValue: sv} -} - -// SetIntVal replaces the int64 value associated with this Value, -// it also changes the type to be ValueTypeInt. -// Calling this function on zero-initialized Value will cause a panic. -func (v Value) SetIntVal(iv int64) { - v.orig.Value = &otlpcommon.AnyValue_IntValue{IntValue: iv} -} - -// SetDoubleVal replaces the float64 value associated with this Value, -// it also changes the type to be ValueTypeDouble. -// Calling this function on zero-initialized Value will cause a panic. -func (v Value) SetDoubleVal(dv float64) { - v.orig.Value = &otlpcommon.AnyValue_DoubleValue{DoubleValue: dv} -} - -// SetBoolVal replaces the bool value associated with this Value, -// it also changes the type to be ValueTypeBool. -// Calling this function on zero-initialized Value will cause a panic. -func (v Value) SetBoolVal(bv bool) { - v.orig.Value = &otlpcommon.AnyValue_BoolValue{BoolValue: bv} -} - -// SetBytesVal replaces the ImmutableByteSlice value associated with this Value, -// it also changes the type to be ValueTypeBytes. -// Calling this function on zero-initialized Value will cause a panic. -func (v Value) SetBytesVal(bv ImmutableByteSlice) { - v.orig.Value = &otlpcommon.AnyValue_BytesValue{BytesValue: bv.value} -} - -// copyTo copies the value to Value. Will panic if dest is nil. -func (v Value) copyTo(dest *otlpcommon.AnyValue) { - switch ov := v.orig.Value.(type) { - case *otlpcommon.AnyValue_KvlistValue: - kv, ok := dest.Value.(*otlpcommon.AnyValue_KvlistValue) - if !ok { - kv = &otlpcommon.AnyValue_KvlistValue{KvlistValue: &otlpcommon.KeyValueList{}} - dest.Value = kv - } - if ov.KvlistValue == nil { - kv.KvlistValue = nil - return - } - // Deep copy to dest. - newMap(&ov.KvlistValue.Values).CopyTo(newMap(&kv.KvlistValue.Values)) - case *otlpcommon.AnyValue_ArrayValue: - av, ok := dest.Value.(*otlpcommon.AnyValue_ArrayValue) - if !ok { - av = &otlpcommon.AnyValue_ArrayValue{ArrayValue: &otlpcommon.ArrayValue{}} - dest.Value = av - } - if ov.ArrayValue == nil { - av.ArrayValue = nil - return - } - // Deep copy to dest. - newSlice(&ov.ArrayValue.Values).CopyTo(newSlice(&av.ArrayValue.Values)) - case *otlpcommon.AnyValue_BytesValue: - bv, ok := dest.Value.(*otlpcommon.AnyValue_BytesValue) - if !ok { - bv = &otlpcommon.AnyValue_BytesValue{} - dest.Value = bv - } - bv.BytesValue = make([]byte, len(ov.BytesValue)) - copy(bv.BytesValue, ov.BytesValue) - default: - // Primitive immutable type, no need for deep copy. - dest.Value = v.orig.Value - } -} - -// CopyTo copies the attribute to a destination. -func (v Value) CopyTo(dest Value) { - v.copyTo(dest.orig) -} - -// Equal checks for equality, it returns true if the objects are equal otherwise false. -func (v Value) Equal(av Value) bool { - if v.orig == av.orig { - return true - } - - if v.orig.Value == nil || av.orig.Value == nil { - return v.orig.Value == av.orig.Value - } - - if v.Type() != av.Type() { - return false - } - - switch v := v.orig.Value.(type) { - case *otlpcommon.AnyValue_StringValue: - return v.StringValue == av.orig.GetStringValue() - case *otlpcommon.AnyValue_BoolValue: - return v.BoolValue == av.orig.GetBoolValue() - case *otlpcommon.AnyValue_IntValue: - return v.IntValue == av.orig.GetIntValue() - case *otlpcommon.AnyValue_DoubleValue: - return v.DoubleValue == av.orig.GetDoubleValue() - case *otlpcommon.AnyValue_ArrayValue: - vv := v.ArrayValue.GetValues() - avv := av.orig.GetArrayValue().GetValues() - if len(vv) != len(avv) { - return false - } - - for i, val := range avv { - val := val - newAv := newValue(&vv[i]) - - // According to the specification, array values must be scalar. - if avType := newAv.Type(); avType == ValueTypeSlice || avType == ValueTypeMap { - return false - } - - if !newAv.Equal(newValue(&val)) { - return false - } - } - return true - case *otlpcommon.AnyValue_KvlistValue: - cc := v.KvlistValue.GetValues() - avv := av.orig.GetKvlistValue().GetValues() - if len(cc) != len(avv) { - return false - } - - m := newMap(&avv) - - for _, val := range cc { - newAv, ok := m.Get(val.Key) - if !ok { - return false - } - - if !newAv.Equal(newValue(&val.Value)) { - return false - } - } - return true - case *otlpcommon.AnyValue_BytesValue: - return bytes.Equal(v.BytesValue, av.orig.GetBytesValue()) - } - - return false -} - -// AsString converts an OTLP Value object of any type to its equivalent string -// representation. This differs from StringVal which only returns a non-empty value -// if the ValueType is ValueTypeString. -func (v Value) AsString() string { - switch v.Type() { - case ValueTypeEmpty: - return "" - - case ValueTypeString: - return v.StringVal() - - case ValueTypeBool: - return strconv.FormatBool(v.BoolVal()) - - case ValueTypeDouble: - return float64AsString(v.DoubleVal()) - - case ValueTypeInt: - return strconv.FormatInt(v.IntVal(), 10) - - case ValueTypeMap: - jsonStr, _ := json.Marshal(v.MapVal().AsRaw()) - return string(jsonStr) - - case ValueTypeBytes: - return base64.StdEncoding.EncodeToString(v.BytesVal().value) - - case ValueTypeSlice: - jsonStr, _ := json.Marshal(v.SliceVal().AsRaw()) - return string(jsonStr) - - default: - return fmt.Sprintf("", v.Type()) - } -} - -// See https://cs.opensource.google/go/go/+/refs/tags/go1.17.7:src/encoding/json/encode.go;l=585. -// This allows us to avoid using reflection. -func float64AsString(f float64) string { - if math.IsInf(f, 0) || math.IsNaN(f) { - return fmt.Sprintf("json: unsupported value: %s", strconv.FormatFloat(f, 'g', -1, int(64))) - } - - // Convert as if by ES6 number to string conversion. - // This matches most other JSON generators. - // See golang.org/issue/6384 and golang.org/issue/14135. - // Like fmt %g, but the exponent cutoffs are different - // and exponents themselves are not padded to two digits. - scratch := [64]byte{} - b := scratch[:0] - abs := math.Abs(f) - fmt := byte('f') - if abs != 0 && (abs < 1e-6 || abs >= 1e21) { - fmt = 'e' - } - b = strconv.AppendFloat(b, f, fmt, -1, int(64)) - if fmt == 'e' { - // clean up e-09 to e-9 - n := len(b) - if n >= 4 && b[n-4] == 'e' && b[n-3] == '-' && b[n-2] == '0' { - b[n-2] = b[n-1] - b = b[:n-1] - } - } - return string(b) -} - -func (v Value) asRaw() interface{} { - switch v.Type() { - case ValueTypeEmpty: - return nil - case ValueTypeString: - return v.StringVal() - case ValueTypeBool: - return v.BoolVal() - case ValueTypeDouble: - return v.DoubleVal() - case ValueTypeInt: - return v.IntVal() - case ValueTypeBytes: - return v.BytesVal().AsRaw() - case ValueTypeMap: - return v.MapVal().AsRaw() - case ValueTypeSlice: - return v.SliceVal().AsRaw() - } - return fmt.Sprintf("", v.Type()) -} - -func newAttributeKeyValueString(k string, v string) otlpcommon.KeyValue { - orig := otlpcommon.KeyValue{Key: k} - akv := Value{&orig.Value} - akv.SetStringVal(v) - return orig -} - -func newAttributeKeyValueInt(k string, v int64) otlpcommon.KeyValue { - orig := otlpcommon.KeyValue{Key: k} - akv := Value{&orig.Value} - akv.SetIntVal(v) - return orig -} - -func newAttributeKeyValueDouble(k string, v float64) otlpcommon.KeyValue { - orig := otlpcommon.KeyValue{Key: k} - akv := Value{&orig.Value} - akv.SetDoubleVal(v) - return orig -} - -func newAttributeKeyValueBool(k string, v bool) otlpcommon.KeyValue { - orig := otlpcommon.KeyValue{Key: k} - akv := Value{&orig.Value} - akv.SetBoolVal(v) - return orig -} - -func newAttributeKeyValueNull(k string) otlpcommon.KeyValue { - orig := otlpcommon.KeyValue{Key: k} - return orig -} - -func newAttributeKeyValue(k string, av Value) otlpcommon.KeyValue { - orig := otlpcommon.KeyValue{Key: k} - av.copyTo(&orig.Value) - return orig -} - -func newAttributeKeyValueBytes(k string, v ImmutableByteSlice) otlpcommon.KeyValue { - orig := otlpcommon.KeyValue{Key: k} - akv := Value{&orig.Value} - akv.SetBytesVal(v) - return orig -} - -// Map stores a map of string keys to elements of Value type. -type Map struct { - orig *[]otlpcommon.KeyValue -} - -// NewMap creates a Map with 0 elements. -func NewMap() Map { - orig := []otlpcommon.KeyValue(nil) - return Map{&orig} -} - -// NewMapFromRaw creates a Map with values from the given map[string]interface{}. -func NewMapFromRaw(rawMap map[string]interface{}) Map { - if len(rawMap) == 0 { - kv := []otlpcommon.KeyValue(nil) - return Map{&kv} - } - origs := make([]otlpcommon.KeyValue, len(rawMap)) - ix := 0 - for k, iv := range rawMap { - origs[ix].Key = k - newValueFromRaw(iv).copyTo(&origs[ix].Value) - ix++ - } - return Map{&origs} -} - -func newMap(orig *[]otlpcommon.KeyValue) Map { - return Map{orig} -} - -// Clear erases any existing entries in this Map instance. -func (m Map) Clear() { - *m.orig = nil -} - -// EnsureCapacity increases the capacity of this Map instance, if necessary, -// to ensure that it can hold at least the number of elements specified by the capacity argument. -func (m Map) EnsureCapacity(capacity int) { - if capacity <= cap(*m.orig) { - return - } - oldOrig := *m.orig - *m.orig = make([]otlpcommon.KeyValue, 0, capacity) - copy(*m.orig, oldOrig) -} - -// Get returns the Value associated with the key and true. Returned -// Value is not a copy, it is a reference to the value stored in this map. -// It is allowed to modify the returned value using Value.Set* functions. -// Such modification will be applied to the value stored in this map. -// -// If the key does not exist returns an invalid instance of the KeyValue and false. -// Calling any functions on the returned invalid instance will cause a panic. -func (m Map) Get(key string) (Value, bool) { - for i := range *m.orig { - akv := &(*m.orig)[i] - if akv.Key == key { - return Value{&akv.Value}, true - } - } - return Value{nil}, false -} - -// Remove removes the entry associated with the key and returns true if the key -// was present in the map, otherwise returns false. -func (m Map) Remove(key string) bool { - for i := range *m.orig { - akv := &(*m.orig)[i] - if akv.Key == key { - *akv = (*m.orig)[len(*m.orig)-1] - *m.orig = (*m.orig)[:len(*m.orig)-1] - return true - } - } - return false -} - -// RemoveIf removes the entries for which the function in question returns true -func (m Map) RemoveIf(f func(string, Value) bool) { - newLen := 0 - for i := 0; i < len(*m.orig); i++ { - akv := &(*m.orig)[i] - if f(akv.Key, Value{&akv.Value}) { - continue - } - if newLen == i { - // Nothing to move, element is at the right place. - newLen++ - continue - } - (*m.orig)[newLen] = (*m.orig)[i] - newLen++ - } - *m.orig = (*m.orig)[:newLen] -} - -// Insert adds the Value to the map when the key does not exist. -// No action is applied to the map where the key already exists. -// -// Calling this function with a zero-initialized Value struct will cause a panic. -// -// Important: this function should not be used if the caller has access to -// the raw value to avoid an extra allocation. -func (m Map) Insert(k string, v Value) { - if _, existing := m.Get(k); !existing { - *m.orig = append(*m.orig, newAttributeKeyValue(k, v)) - } -} - -// InsertNull adds a null Value to the map when the key does not exist. -// No action is applied to the map where the key already exists. -func (m Map) InsertNull(k string) { - if _, existing := m.Get(k); !existing { - *m.orig = append(*m.orig, newAttributeKeyValueNull(k)) - } -} - -// InsertString adds the string Value to the map when the key does not exist. -// No action is applied to the map where the key already exists. -func (m Map) InsertString(k string, v string) { - if _, existing := m.Get(k); !existing { - *m.orig = append(*m.orig, newAttributeKeyValueString(k, v)) - } -} - -// InsertInt adds the int Value to the map when the key does not exist. -// No action is applied to the map where the key already exists. -func (m Map) InsertInt(k string, v int64) { - if _, existing := m.Get(k); !existing { - *m.orig = append(*m.orig, newAttributeKeyValueInt(k, v)) - } -} - -// InsertDouble adds the double Value to the map when the key does not exist. -// No action is applied to the map where the key already exists. -func (m Map) InsertDouble(k string, v float64) { - if _, existing := m.Get(k); !existing { - *m.orig = append(*m.orig, newAttributeKeyValueDouble(k, v)) - } -} - -// InsertBool adds the bool Value to the map when the key does not exist. -// No action is applied to the map where the key already exists. -func (m Map) InsertBool(k string, v bool) { - if _, existing := m.Get(k); !existing { - *m.orig = append(*m.orig, newAttributeKeyValueBool(k, v)) - } -} - -// InsertBytes adds the ImmutableByteSlice Value to the map when the key does not exist. -// No action is applied to the map where the key already exists. -func (m Map) InsertBytes(k string, v ImmutableByteSlice) { - if _, existing := m.Get(k); !existing { - *m.orig = append(*m.orig, newAttributeKeyValueBytes(k, v)) - } -} - -// Update updates an existing Value with a value. -// No action is applied to the map where the key does not exist. -// -// Calling this function with a zero-initialized Value struct will cause a panic. -// -// Important: this function should not be used if the caller has access to -// the raw value to avoid an extra allocation. -func (m Map) Update(k string, v Value) { - if av, existing := m.Get(k); existing { - v.copyTo(av.orig) - } -} - -// UpdateString updates an existing string Value with a value. -// No action is applied to the map where the key does not exist. -func (m Map) UpdateString(k string, v string) { - if av, existing := m.Get(k); existing { - av.SetStringVal(v) - } -} - -// UpdateInt updates an existing int Value with a value. -// No action is applied to the map where the key does not exist. -func (m Map) UpdateInt(k string, v int64) { - if av, existing := m.Get(k); existing { - av.SetIntVal(v) - } -} - -// UpdateDouble updates an existing double Value with a value. -// No action is applied to the map where the key does not exist. -func (m Map) UpdateDouble(k string, v float64) { - if av, existing := m.Get(k); existing { - av.SetDoubleVal(v) - } -} - -// UpdateBool updates an existing bool Value with a value. -// No action is applied to the map where the key does not exist. -func (m Map) UpdateBool(k string, v bool) { - if av, existing := m.Get(k); existing { - av.SetBoolVal(v) - } -} - -// UpdateBytes updates an existing ImmutableByteSlice Value with a value. -// No action is applied to the map where the key does not exist. -func (m Map) UpdateBytes(k string, v ImmutableByteSlice) { - if av, existing := m.Get(k); existing { - av.SetBytesVal(v) - } -} - -// Upsert performs the Insert or Update action. The Value is -// inserted to the map that did not originally have the key. The key/value is -// updated to the map where the key already existed. -// -// Calling this function with a zero-initialized Value struct will cause a panic. -// -// Important: this function should not be used if the caller has access to -// the raw value to avoid an extra allocation. -func (m Map) Upsert(k string, v Value) { - if av, existing := m.Get(k); existing { - v.copyTo(av.orig) - } else { - *m.orig = append(*m.orig, newAttributeKeyValue(k, v)) - } -} - -// UpsertString performs the Insert or Update action. The Value is -// inserted to the map that did not originally have the key. The key/value is -// updated to the map where the key already existed. -func (m Map) UpsertString(k string, v string) { - if av, existing := m.Get(k); existing { - av.SetStringVal(v) - } else { - *m.orig = append(*m.orig, newAttributeKeyValueString(k, v)) - } -} - -// UpsertInt performs the Insert or Update action. The int Value is -// inserted to the map that did not originally have the key. The key/value is -// updated to the map where the key already existed. -func (m Map) UpsertInt(k string, v int64) { - if av, existing := m.Get(k); existing { - av.SetIntVal(v) - } else { - *m.orig = append(*m.orig, newAttributeKeyValueInt(k, v)) - } -} - -// UpsertDouble performs the Insert or Update action. The double Value is -// inserted to the map that did not originally have the key. The key/value is -// updated to the map where the key already existed. -func (m Map) UpsertDouble(k string, v float64) { - if av, existing := m.Get(k); existing { - av.SetDoubleVal(v) - } else { - *m.orig = append(*m.orig, newAttributeKeyValueDouble(k, v)) - } -} - -// UpsertBool performs the Insert or Update action. The bool Value is -// inserted to the map that did not originally have the key. The key/value is -// updated to the map where the key already existed. -func (m Map) UpsertBool(k string, v bool) { - if av, existing := m.Get(k); existing { - av.SetBoolVal(v) - } else { - *m.orig = append(*m.orig, newAttributeKeyValueBool(k, v)) - } -} - -// UpsertBytes performs the Insert or Update action. The ImmutableByteSlice Value is -// inserted to the map that did not originally have the key. The key/value is -// updated to the map where the key already existed. -func (m Map) UpsertBytes(k string, v ImmutableByteSlice) { - if av, existing := m.Get(k); existing { - av.SetBytesVal(v) - } else { - *m.orig = append(*m.orig, newAttributeKeyValueBytes(k, v)) - } -} - -// Sort sorts the entries in the Map so two instances can be compared. -// Returns the same instance to allow nicer code like: -// assert.EqualValues(t, expected.Sort(), actual.Sort()) -func (m Map) Sort() Map { - // Intention is to move the nil values at the end. - sort.SliceStable(*m.orig, func(i, j int) bool { - return (*m.orig)[i].Key < (*m.orig)[j].Key - }) - return m -} - -// Len returns the length of this map. -// -// Because the Map is represented internally by a slice of pointers, and the data are comping from the wire, -// it is possible that when iterating using "Range" to get access to fewer elements because nil elements are skipped. -func (m Map) Len() int { - return len(*m.orig) -} - -// Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration. -// -// Example: -// -// sm.Range(func(k string, v Value) bool { -// ... -// }) -func (m Map) Range(f func(k string, v Value) bool) { - for i := range *m.orig { - kv := &(*m.orig)[i] - if !f(kv.Key, Value{&kv.Value}) { - break - } - } -} - -// CopyTo copies all elements from the current map to the dest. -func (m Map) CopyTo(dest Map) { - newLen := len(*m.orig) - oldCap := cap(*dest.orig) - if newLen <= oldCap { - // New slice fits in existing slice, no need to reallocate. - *dest.orig = (*dest.orig)[:newLen:oldCap] - for i := range *m.orig { - akv := &(*m.orig)[i] - destAkv := &(*dest.orig)[i] - destAkv.Key = akv.Key - Value{&akv.Value}.copyTo(&destAkv.Value) - } - return - } - - // New slice is bigger than exist slice. Allocate new space. - origs := make([]otlpcommon.KeyValue, len(*m.orig)) - for i := range *m.orig { - akv := &(*m.orig)[i] - origs[i].Key = akv.Key - Value{&akv.Value}.copyTo(&origs[i].Value) - } - *dest.orig = origs -} - -// AsRaw converts an OTLP Map to a standard go map -func (m Map) AsRaw() map[string]interface{} { - rawMap := make(map[string]interface{}) - m.Range(func(k string, v Value) bool { - rawMap[k] = v.asRaw() - return true - }) - return rawMap -} - -// NewSliceFromRaw creates a Slice with values from the given []interface{}. -func NewSliceFromRaw(rawSlice []interface{}) Slice { - if len(rawSlice) == 0 { - v := []otlpcommon.AnyValue(nil) - return Slice{&v} - } - origs := make([]otlpcommon.AnyValue, len(rawSlice)) - for ix, iv := range rawSlice { - newValueFromRaw(iv).copyTo(&origs[ix]) - } - return Slice{&origs} -} - -// AsRaw converts the Slice to a standard go slice. -func (es Slice) AsRaw() []interface{} { - rawSlice := make([]interface{}, 0, es.Len()) - for i := 0; i < es.Len(); i++ { - rawSlice = append(rawSlice, es.At(i).asRaw()) - } - return rawSlice -} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/data/bytesid.go b/vendor/go.opentelemetry.io/collector/pdata/internal/data/bytesid.go index 4a207da1127..2ec68b41b5e 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/data/bytesid.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/data/bytesid.go @@ -23,10 +23,6 @@ import ( // marshalJSON converts trace id into a hex string enclosed in quotes. // Called by Protobuf JSON deserialization. func marshalJSON(id []byte) ([]byte, error) { - if len(id) == 0 { - return []byte(`""`), nil - } - // 2 chars per byte plus 2 quote chars at the start and end. hexLen := 2*len(id) + 2 @@ -58,10 +54,3 @@ func unmarshalJSON(dst []byte, src []byte) error { } return nil } - -func marshalBytes(dst []byte, src []byte) (n int, err error) { - if len(dst) < len(src) { - return 0, errors.New("buffer is too short") - } - return copy(dst, src), nil -} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1/logs_service.pb.go b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1/logs_service.pb.go index 54736710b1e..46f23238014 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1/logs_service.pb.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1/logs_service.pb.go @@ -80,6 +80,22 @@ func (m *ExportLogsServiceRequest) GetResourceLogs() []*v1.ResourceLogs { } type ExportLogsServiceResponse struct { + // The details of a partially successful export request. + // + // If the request is only partially accepted + // (i.e. when the server accepts only parts of the data and rejects the rest) + // the server MUST initialize the `partial_success` field and MUST + // set the `rejected_` with the number of items it rejected. + // + // Servers MAY also make use of the `partial_success` field to convey + // warnings/suggestions to senders even when the request was fully accepted. + // In such cases, the `rejected_` MUST have a value of `0` and + // the `error_message` MUST be non-empty. + // + // A `partial_success` message with an empty value (rejected_ = 0 and + // `error_message` = "") is equivalent to it not being set/present. Senders + // SHOULD interpret it the same way as in the full success case. + PartialSuccess ExportLogsPartialSuccess `protobuf:"bytes,1,opt,name=partial_success,json=partialSuccess,proto3" json:"partial_success"` } func (m *ExportLogsServiceResponse) Reset() { *m = ExportLogsServiceResponse{} } @@ -115,9 +131,80 @@ func (m *ExportLogsServiceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_ExportLogsServiceResponse proto.InternalMessageInfo +func (m *ExportLogsServiceResponse) GetPartialSuccess() ExportLogsPartialSuccess { + if m != nil { + return m.PartialSuccess + } + return ExportLogsPartialSuccess{} +} + +type ExportLogsPartialSuccess struct { + // The number of rejected log records. + // + // A `rejected_` field holding a `0` value indicates that the + // request was fully accepted. + RejectedLogRecords int64 `protobuf:"varint,1,opt,name=rejected_log_records,json=rejectedLogRecords,proto3" json:"rejected_log_records,omitempty"` + // A developer-facing human-readable message in English. It should be used + // either to explain why the server rejected parts of the data during a partial + // success or to convey warnings/suggestions during a full success. The message + // should offer guidance on how users can address such issues. + // + // error_message is an optional field. An error_message with an empty value + // is equivalent to it not being set. + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` +} + +func (m *ExportLogsPartialSuccess) Reset() { *m = ExportLogsPartialSuccess{} } +func (m *ExportLogsPartialSuccess) String() string { return proto.CompactTextString(m) } +func (*ExportLogsPartialSuccess) ProtoMessage() {} +func (*ExportLogsPartialSuccess) Descriptor() ([]byte, []int) { + return fileDescriptor_8e3bf87aaa43acd4, []int{2} +} +func (m *ExportLogsPartialSuccess) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExportLogsPartialSuccess) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExportLogsPartialSuccess.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ExportLogsPartialSuccess) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExportLogsPartialSuccess.Merge(m, src) +} +func (m *ExportLogsPartialSuccess) XXX_Size() int { + return m.Size() +} +func (m *ExportLogsPartialSuccess) XXX_DiscardUnknown() { + xxx_messageInfo_ExportLogsPartialSuccess.DiscardUnknown(m) +} + +var xxx_messageInfo_ExportLogsPartialSuccess proto.InternalMessageInfo + +func (m *ExportLogsPartialSuccess) GetRejectedLogRecords() int64 { + if m != nil { + return m.RejectedLogRecords + } + return 0 +} + +func (m *ExportLogsPartialSuccess) GetErrorMessage() string { + if m != nil { + return m.ErrorMessage + } + return "" +} + func init() { proto.RegisterType((*ExportLogsServiceRequest)(nil), "opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest") proto.RegisterType((*ExportLogsServiceResponse)(nil), "opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse") + proto.RegisterType((*ExportLogsPartialSuccess)(nil), "opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess") } func init() { @@ -125,26 +212,34 @@ func init() { } var fileDescriptor_8e3bf87aaa43acd4 = []byte{ - // 302 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0xc8, 0x2f, 0x48, 0xcd, - 0x2b, 0x49, 0xcd, 0x49, 0xcd, 0x4d, 0x2d, 0x29, 0xaa, 0xd4, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, - 0x4f, 0xce, 0xcf, 0xc9, 0x49, 0x4d, 0x2e, 0xc9, 0x2f, 0xd2, 0xcf, 0xc9, 0x4f, 0x2f, 0xd6, 0x2f, - 0x33, 0x04, 0xd3, 0xf1, 0xc5, 0xa9, 0x45, 0x65, 0x99, 0xc9, 0xa9, 0x7a, 0x60, 0x45, 0x42, 0xaa, - 0x28, 0x3a, 0x21, 0x82, 0x7a, 0x70, 0x9d, 0x7a, 0x20, 0x1d, 0x7a, 0x65, 0x86, 0x52, 0x22, 0xe9, - 0xf9, 0xe9, 0xf9, 0x10, 0x63, 0x41, 0x2c, 0x88, 0x3a, 0x29, 0x35, 0x6c, 0xd6, 0x22, 0x5b, 0x06, - 0x51, 0xa7, 0x94, 0xc5, 0x25, 0xe1, 0x5a, 0x51, 0x90, 0x5f, 0x54, 0xe2, 0x93, 0x9f, 0x5e, 0x1c, - 0x0c, 0xb1, 0x3f, 0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x44, 0xc8, 0x8f, 0x8b, 0xb7, 0x28, 0xb5, - 0x38, 0xbf, 0xb4, 0x28, 0x39, 0x35, 0x1e, 0xa4, 0x45, 0x82, 0x51, 0x81, 0x59, 0x83, 0xdb, 0x48, - 0x53, 0x0f, 0x9b, 0xc3, 0xa0, 0xce, 0xd1, 0x0b, 0x82, 0xea, 0x00, 0x99, 0x17, 0xc4, 0x53, 0x84, - 0xc4, 0x53, 0x92, 0xe6, 0x92, 0xc4, 0x62, 0x57, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0xd1, 0x5c, - 0x46, 0x2e, 0x6e, 0x24, 0x71, 0xa1, 0x5e, 0x46, 0x2e, 0x36, 0x88, 0x6a, 0x21, 0x7b, 0x3d, 0xa2, - 0x42, 0x42, 0x0f, 0x97, 0x47, 0xa4, 0x1c, 0xc8, 0x37, 0x00, 0xe2, 0x3a, 0x25, 0x06, 0xa7, 0x25, - 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, - 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0xc0, 0xa5, 0x91, 0x99, 0x4f, 0x9c, - 0x05, 0x4e, 0x02, 0x48, 0x66, 0x07, 0x80, 0xd4, 0x04, 0x30, 0x46, 0xf9, 0xa4, 0xa3, 0xeb, 0xce, - 0x44, 0x4e, 0x20, 0x05, 0x29, 0x89, 0x25, 0x89, 0xfa, 0x99, 0x79, 0x25, 0xa9, 0x45, 0x79, 0x89, - 0x39, 0xfa, 0x60, 0x1e, 0xd8, 0xf8, 0xf4, 0xd4, 0x3c, 0xcc, 0x74, 0x94, 0xc4, 0x06, 0x96, 0x33, - 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x5e, 0x56, 0x81, 0x5e, 0x77, 0x02, 0x00, 0x00, + // 430 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xc1, 0x6e, 0x13, 0x31, + 0x10, 0x86, 0xd7, 0x2d, 0xaa, 0x84, 0xd3, 0x02, 0xb2, 0x7a, 0x08, 0x39, 0x2c, 0x55, 0x50, 0x51, + 0xb8, 0x78, 0x49, 0xb8, 0x70, 0x03, 0x05, 0x71, 0x0b, 0x10, 0x6d, 0x11, 0x07, 0x2e, 0xab, 0xc5, + 0x19, 0x59, 0x5b, 0x6d, 0x77, 0xdc, 0xb1, 0x13, 0xc1, 0x33, 0x20, 0x24, 0x5e, 0x80, 0x17, 0xe0, + 0x49, 0x7a, 0xe0, 0xd0, 0x23, 0x27, 0x84, 0x92, 0x17, 0x41, 0x5e, 0x97, 0xb0, 0x0b, 0x39, 0x04, + 0x4e, 0xbb, 0x1e, 0xcf, 0xff, 0xfd, 0xff, 0xd8, 0x32, 0x7f, 0x84, 0x06, 0x2a, 0x07, 0x25, 0x9c, + 0x81, 0xa3, 0xf7, 0x89, 0x21, 0x74, 0x98, 0x28, 0x2c, 0x4b, 0x50, 0x0e, 0x29, 0x29, 0x51, 0xdb, + 0x64, 0x31, 0xac, 0xbf, 0x99, 0x05, 0x5a, 0x14, 0x0a, 0x64, 0xdd, 0x24, 0x8e, 0x5b, 0xca, 0x50, + 0x94, 0x6b, 0xa5, 0xf4, 0x0a, 0xb9, 0x18, 0xf6, 0x0e, 0x35, 0x6a, 0x0c, 0x58, 0xff, 0x17, 0xfa, + 0x7a, 0xf7, 0x36, 0xd9, 0x36, 0xcd, 0x42, 0x5f, 0xff, 0x94, 0x77, 0x9f, 0xbd, 0x33, 0x48, 0x6e, + 0x82, 0xda, 0x9e, 0x04, 0xff, 0x14, 0xce, 0xe7, 0x60, 0x9d, 0x78, 0xc1, 0x0f, 0x08, 0x2c, 0xce, + 0x49, 0x41, 0xe6, 0x25, 0x5d, 0x76, 0xb4, 0x3b, 0xe8, 0x8c, 0xee, 0xcb, 0x4d, 0xc1, 0xae, 0xe2, + 0xc8, 0xf4, 0x4a, 0xe1, 0x79, 0xe9, 0x3e, 0x35, 0x56, 0xfd, 0x0f, 0x8c, 0xdf, 0xde, 0x60, 0x66, + 0x0d, 0x56, 0x16, 0x44, 0xc5, 0x6f, 0x9a, 0x9c, 0x5c, 0x91, 0x97, 0x99, 0x9d, 0x2b, 0x05, 0xd6, + 0xfb, 0xb1, 0x41, 0x67, 0xf4, 0x58, 0x6e, 0x75, 0x10, 0xf2, 0x37, 0x7a, 0x1a, 0x38, 0x27, 0x01, + 0x33, 0xbe, 0x76, 0xf1, 0xfd, 0x4e, 0x94, 0xde, 0x30, 0xad, 0x6a, 0xff, 0xbc, 0x39, 0x79, 0x5b, + 0x21, 0x1e, 0xf0, 0x43, 0x82, 0x53, 0x50, 0x0e, 0x66, 0x7e, 0xf2, 0x8c, 0x40, 0x21, 0xcd, 0x42, + 0xa0, 0xdd, 0x54, 0xfc, 0xda, 0x9b, 0xa0, 0x4e, 0xc3, 0x8e, 0xb8, 0xcb, 0x0f, 0x80, 0x08, 0x29, + 0x3b, 0x03, 0x6b, 0x73, 0x0d, 0xdd, 0x9d, 0x23, 0x36, 0xb8, 0x9e, 0xee, 0xd7, 0xc5, 0xe7, 0xa1, + 0x36, 0xfa, 0xcc, 0x78, 0xa7, 0x31, 0xba, 0xf8, 0xc8, 0xf8, 0x5e, 0xc8, 0x20, 0xfe, 0x7d, 0xc8, + 0xf6, 0x65, 0xf5, 0x9e, 0xfc, 0x3f, 0x20, 0x5c, 0x40, 0x3f, 0x1a, 0x7f, 0x65, 0x17, 0xcb, 0x98, + 0x5d, 0x2e, 0x63, 0xf6, 0x63, 0x19, 0xb3, 0x4f, 0xab, 0x38, 0xba, 0x5c, 0xc5, 0xd1, 0xb7, 0x55, + 0x1c, 0xf1, 0x41, 0x81, 0xdb, 0x19, 0x8c, 0x6f, 0x35, 0xd8, 0x53, 0xdf, 0x33, 0x65, 0x6f, 0x26, + 0xfa, 0x4f, 0x75, 0xd1, 0x7c, 0x04, 0x66, 0x96, 0xbb, 0x3c, 0x29, 0x2a, 0x07, 0x54, 0xe5, 0x65, + 0x52, 0xaf, 0x6a, 0xbc, 0x86, 0xea, 0xef, 0xb7, 0xf2, 0x65, 0xe7, 0xf8, 0xa5, 0x81, 0xea, 0xd5, + 0x9a, 0x55, 0xbb, 0xc8, 0xa7, 0xeb, 0x24, 0x3e, 0x80, 0x7c, 0x3d, 0x7c, 0xbb, 0x57, 0x33, 0x1e, + 0xfe, 0x0c, 0x00, 0x00, 0xff, 0xff, 0xf0, 0xaf, 0x6c, 0x7d, 0x83, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -288,6 +383,51 @@ func (m *ExportLogsServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro _ = i var l int _ = l + { + size, err := m.PartialSuccess.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogsService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ExportLogsPartialSuccess) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExportLogsPartialSuccess) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExportLogsPartialSuccess) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ErrorMessage) > 0 { + i -= len(m.ErrorMessage) + copy(dAtA[i:], m.ErrorMessage) + i = encodeVarintLogsService(dAtA, i, uint64(len(m.ErrorMessage))) + i-- + dAtA[i] = 0x12 + } + if m.RejectedLogRecords != 0 { + i = encodeVarintLogsService(dAtA, i, uint64(m.RejectedLogRecords)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } @@ -323,6 +463,24 @@ func (m *ExportLogsServiceResponse) Size() (n int) { } var l int _ = l + l = m.PartialSuccess.Size() + n += 1 + l + sovLogsService(uint64(l)) + return n +} + +func (m *ExportLogsPartialSuccess) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RejectedLogRecords != 0 { + n += 1 + sovLogsService(uint64(m.RejectedLogRecords)) + } + l = len(m.ErrorMessage) + if l > 0 { + n += 1 + l + sovLogsService(uint64(l)) + } return n } @@ -445,6 +603,140 @@ func (m *ExportLogsServiceResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: ExportLogsServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialSuccess", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogsService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogsService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogsService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PartialSuccess.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLogsService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLogsService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExportLogsPartialSuccess) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogsService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExportLogsPartialSuccess: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExportLogsPartialSuccess: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RejectedLogRecords", wireType) + } + m.RejectedLogRecords = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogsService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RejectedLogRecords |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrorMessage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogsService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthLogsService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLogsService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ErrorMessage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipLogsService(dAtA[iNdEx:]) diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1/metrics_service.pb.go b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1/metrics_service.pb.go index e0657f4e5b4..fa9bf1307ed 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1/metrics_service.pb.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1/metrics_service.pb.go @@ -80,6 +80,22 @@ func (m *ExportMetricsServiceRequest) GetResourceMetrics() []*v1.ResourceMetrics } type ExportMetricsServiceResponse struct { + // The details of a partially successful export request. + // + // If the request is only partially accepted + // (i.e. when the server accepts only parts of the data and rejects the rest) + // the server MUST initialize the `partial_success` field and MUST + // set the `rejected_` with the number of items it rejected. + // + // Servers MAY also make use of the `partial_success` field to convey + // warnings/suggestions to senders even when the request was fully accepted. + // In such cases, the `rejected_` MUST have a value of `0` and + // the `error_message` MUST be non-empty. + // + // A `partial_success` message with an empty value (rejected_ = 0 and + // `error_message` = "") is equivalent to it not being set/present. Senders + // SHOULD interpret it the same way as in the full success case. + PartialSuccess ExportMetricsPartialSuccess `protobuf:"bytes,1,opt,name=partial_success,json=partialSuccess,proto3" json:"partial_success"` } func (m *ExportMetricsServiceResponse) Reset() { *m = ExportMetricsServiceResponse{} } @@ -115,9 +131,80 @@ func (m *ExportMetricsServiceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_ExportMetricsServiceResponse proto.InternalMessageInfo +func (m *ExportMetricsServiceResponse) GetPartialSuccess() ExportMetricsPartialSuccess { + if m != nil { + return m.PartialSuccess + } + return ExportMetricsPartialSuccess{} +} + +type ExportMetricsPartialSuccess struct { + // The number of rejected data points. + // + // A `rejected_` field holding a `0` value indicates that the + // request was fully accepted. + RejectedDataPoints int64 `protobuf:"varint,1,opt,name=rejected_data_points,json=rejectedDataPoints,proto3" json:"rejected_data_points,omitempty"` + // A developer-facing human-readable message in English. It should be used + // either to explain why the server rejected parts of the data during a partial + // success or to convey warnings/suggestions during a full success. The message + // should offer guidance on how users can address such issues. + // + // error_message is an optional field. An error_message with an empty value + // is equivalent to it not being set. + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` +} + +func (m *ExportMetricsPartialSuccess) Reset() { *m = ExportMetricsPartialSuccess{} } +func (m *ExportMetricsPartialSuccess) String() string { return proto.CompactTextString(m) } +func (*ExportMetricsPartialSuccess) ProtoMessage() {} +func (*ExportMetricsPartialSuccess) Descriptor() ([]byte, []int) { + return fileDescriptor_75fb6015e6e64798, []int{2} +} +func (m *ExportMetricsPartialSuccess) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExportMetricsPartialSuccess) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExportMetricsPartialSuccess.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ExportMetricsPartialSuccess) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExportMetricsPartialSuccess.Merge(m, src) +} +func (m *ExportMetricsPartialSuccess) XXX_Size() int { + return m.Size() +} +func (m *ExportMetricsPartialSuccess) XXX_DiscardUnknown() { + xxx_messageInfo_ExportMetricsPartialSuccess.DiscardUnknown(m) +} + +var xxx_messageInfo_ExportMetricsPartialSuccess proto.InternalMessageInfo + +func (m *ExportMetricsPartialSuccess) GetRejectedDataPoints() int64 { + if m != nil { + return m.RejectedDataPoints + } + return 0 +} + +func (m *ExportMetricsPartialSuccess) GetErrorMessage() string { + if m != nil { + return m.ErrorMessage + } + return "" +} + func init() { proto.RegisterType((*ExportMetricsServiceRequest)(nil), "opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest") proto.RegisterType((*ExportMetricsServiceResponse)(nil), "opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse") + proto.RegisterType((*ExportMetricsPartialSuccess)(nil), "opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess") } func init() { @@ -125,26 +212,34 @@ func init() { } var fileDescriptor_75fb6015e6e64798 = []byte{ - // 303 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0xcb, 0x2f, 0x48, 0xcd, - 0x2b, 0x49, 0xcd, 0x49, 0xcd, 0x4d, 0x2d, 0x29, 0xaa, 0xd4, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, - 0x4f, 0xce, 0xcf, 0xc9, 0x49, 0x4d, 0x2e, 0xc9, 0x2f, 0xd2, 0x07, 0x89, 0x66, 0x26, 0x17, 0xeb, - 0x97, 0x19, 0xc2, 0x98, 0xf1, 0xc5, 0xa9, 0x45, 0x65, 0x99, 0xc9, 0xa9, 0x7a, 0x60, 0xa5, 0x42, - 0x1a, 0x28, 0xfa, 0x21, 0x82, 0x7a, 0x70, 0xfd, 0x7a, 0x50, 0x4d, 0x7a, 0x65, 0x86, 0x52, 0x22, - 0xe9, 0xf9, 0xe9, 0xf9, 0x10, 0xf3, 0x41, 0x2c, 0x88, 0x52, 0x29, 0x1d, 0x6c, 0xf6, 0x63, 0xda, - 0x0a, 0x51, 0xad, 0x54, 0xc9, 0x25, 0xed, 0x5a, 0x51, 0x90, 0x5f, 0x54, 0xe2, 0x0b, 0x11, 0x0e, - 0x86, 0xb8, 0x25, 0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x44, 0x28, 0x8a, 0x4b, 0xa0, 0x28, 0xb5, - 0x38, 0xbf, 0xb4, 0x28, 0x39, 0x35, 0x1e, 0xaa, 0x51, 0x82, 0x51, 0x81, 0x59, 0x83, 0xdb, 0x48, - 0x5f, 0x0f, 0x9b, 0x3b, 0x11, 0xae, 0xd3, 0x0b, 0x82, 0xea, 0x83, 0x1a, 0x1c, 0xc4, 0x5f, 0x84, - 0x2a, 0xa0, 0x24, 0xc7, 0x25, 0x83, 0xdd, 0xea, 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0xa3, 0x35, - 0x8c, 0x5c, 0x7c, 0xa8, 0x52, 0x42, 0x33, 0x19, 0xb9, 0xd8, 0x20, 0x7a, 0x84, 0x5c, 0xf5, 0x88, - 0x0d, 0x27, 0x3d, 0x3c, 0x1e, 0x94, 0x72, 0xa3, 0xd4, 0x18, 0x88, 0x63, 0x95, 0x18, 0x9c, 0xd6, - 0x32, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, - 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x03, 0x97, 0x76, 0x66, 0x3e, 0xd1, - 0xd6, 0x38, 0x09, 0xa3, 0xda, 0x10, 0x00, 0x52, 0x19, 0xc0, 0x18, 0xe5, 0x9f, 0x8e, 0x6e, 0x46, - 0x26, 0x72, 0xb2, 0x2a, 0x48, 0x49, 0x2c, 0x49, 0xd4, 0xcf, 0xcc, 0x2b, 0x49, 0x2d, 0xca, 0x4b, - 0xcc, 0xd1, 0x07, 0xf3, 0xc0, 0x96, 0xa4, 0xa7, 0xe6, 0x61, 0x4d, 0x7d, 0x49, 0x6c, 0x60, 0x69, - 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x13, 0x8e, 0x3e, 0xb0, 0x02, 0x00, 0x00, + // 427 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xbf, 0x8e, 0xd3, 0x30, + 0x18, 0x8f, 0xef, 0xd0, 0x49, 0xf8, 0xe0, 0x0e, 0x99, 0x1b, 0x4e, 0x05, 0x85, 0x53, 0x58, 0x22, + 0x81, 0x1c, 0x5a, 0x76, 0x86, 0xc2, 0xb1, 0x9d, 0x1a, 0xa5, 0x88, 0xa1, 0x4b, 0x64, 0xdc, 0x4f, + 0x51, 0x50, 0x1a, 0x1b, 0xdb, 0xad, 0xe8, 0x5b, 0x30, 0xb0, 0xf0, 0x0a, 0x88, 0x07, 0xe9, 0xd8, + 0xb1, 0x13, 0x42, 0xed, 0x8b, 0xa0, 0xc4, 0x69, 0xc1, 0x25, 0x43, 0xc5, 0x6d, 0xce, 0xcf, 0xdf, + 0xef, 0x4f, 0x7e, 0xd6, 0x87, 0x5f, 0x09, 0x09, 0xa5, 0x81, 0x02, 0x26, 0x60, 0xd4, 0x3c, 0x92, + 0x4a, 0x18, 0x11, 0x71, 0x51, 0x14, 0xc0, 0x8d, 0x50, 0x51, 0x85, 0xe6, 0x5c, 0x47, 0xb3, 0xee, + 0xf6, 0x98, 0x6a, 0x50, 0xb3, 0x9c, 0x03, 0xad, 0x47, 0x49, 0xe8, 0xf0, 0x2d, 0x48, 0x77, 0x7c, + 0xda, 0x90, 0xe8, 0xac, 0xdb, 0xb9, 0xc8, 0x44, 0x26, 0xac, 0x7e, 0x75, 0xb2, 0xa3, 0x9d, 0xe7, + 0x6d, 0xfe, 0xff, 0xba, 0xda, 0xe9, 0x60, 0x8e, 0x1f, 0x5d, 0x7f, 0x96, 0x42, 0x99, 0x1b, 0x0b, + 0x0f, 0x6d, 0x96, 0x04, 0x3e, 0x4d, 0x41, 0x1b, 0x32, 0xc2, 0x0f, 0x14, 0x68, 0x31, 0x55, 0x1c, + 0xd2, 0x86, 0x78, 0x89, 0xae, 0x8e, 0xc3, 0xd3, 0x5e, 0x44, 0xdb, 0x72, 0xfe, 0x49, 0x47, 0x93, + 0x86, 0xd7, 0x08, 0x27, 0xe7, 0xca, 0x05, 0x82, 0xaf, 0x08, 0x3f, 0x6e, 0xf7, 0xd6, 0x52, 0x94, + 0x1a, 0x88, 0xc1, 0xe7, 0x92, 0x29, 0x93, 0xb3, 0x22, 0xd5, 0x53, 0xce, 0x41, 0x57, 0xde, 0x28, + 0x3c, 0xed, 0x5d, 0xd3, 0x43, 0x3b, 0xa2, 0x8e, 0x41, 0x6c, 0xd5, 0x86, 0x56, 0xac, 0x7f, 0x67, + 0xf1, 0xf3, 0x89, 0x97, 0x9c, 0x49, 0x07, 0x0d, 0xcc, 0x5e, 0x23, 0x2e, 0x89, 0xbc, 0xc0, 0x17, + 0x0a, 0x3e, 0x02, 0x37, 0x30, 0x4e, 0xc7, 0xcc, 0xb0, 0x54, 0x8a, 0xbc, 0x34, 0x36, 0xd9, 0x71, + 0x42, 0xb6, 0x77, 0x6f, 0x98, 0x61, 0x71, 0x7d, 0x43, 0x9e, 0xe2, 0xfb, 0xa0, 0x94, 0x50, 0xe9, + 0x04, 0xb4, 0x66, 0x19, 0x5c, 0x1e, 0x5d, 0xa1, 0xf0, 0x6e, 0x72, 0xaf, 0x06, 0x6f, 0x2c, 0xd6, + 0xfb, 0x81, 0xf0, 0x99, 0x5b, 0x03, 0xf9, 0x86, 0xf0, 0x89, 0x4d, 0x42, 0xfe, 0xf7, 0x87, 0xdd, + 0xd7, 0xec, 0xbc, 0xbd, 0xad, 0x8c, 0x7d, 0x98, 0xc0, 0xeb, 0xaf, 0xd0, 0x62, 0xed, 0xa3, 0xe5, + 0xda, 0x47, 0xbf, 0xd6, 0x3e, 0xfa, 0xb2, 0xf1, 0xbd, 0xe5, 0xc6, 0xf7, 0x56, 0x1b, 0xdf, 0xc3, + 0xcf, 0x72, 0x71, 0xb0, 0x4d, 0xff, 0xa1, 0xeb, 0x10, 0x57, 0x93, 0x31, 0x1a, 0x0d, 0xb2, 0x7d, + 0x8d, 0xfc, 0xef, 0x1d, 0x92, 0x55, 0xf1, 0x51, 0x5e, 0x1a, 0x50, 0x25, 0x2b, 0xa2, 0xfa, 0xab, + 0x36, 0xc9, 0xa0, 0x6c, 0x5d, 0xb5, 0xef, 0x47, 0xe1, 0x40, 0x42, 0xf9, 0x6e, 0x27, 0x57, 0x1b, + 0xd1, 0xd7, 0xbb, 0x48, 0x4d, 0x0c, 0xfa, 0xbe, 0xfb, 0xe1, 0xa4, 0x56, 0x7a, 0xf9, 0x3b, 0x00, + 0x00, 0xff, 0xff, 0x47, 0xf2, 0x5f, 0x42, 0xc8, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -288,6 +383,51 @@ func (m *ExportMetricsServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, e _ = i var l int _ = l + { + size, err := m.PartialSuccess.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetricsService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ExportMetricsPartialSuccess) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExportMetricsPartialSuccess) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExportMetricsPartialSuccess) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ErrorMessage) > 0 { + i -= len(m.ErrorMessage) + copy(dAtA[i:], m.ErrorMessage) + i = encodeVarintMetricsService(dAtA, i, uint64(len(m.ErrorMessage))) + i-- + dAtA[i] = 0x12 + } + if m.RejectedDataPoints != 0 { + i = encodeVarintMetricsService(dAtA, i, uint64(m.RejectedDataPoints)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } @@ -323,6 +463,24 @@ func (m *ExportMetricsServiceResponse) Size() (n int) { } var l int _ = l + l = m.PartialSuccess.Size() + n += 1 + l + sovMetricsService(uint64(l)) + return n +} + +func (m *ExportMetricsPartialSuccess) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RejectedDataPoints != 0 { + n += 1 + sovMetricsService(uint64(m.RejectedDataPoints)) + } + l = len(m.ErrorMessage) + if l > 0 { + n += 1 + l + sovMetricsService(uint64(l)) + } return n } @@ -445,6 +603,140 @@ func (m *ExportMetricsServiceResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: ExportMetricsServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialSuccess", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetricsService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetricsService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetricsService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PartialSuccess.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetricsService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetricsService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExportMetricsPartialSuccess) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetricsService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExportMetricsPartialSuccess: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExportMetricsPartialSuccess: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RejectedDataPoints", wireType) + } + m.RejectedDataPoints = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetricsService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RejectedDataPoints |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrorMessage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetricsService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetricsService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetricsService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ErrorMessage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMetricsService(dAtA[iNdEx:]) diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1/trace_config.pb.go b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1/trace_config.pb.go deleted file mode 100644 index 363f3c13fef..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1/trace_config.pb.go +++ /dev/null @@ -1,1250 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: opentelemetry/proto/trace/v1/trace_config.proto - -package v1 - -import ( - encoding_binary "encoding/binary" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// How spans should be sampled: -// - Always off -// - Always on -// - Always follow the parent Span's decision (off if no parent). -type ConstantSampler_ConstantDecision int32 - -const ( - ConstantSampler_ALWAYS_OFF ConstantSampler_ConstantDecision = 0 - ConstantSampler_ALWAYS_ON ConstantSampler_ConstantDecision = 1 - ConstantSampler_ALWAYS_PARENT ConstantSampler_ConstantDecision = 2 -) - -var ConstantSampler_ConstantDecision_name = map[int32]string{ - 0: "ALWAYS_OFF", - 1: "ALWAYS_ON", - 2: "ALWAYS_PARENT", -} - -var ConstantSampler_ConstantDecision_value = map[string]int32{ - "ALWAYS_OFF": 0, - "ALWAYS_ON": 1, - "ALWAYS_PARENT": 2, -} - -func (x ConstantSampler_ConstantDecision) String() string { - return proto.EnumName(ConstantSampler_ConstantDecision_name, int32(x)) -} - -func (ConstantSampler_ConstantDecision) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_5936aa8fa6443e6f, []int{1, 0} -} - -// Global configuration of the trace service. All fields must be specified, or -// the default (zero) values will be used for each type. -type TraceConfig struct { - // The global default sampler used to make decisions on span sampling. - // - // Types that are valid to be assigned to Sampler: - // *TraceConfig_ConstantSampler - // *TraceConfig_TraceIdRatioBased - // *TraceConfig_RateLimitingSampler - Sampler isTraceConfig_Sampler `protobuf_oneof:"sampler"` - // The global default max number of attributes per span. - MaxNumberOfAttributes int64 `protobuf:"varint,4,opt,name=max_number_of_attributes,json=maxNumberOfAttributes,proto3" json:"max_number_of_attributes,omitempty"` - // The global default max number of annotation events per span. - MaxNumberOfTimedEvents int64 `protobuf:"varint,5,opt,name=max_number_of_timed_events,json=maxNumberOfTimedEvents,proto3" json:"max_number_of_timed_events,omitempty"` - // The global default max number of attributes per timed event. - MaxNumberOfAttributesPerTimedEvent int64 `protobuf:"varint,6,opt,name=max_number_of_attributes_per_timed_event,json=maxNumberOfAttributesPerTimedEvent,proto3" json:"max_number_of_attributes_per_timed_event,omitempty"` - // The global default max number of link entries per span. - MaxNumberOfLinks int64 `protobuf:"varint,7,opt,name=max_number_of_links,json=maxNumberOfLinks,proto3" json:"max_number_of_links,omitempty"` - // The global default max number of attributes per span. - MaxNumberOfAttributesPerLink int64 `protobuf:"varint,8,opt,name=max_number_of_attributes_per_link,json=maxNumberOfAttributesPerLink,proto3" json:"max_number_of_attributes_per_link,omitempty"` -} - -func (m *TraceConfig) Reset() { *m = TraceConfig{} } -func (m *TraceConfig) String() string { return proto.CompactTextString(m) } -func (*TraceConfig) ProtoMessage() {} -func (*TraceConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_5936aa8fa6443e6f, []int{0} -} -func (m *TraceConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TraceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TraceConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TraceConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_TraceConfig.Merge(m, src) -} -func (m *TraceConfig) XXX_Size() int { - return m.Size() -} -func (m *TraceConfig) XXX_DiscardUnknown() { - xxx_messageInfo_TraceConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_TraceConfig proto.InternalMessageInfo - -type isTraceConfig_Sampler interface { - isTraceConfig_Sampler() - MarshalTo([]byte) (int, error) - Size() int -} - -type TraceConfig_ConstantSampler struct { - ConstantSampler *ConstantSampler `protobuf:"bytes,1,opt,name=constant_sampler,json=constantSampler,proto3,oneof" json:"constant_sampler,omitempty"` -} -type TraceConfig_TraceIdRatioBased struct { - TraceIdRatioBased *TraceIdRatioBased `protobuf:"bytes,2,opt,name=trace_id_ratio_based,json=traceIdRatioBased,proto3,oneof" json:"trace_id_ratio_based,omitempty"` -} -type TraceConfig_RateLimitingSampler struct { - RateLimitingSampler *RateLimitingSampler `protobuf:"bytes,3,opt,name=rate_limiting_sampler,json=rateLimitingSampler,proto3,oneof" json:"rate_limiting_sampler,omitempty"` -} - -func (*TraceConfig_ConstantSampler) isTraceConfig_Sampler() {} -func (*TraceConfig_TraceIdRatioBased) isTraceConfig_Sampler() {} -func (*TraceConfig_RateLimitingSampler) isTraceConfig_Sampler() {} - -func (m *TraceConfig) GetSampler() isTraceConfig_Sampler { - if m != nil { - return m.Sampler - } - return nil -} - -func (m *TraceConfig) GetConstantSampler() *ConstantSampler { - if x, ok := m.GetSampler().(*TraceConfig_ConstantSampler); ok { - return x.ConstantSampler - } - return nil -} - -func (m *TraceConfig) GetTraceIdRatioBased() *TraceIdRatioBased { - if x, ok := m.GetSampler().(*TraceConfig_TraceIdRatioBased); ok { - return x.TraceIdRatioBased - } - return nil -} - -func (m *TraceConfig) GetRateLimitingSampler() *RateLimitingSampler { - if x, ok := m.GetSampler().(*TraceConfig_RateLimitingSampler); ok { - return x.RateLimitingSampler - } - return nil -} - -func (m *TraceConfig) GetMaxNumberOfAttributes() int64 { - if m != nil { - return m.MaxNumberOfAttributes - } - return 0 -} - -func (m *TraceConfig) GetMaxNumberOfTimedEvents() int64 { - if m != nil { - return m.MaxNumberOfTimedEvents - } - return 0 -} - -func (m *TraceConfig) GetMaxNumberOfAttributesPerTimedEvent() int64 { - if m != nil { - return m.MaxNumberOfAttributesPerTimedEvent - } - return 0 -} - -func (m *TraceConfig) GetMaxNumberOfLinks() int64 { - if m != nil { - return m.MaxNumberOfLinks - } - return 0 -} - -func (m *TraceConfig) GetMaxNumberOfAttributesPerLink() int64 { - if m != nil { - return m.MaxNumberOfAttributesPerLink - } - return 0 -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*TraceConfig) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*TraceConfig_ConstantSampler)(nil), - (*TraceConfig_TraceIdRatioBased)(nil), - (*TraceConfig_RateLimitingSampler)(nil), - } -} - -// Sampler that always makes a constant decision on span sampling. -type ConstantSampler struct { - Decision ConstantSampler_ConstantDecision `protobuf:"varint,1,opt,name=decision,proto3,enum=opentelemetry.proto.trace.v1.ConstantSampler_ConstantDecision" json:"decision,omitempty"` -} - -func (m *ConstantSampler) Reset() { *m = ConstantSampler{} } -func (m *ConstantSampler) String() string { return proto.CompactTextString(m) } -func (*ConstantSampler) ProtoMessage() {} -func (*ConstantSampler) Descriptor() ([]byte, []int) { - return fileDescriptor_5936aa8fa6443e6f, []int{1} -} -func (m *ConstantSampler) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConstantSampler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConstantSampler.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ConstantSampler) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConstantSampler.Merge(m, src) -} -func (m *ConstantSampler) XXX_Size() int { - return m.Size() -} -func (m *ConstantSampler) XXX_DiscardUnknown() { - xxx_messageInfo_ConstantSampler.DiscardUnknown(m) -} - -var xxx_messageInfo_ConstantSampler proto.InternalMessageInfo - -func (m *ConstantSampler) GetDecision() ConstantSampler_ConstantDecision { - if m != nil { - return m.Decision - } - return ConstantSampler_ALWAYS_OFF -} - -// Sampler that tries to uniformly sample traces with a given ratio. -// The ratio of sampling a trace is equal to that of the specified ratio. -type TraceIdRatioBased struct { - // The desired ratio of sampling. Must be within [0.0, 1.0]. - SamplingRatio float64 `protobuf:"fixed64,1,opt,name=samplingRatio,proto3" json:"samplingRatio,omitempty"` -} - -func (m *TraceIdRatioBased) Reset() { *m = TraceIdRatioBased{} } -func (m *TraceIdRatioBased) String() string { return proto.CompactTextString(m) } -func (*TraceIdRatioBased) ProtoMessage() {} -func (*TraceIdRatioBased) Descriptor() ([]byte, []int) { - return fileDescriptor_5936aa8fa6443e6f, []int{2} -} -func (m *TraceIdRatioBased) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TraceIdRatioBased) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TraceIdRatioBased.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TraceIdRatioBased) XXX_Merge(src proto.Message) { - xxx_messageInfo_TraceIdRatioBased.Merge(m, src) -} -func (m *TraceIdRatioBased) XXX_Size() int { - return m.Size() -} -func (m *TraceIdRatioBased) XXX_DiscardUnknown() { - xxx_messageInfo_TraceIdRatioBased.DiscardUnknown(m) -} - -var xxx_messageInfo_TraceIdRatioBased proto.InternalMessageInfo - -func (m *TraceIdRatioBased) GetSamplingRatio() float64 { - if m != nil { - return m.SamplingRatio - } - return 0 -} - -// Sampler that tries to sample with a rate per time window. -type RateLimitingSampler struct { - // Rate per second. - Qps int64 `protobuf:"varint,1,opt,name=qps,proto3" json:"qps,omitempty"` -} - -func (m *RateLimitingSampler) Reset() { *m = RateLimitingSampler{} } -func (m *RateLimitingSampler) String() string { return proto.CompactTextString(m) } -func (*RateLimitingSampler) ProtoMessage() {} -func (*RateLimitingSampler) Descriptor() ([]byte, []int) { - return fileDescriptor_5936aa8fa6443e6f, []int{3} -} -func (m *RateLimitingSampler) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RateLimitingSampler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RateLimitingSampler.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RateLimitingSampler) XXX_Merge(src proto.Message) { - xxx_messageInfo_RateLimitingSampler.Merge(m, src) -} -func (m *RateLimitingSampler) XXX_Size() int { - return m.Size() -} -func (m *RateLimitingSampler) XXX_DiscardUnknown() { - xxx_messageInfo_RateLimitingSampler.DiscardUnknown(m) -} - -var xxx_messageInfo_RateLimitingSampler proto.InternalMessageInfo - -func (m *RateLimitingSampler) GetQps() int64 { - if m != nil { - return m.Qps - } - return 0 -} - -func init() { - proto.RegisterEnum("opentelemetry.proto.trace.v1.ConstantSampler_ConstantDecision", ConstantSampler_ConstantDecision_name, ConstantSampler_ConstantDecision_value) - proto.RegisterType((*TraceConfig)(nil), "opentelemetry.proto.trace.v1.TraceConfig") - proto.RegisterType((*ConstantSampler)(nil), "opentelemetry.proto.trace.v1.ConstantSampler") - proto.RegisterType((*TraceIdRatioBased)(nil), "opentelemetry.proto.trace.v1.TraceIdRatioBased") - proto.RegisterType((*RateLimitingSampler)(nil), "opentelemetry.proto.trace.v1.RateLimitingSampler") -} - -func init() { - proto.RegisterFile("opentelemetry/proto/trace/v1/trace_config.proto", fileDescriptor_5936aa8fa6443e6f) -} - -var fileDescriptor_5936aa8fa6443e6f = []byte{ - // 563 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xcd, 0x6e, 0xd3, 0x40, - 0x14, 0x85, 0xed, 0x86, 0xfe, 0xdd, 0xaa, 0xad, 0x3b, 0x6d, 0x91, 0x55, 0x55, 0xa6, 0x58, 0x48, - 0x64, 0xd3, 0x58, 0x29, 0x0b, 0x04, 0x0b, 0xa4, 0xa4, 0x3f, 0x14, 0x29, 0xa4, 0x91, 0x1b, 0x09, - 0x91, 0xcd, 0x68, 0x62, 0x4f, 0xac, 0x11, 0xf6, 0x8c, 0x19, 0x4f, 0xa3, 0xb2, 0xe7, 0x01, 0x78, - 0x00, 0xde, 0x82, 0x97, 0x60, 0xd9, 0x25, 0x4b, 0x94, 0xbc, 0x08, 0xf2, 0x38, 0x4d, 0x93, 0xb4, - 0x8d, 0xc4, 0x6e, 0xee, 0x39, 0x73, 0xbe, 0x7b, 0x27, 0xb9, 0x09, 0x78, 0x22, 0xa5, 0x5c, 0xd1, - 0x98, 0x26, 0x54, 0xc9, 0x6f, 0x5e, 0x2a, 0x85, 0x12, 0x9e, 0x92, 0x24, 0xa0, 0x5e, 0xbf, 0x5a, - 0x1c, 0x70, 0x20, 0x78, 0x8f, 0x45, 0x15, 0xed, 0xa1, 0xfd, 0xa9, 0x40, 0x21, 0x56, 0xf4, 0xbd, - 0x4a, 0xbf, 0xba, 0xb7, 0x13, 0x89, 0x48, 0x14, 0x90, 0xfc, 0x54, 0xd8, 0xee, 0xf7, 0x45, 0x58, - 0x6b, 0xe7, 0x57, 0x8e, 0x35, 0x09, 0x75, 0xc0, 0x0a, 0x04, 0xcf, 0x14, 0xe1, 0x0a, 0x67, 0x24, - 0x49, 0x63, 0x2a, 0x6d, 0xf3, 0xc0, 0x2c, 0xaf, 0x1d, 0x1d, 0x56, 0xe6, 0xe1, 0x2b, 0xc7, 0xa3, - 0xd4, 0x65, 0x11, 0x3a, 0x37, 0xfc, 0xcd, 0x60, 0x5a, 0x42, 0x5d, 0xd8, 0x29, 0xa6, 0x66, 0x21, - 0x96, 0x44, 0x31, 0x81, 0xbb, 0x24, 0xa3, 0xa1, 0xbd, 0xa0, 0xf9, 0xde, 0x7c, 0xbe, 0x1e, 0xf2, - 0x43, 0xe8, 0xe7, 0xb9, 0x7a, 0x1e, 0x3b, 0x37, 0xfc, 0x2d, 0x35, 0x2b, 0xa2, 0x08, 0x76, 0x25, - 0x51, 0x14, 0xc7, 0x2c, 0x61, 0x8a, 0xf1, 0x68, 0xfc, 0x88, 0x92, 0x6e, 0x52, 0x9d, 0xdf, 0xc4, - 0x27, 0x8a, 0x36, 0x46, 0xc9, 0xbb, 0x87, 0x6c, 0xcb, 0xfb, 0x32, 0x7a, 0x0d, 0x76, 0x42, 0xae, - 0x31, 0xbf, 0x4a, 0xba, 0x54, 0x62, 0xd1, 0xc3, 0x44, 0x29, 0xc9, 0xba, 0x57, 0x8a, 0x66, 0xf6, - 0x93, 0x03, 0xb3, 0x5c, 0xf2, 0x77, 0x13, 0x72, 0xdd, 0xd4, 0xf6, 0x45, 0xaf, 0x36, 0x36, 0xd1, - 0x5b, 0xd8, 0x9b, 0x0e, 0x2a, 0x96, 0xd0, 0x10, 0xd3, 0x3e, 0xe5, 0x2a, 0xb3, 0x17, 0x75, 0xf4, - 0xe9, 0x44, 0xb4, 0x9d, 0xdb, 0xa7, 0xda, 0x45, 0x6d, 0x28, 0x3f, 0xd6, 0x14, 0xa7, 0x54, 0x4e, - 0xa2, 0xec, 0x25, 0x4d, 0x72, 0x1f, 0x1c, 0xa2, 0x45, 0xe5, 0x1d, 0x16, 0x1d, 0xc2, 0xf6, 0x34, - 0x35, 0x66, 0xfc, 0x4b, 0x66, 0x2f, 0x6b, 0x80, 0x35, 0x01, 0x68, 0xe4, 0x3a, 0x7a, 0x0f, 0xcf, - 0xe7, 0x0e, 0x91, 0xa7, 0xed, 0x15, 0x1d, 0xde, 0x7f, 0xac, 0x7b, 0x4e, 0xaa, 0xaf, 0xc2, 0xf2, - 0xe8, 0xdb, 0x71, 0x7f, 0x99, 0xb0, 0x39, 0xb3, 0x41, 0xa8, 0x03, 0x2b, 0x21, 0x0d, 0x58, 0xc6, - 0x04, 0xd7, 0x2b, 0xb8, 0x71, 0xf4, 0xee, 0xbf, 0x56, 0x70, 0x5c, 0x9f, 0x8c, 0x28, 0xfe, 0x98, - 0xe7, 0x9e, 0x80, 0x35, 0xeb, 0xa2, 0x0d, 0x80, 0x5a, 0xe3, 0x53, 0xed, 0xf3, 0x25, 0xbe, 0x38, - 0x3b, 0xb3, 0x0c, 0xb4, 0x0e, 0xab, 0xb7, 0x75, 0xd3, 0x32, 0xd1, 0x16, 0xac, 0x8f, 0xca, 0x56, - 0xcd, 0x3f, 0x6d, 0xb6, 0xad, 0x05, 0xf7, 0x0d, 0x6c, 0xdd, 0x5b, 0x4b, 0xf4, 0x02, 0xd6, 0xf5, - 0xab, 0x18, 0x8f, 0xb4, 0xaa, 0x67, 0x37, 0xfd, 0x69, 0xd1, 0x7d, 0x09, 0xdb, 0x0f, 0x2c, 0x1b, - 0xb2, 0xa0, 0xf4, 0x35, 0xcd, 0x74, 0xa4, 0xe4, 0xe7, 0xc7, 0xfa, 0x4f, 0xf3, 0xf7, 0xc0, 0x31, - 0x6f, 0x06, 0x8e, 0xf9, 0x77, 0xe0, 0x98, 0x3f, 0x86, 0x8e, 0x71, 0x33, 0x74, 0x8c, 0x3f, 0x43, - 0xc7, 0x80, 0x67, 0x4c, 0xcc, 0xfd, 0x40, 0xea, 0xd6, 0xc4, 0x2f, 0xbb, 0x95, 0x5b, 0x2d, 0xb3, - 0xf3, 0x31, 0x9a, 0x0d, 0x31, 0xe1, 0x05, 0x22, 0x8e, 0x69, 0xa0, 0x84, 0xf4, 0xd2, 0x90, 0x28, - 0xe2, 0x31, 0xae, 0xa8, 0xe4, 0x24, 0xf6, 0x74, 0xa5, 0xa9, 0x11, 0xe5, 0x13, 0xd7, 0x6e, 0xff, - 0x86, 0xba, 0x4b, 0xda, 0x7c, 0xf5, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x0e, 0xd1, 0x4d, 0x12, 0xad, - 0x04, 0x00, 0x00, -} - -func (m *TraceConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TraceConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TraceConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxNumberOfAttributesPerLink != 0 { - i = encodeVarintTraceConfig(dAtA, i, uint64(m.MaxNumberOfAttributesPerLink)) - i-- - dAtA[i] = 0x40 - } - if m.MaxNumberOfLinks != 0 { - i = encodeVarintTraceConfig(dAtA, i, uint64(m.MaxNumberOfLinks)) - i-- - dAtA[i] = 0x38 - } - if m.MaxNumberOfAttributesPerTimedEvent != 0 { - i = encodeVarintTraceConfig(dAtA, i, uint64(m.MaxNumberOfAttributesPerTimedEvent)) - i-- - dAtA[i] = 0x30 - } - if m.MaxNumberOfTimedEvents != 0 { - i = encodeVarintTraceConfig(dAtA, i, uint64(m.MaxNumberOfTimedEvents)) - i-- - dAtA[i] = 0x28 - } - if m.MaxNumberOfAttributes != 0 { - i = encodeVarintTraceConfig(dAtA, i, uint64(m.MaxNumberOfAttributes)) - i-- - dAtA[i] = 0x20 - } - if m.Sampler != nil { - { - size := m.Sampler.Size() - i -= size - if _, err := m.Sampler.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *TraceConfig_ConstantSampler) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TraceConfig_ConstantSampler) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ConstantSampler != nil { - { - size, err := m.ConstantSampler.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTraceConfig(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *TraceConfig_TraceIdRatioBased) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TraceConfig_TraceIdRatioBased) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.TraceIdRatioBased != nil { - { - size, err := m.TraceIdRatioBased.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTraceConfig(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *TraceConfig_RateLimitingSampler) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TraceConfig_RateLimitingSampler) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.RateLimitingSampler != nil { - { - size, err := m.RateLimitingSampler.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTraceConfig(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *ConstantSampler) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConstantSampler) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConstantSampler) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Decision != 0 { - i = encodeVarintTraceConfig(dAtA, i, uint64(m.Decision)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TraceIdRatioBased) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TraceIdRatioBased) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TraceIdRatioBased) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.SamplingRatio != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.SamplingRatio)))) - i-- - dAtA[i] = 0x9 - } - return len(dAtA) - i, nil -} - -func (m *RateLimitingSampler) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RateLimitingSampler) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RateLimitingSampler) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Qps != 0 { - i = encodeVarintTraceConfig(dAtA, i, uint64(m.Qps)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintTraceConfig(dAtA []byte, offset int, v uint64) int { - offset -= sovTraceConfig(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *TraceConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sampler != nil { - n += m.Sampler.Size() - } - if m.MaxNumberOfAttributes != 0 { - n += 1 + sovTraceConfig(uint64(m.MaxNumberOfAttributes)) - } - if m.MaxNumberOfTimedEvents != 0 { - n += 1 + sovTraceConfig(uint64(m.MaxNumberOfTimedEvents)) - } - if m.MaxNumberOfAttributesPerTimedEvent != 0 { - n += 1 + sovTraceConfig(uint64(m.MaxNumberOfAttributesPerTimedEvent)) - } - if m.MaxNumberOfLinks != 0 { - n += 1 + sovTraceConfig(uint64(m.MaxNumberOfLinks)) - } - if m.MaxNumberOfAttributesPerLink != 0 { - n += 1 + sovTraceConfig(uint64(m.MaxNumberOfAttributesPerLink)) - } - return n -} - -func (m *TraceConfig_ConstantSampler) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ConstantSampler != nil { - l = m.ConstantSampler.Size() - n += 1 + l + sovTraceConfig(uint64(l)) - } - return n -} -func (m *TraceConfig_TraceIdRatioBased) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TraceIdRatioBased != nil { - l = m.TraceIdRatioBased.Size() - n += 1 + l + sovTraceConfig(uint64(l)) - } - return n -} -func (m *TraceConfig_RateLimitingSampler) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RateLimitingSampler != nil { - l = m.RateLimitingSampler.Size() - n += 1 + l + sovTraceConfig(uint64(l)) - } - return n -} -func (m *ConstantSampler) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Decision != 0 { - n += 1 + sovTraceConfig(uint64(m.Decision)) - } - return n -} - -func (m *TraceIdRatioBased) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SamplingRatio != 0 { - n += 9 - } - return n -} - -func (m *RateLimitingSampler) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Qps != 0 { - n += 1 + sovTraceConfig(uint64(m.Qps)) - } - return n -} - -func sovTraceConfig(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTraceConfig(x uint64) (n int) { - return sovTraceConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *TraceConfig) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TraceConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TraceConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConstantSampler", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTraceConfig - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTraceConfig - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ConstantSampler{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sampler = &TraceConfig_ConstantSampler{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraceIdRatioBased", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTraceConfig - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTraceConfig - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TraceIdRatioBased{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sampler = &TraceConfig_TraceIdRatioBased{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RateLimitingSampler", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTraceConfig - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTraceConfig - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RateLimitingSampler{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sampler = &TraceConfig_RateLimitingSampler{v} - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxNumberOfAttributes", wireType) - } - m.MaxNumberOfAttributes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxNumberOfAttributes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxNumberOfTimedEvents", wireType) - } - m.MaxNumberOfTimedEvents = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxNumberOfTimedEvents |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxNumberOfAttributesPerTimedEvent", wireType) - } - m.MaxNumberOfAttributesPerTimedEvent = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxNumberOfAttributesPerTimedEvent |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxNumberOfLinks", wireType) - } - m.MaxNumberOfLinks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxNumberOfLinks |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxNumberOfAttributesPerLink", wireType) - } - m.MaxNumberOfAttributesPerLink = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxNumberOfAttributesPerLink |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTraceConfig(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTraceConfig - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConstantSampler) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ConstantSampler: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConstantSampler: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Decision", wireType) - } - m.Decision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Decision |= ConstantSampler_ConstantDecision(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTraceConfig(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTraceConfig - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TraceIdRatioBased) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TraceIdRatioBased: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TraceIdRatioBased: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field SamplingRatio", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.SamplingRatio = float64(math.Float64frombits(v)) - default: - iNdEx = preIndex - skippy, err := skipTraceConfig(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTraceConfig - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RateLimitingSampler) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RateLimitingSampler: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RateLimitingSampler: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Qps", wireType) - } - m.Qps = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Qps |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTraceConfig(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTraceConfig - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTraceConfig(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTraceConfig - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTraceConfig - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTraceConfig - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTraceConfig - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTraceConfig = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTraceConfig = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTraceConfig = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1/trace_service.pb.go b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1/trace_service.pb.go index 0a294a27ece..cd919100f9e 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1/trace_service.pb.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1/trace_service.pb.go @@ -80,6 +80,22 @@ func (m *ExportTraceServiceRequest) GetResourceSpans() []*v1.ResourceSpans { } type ExportTraceServiceResponse struct { + // The details of a partially successful export request. + // + // If the request is only partially accepted + // (i.e. when the server accepts only parts of the data and rejects the rest) + // the server MUST initialize the `partial_success` field and MUST + // set the `rejected_` with the number of items it rejected. + // + // Servers MAY also make use of the `partial_success` field to convey + // warnings/suggestions to senders even when the request was fully accepted. + // In such cases, the `rejected_` MUST have a value of `0` and + // the `error_message` MUST be non-empty. + // + // A `partial_success` message with an empty value (rejected_ = 0 and + // `error_message` = "") is equivalent to it not being set/present. Senders + // SHOULD interpret it the same way as in the full success case. + PartialSuccess ExportTracePartialSuccess `protobuf:"bytes,1,opt,name=partial_success,json=partialSuccess,proto3" json:"partial_success"` } func (m *ExportTraceServiceResponse) Reset() { *m = ExportTraceServiceResponse{} } @@ -115,9 +131,80 @@ func (m *ExportTraceServiceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_ExportTraceServiceResponse proto.InternalMessageInfo +func (m *ExportTraceServiceResponse) GetPartialSuccess() ExportTracePartialSuccess { + if m != nil { + return m.PartialSuccess + } + return ExportTracePartialSuccess{} +} + +type ExportTracePartialSuccess struct { + // The number of rejected spans. + // + // A `rejected_` field holding a `0` value indicates that the + // request was fully accepted. + RejectedSpans int64 `protobuf:"varint,1,opt,name=rejected_spans,json=rejectedSpans,proto3" json:"rejected_spans,omitempty"` + // A developer-facing human-readable message in English. It should be used + // either to explain why the server rejected parts of the data during a partial + // success or to convey warnings/suggestions during a full success. The message + // should offer guidance on how users can address such issues. + // + // error_message is an optional field. An error_message with an empty value + // is equivalent to it not being set. + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` +} + +func (m *ExportTracePartialSuccess) Reset() { *m = ExportTracePartialSuccess{} } +func (m *ExportTracePartialSuccess) String() string { return proto.CompactTextString(m) } +func (*ExportTracePartialSuccess) ProtoMessage() {} +func (*ExportTracePartialSuccess) Descriptor() ([]byte, []int) { + return fileDescriptor_192a962890318cf4, []int{2} +} +func (m *ExportTracePartialSuccess) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExportTracePartialSuccess) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExportTracePartialSuccess.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ExportTracePartialSuccess) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExportTracePartialSuccess.Merge(m, src) +} +func (m *ExportTracePartialSuccess) XXX_Size() int { + return m.Size() +} +func (m *ExportTracePartialSuccess) XXX_DiscardUnknown() { + xxx_messageInfo_ExportTracePartialSuccess.DiscardUnknown(m) +} + +var xxx_messageInfo_ExportTracePartialSuccess proto.InternalMessageInfo + +func (m *ExportTracePartialSuccess) GetRejectedSpans() int64 { + if m != nil { + return m.RejectedSpans + } + return 0 +} + +func (m *ExportTracePartialSuccess) GetErrorMessage() string { + if m != nil { + return m.ErrorMessage + } + return "" +} + func init() { proto.RegisterType((*ExportTraceServiceRequest)(nil), "opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest") proto.RegisterType((*ExportTraceServiceResponse)(nil), "opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse") + proto.RegisterType((*ExportTracePartialSuccess)(nil), "opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess") } func init() { @@ -125,26 +212,33 @@ func init() { } var fileDescriptor_192a962890318cf4 = []byte{ - // 302 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x52, 0xbf, 0x4a, 0xc4, 0x30, - 0x18, 0x6f, 0x10, 0x6e, 0x88, 0x7f, 0xc0, 0xe2, 0xa0, 0x45, 0x82, 0xdc, 0x20, 0x27, 0x42, 0xc2, - 0x9d, 0x9b, 0x9b, 0x05, 0x47, 0xe1, 0xe8, 0x39, 0xb9, 0x48, 0xad, 0x1f, 0xa5, 0x50, 0xf3, 0xc5, - 0x24, 0x57, 0xf4, 0x2d, 0xf4, 0x15, 0x5c, 0x7c, 0x15, 0xc7, 0x1b, 0x1d, 0xa5, 0x7d, 0x11, 0x69, - 0xa2, 0xd2, 0x93, 0x0a, 0x07, 0x6e, 0xdf, 0x9f, 0xdf, 0xbf, 0x84, 0x8f, 0x9e, 0xa2, 0x02, 0x69, - 0xa1, 0x84, 0x3b, 0xb0, 0xfa, 0x51, 0x28, 0x8d, 0x16, 0x45, 0x86, 0x65, 0x09, 0x99, 0x45, 0x2d, - 0xac, 0x4e, 0x33, 0x10, 0xd5, 0xd8, 0x17, 0xd7, 0x06, 0x74, 0x55, 0x64, 0xc0, 0x1d, 0x2c, 0x3c, - 0x5c, 0xe2, 0xfa, 0x21, 0xff, 0xe1, 0x72, 0x47, 0xe1, 0xd5, 0x38, 0xda, 0xc9, 0x31, 0x47, 0xaf, - 0xdc, 0x56, 0x1e, 0x18, 0x8d, 0xfa, 0x9c, 0x97, 0xfd, 0x3c, 0x72, 0x88, 0x74, 0xef, 0xfc, 0x41, - 0xa1, 0xb6, 0x97, 0xed, 0x70, 0xe6, 0x33, 0x24, 0x70, 0x3f, 0x07, 0x63, 0xc3, 0x84, 0x6e, 0x69, - 0x30, 0x38, 0xd7, 0x6d, 0x3c, 0x95, 0x4a, 0xb3, 0x4b, 0x0e, 0xd6, 0x46, 0xeb, 0x93, 0x63, 0xde, - 0x97, 0xee, 0x3b, 0x13, 0x4f, 0xbe, 0x38, 0xb3, 0x96, 0x92, 0x6c, 0xea, 0x6e, 0x3b, 0xdc, 0xa7, - 0x51, 0x9f, 0xa1, 0x51, 0x28, 0x0d, 0x4c, 0x5e, 0x08, 0xdd, 0xe8, 0x2e, 0xc2, 0x67, 0x42, 0x07, - 0x1e, 0x1f, 0x9e, 0xf1, 0xd5, 0xfe, 0x84, 0xff, 0xf9, 0xa0, 0x28, 0xfe, 0x8f, 0x84, 0x8f, 0x38, - 0x0c, 0xe2, 0x57, 0xf2, 0x56, 0x33, 0xb2, 0xa8, 0x19, 0xf9, 0xa8, 0x19, 0x79, 0x6a, 0x58, 0xb0, - 0x68, 0x58, 0xf0, 0xde, 0xb0, 0x80, 0x1e, 0x15, 0xb8, 0xa2, 0x45, 0xbc, 0xdd, 0x55, 0x9f, 0xb6, - 0xa8, 0x29, 0xb9, 0xba, 0xc8, 0x7f, 0xf3, 0x8b, 0xee, 0xc9, 0xa8, 0xdb, 0xd4, 0xa6, 0xa2, 0x90, - 0x16, 0xb4, 0x4c, 0x4b, 0xe1, 0x3a, 0x67, 0x90, 0x83, 0xec, 0xb9, 0xac, 0x9b, 0x81, 0x5b, 0x9e, - 0x7c, 0x06, 0x00, 0x00, 0xff, 0xff, 0xb7, 0x91, 0xe9, 0x89, 0x8a, 0x02, 0x00, 0x00, + // 413 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0x4f, 0xeb, 0xd3, 0x30, + 0x18, 0x6e, 0x36, 0x19, 0x98, 0xfd, 0x11, 0x8b, 0x87, 0xd9, 0x43, 0x1d, 0x15, 0x47, 0x45, 0x48, + 0xd9, 0xbc, 0x79, 0xb3, 0xe2, 0x71, 0x38, 0xba, 0xe1, 0xc1, 0xcb, 0x88, 0xdd, 0x4b, 0xa9, 0x74, + 0x4d, 0x4c, 0xb2, 0xa1, 0x5f, 0x42, 0xf4, 0x2b, 0x78, 0xf4, 0x93, 0xec, 0xb8, 0xa3, 0x27, 0x91, + 0xed, 0x8b, 0x48, 0x12, 0x2d, 0xad, 0xf4, 0x30, 0x7e, 0xbf, 0x5b, 0xf2, 0xf0, 0x3e, 0x7f, 0xde, + 0x27, 0x04, 0xbf, 0x60, 0x1c, 0x4a, 0x05, 0x05, 0xec, 0x40, 0x89, 0xcf, 0x11, 0x17, 0x4c, 0xb1, + 0x28, 0x65, 0x45, 0x01, 0xa9, 0x62, 0x22, 0x52, 0x82, 0xa6, 0x10, 0x1d, 0x66, 0xf6, 0xb0, 0x91, + 0x20, 0x0e, 0x79, 0x0a, 0xc4, 0x8c, 0xb9, 0xd3, 0x06, 0xd7, 0x82, 0xa4, 0xe2, 0x12, 0x43, 0x21, + 0x87, 0x99, 0xf7, 0x20, 0x63, 0x19, 0xb3, 0xca, 0xfa, 0x64, 0x07, 0xbd, 0xb0, 0xcd, 0xb9, 0xe9, + 0x67, 0x27, 0x03, 0x86, 0x1f, 0xbe, 0xfe, 0xc4, 0x99, 0x50, 0x6b, 0x0d, 0xae, 0x6c, 0x86, 0x04, + 0x3e, 0xee, 0x41, 0x2a, 0x37, 0xc1, 0x23, 0x01, 0x92, 0xed, 0x85, 0x8e, 0xc7, 0x69, 0x29, 0xc7, + 0x68, 0xd2, 0x0d, 0xfb, 0xf3, 0x67, 0xa4, 0x2d, 0xdd, 0xbf, 0x4c, 0x24, 0xf9, 0xcb, 0x59, 0x69, + 0x4a, 0x32, 0x14, 0xf5, 0x6b, 0xf0, 0x05, 0x61, 0xaf, 0xcd, 0x51, 0x72, 0x56, 0x4a, 0x70, 0x39, + 0xbe, 0xc7, 0xa9, 0x50, 0x39, 0x2d, 0x36, 0x72, 0x9f, 0xa6, 0x20, 0xb5, 0x27, 0x0a, 0xfb, 0xf3, + 0x97, 0xe4, 0xba, 0x46, 0x48, 0x4d, 0x7c, 0x69, 0x95, 0x56, 0x56, 0x28, 0xbe, 0x73, 0xfc, 0xf5, + 0xc8, 0x49, 0x46, 0xbc, 0x81, 0x06, 0x59, 0xa3, 0x81, 0x26, 0xc5, 0x7d, 0xa2, 0x1b, 0xf8, 0x00, + 0xa9, 0x82, 0x6d, 0xd5, 0x00, 0x0a, 0xbb, 0x7a, 0x29, 0x8b, 0x9a, 0xa5, 0xdc, 0xc7, 0x78, 0x08, + 0x42, 0x30, 0xb1, 0xd9, 0x81, 0x94, 0x34, 0x83, 0x71, 0x67, 0x82, 0xc2, 0xbb, 0xc9, 0xc0, 0x80, + 0x0b, 0x8b, 0xcd, 0xbf, 0x23, 0x3c, 0xa8, 0xef, 0xec, 0x7e, 0x43, 0xb8, 0x67, 0xad, 0xdd, 0x9b, + 0x6c, 0xd7, 0x7c, 0x2c, 0x2f, 0xbe, 0x8d, 0x84, 0x6d, 0x3f, 0x70, 0xe2, 0x13, 0x3a, 0x9e, 0x7d, + 0x74, 0x3a, 0xfb, 0xe8, 0xf7, 0xd9, 0x47, 0x5f, 0x2f, 0xbe, 0x73, 0xba, 0xf8, 0xce, 0xcf, 0x8b, + 0xef, 0xe0, 0xa7, 0x39, 0xbb, 0xd2, 0x22, 0xbe, 0x5f, 0x57, 0x5f, 0xea, 0xa9, 0x25, 0x7a, 0xb7, + 0xc8, 0xfe, 0xe7, 0xe7, 0xf5, 0xef, 0xc0, 0xb7, 0x54, 0xd1, 0x28, 0x2f, 0x15, 0x88, 0x92, 0x16, + 0x91, 0xb9, 0x19, 0x83, 0x0c, 0xca, 0x96, 0x5f, 0xf3, 0xa3, 0x33, 0x7d, 0xc3, 0xa1, 0x5c, 0x57, + 0x62, 0xc6, 0x86, 0xbc, 0xaa, 0xc2, 0x98, 0x08, 0xe4, 0xed, 0xec, 0x7d, 0xcf, 0xa8, 0x3c, 0xff, + 0x13, 0x00, 0x00, 0xff, 0xff, 0x82, 0xce, 0x78, 0xc7, 0x8f, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -288,6 +382,51 @@ func (m *ExportTraceServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, err _ = i var l int _ = l + { + size, err := m.PartialSuccess.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTraceService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ExportTracePartialSuccess) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExportTracePartialSuccess) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExportTracePartialSuccess) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ErrorMessage) > 0 { + i -= len(m.ErrorMessage) + copy(dAtA[i:], m.ErrorMessage) + i = encodeVarintTraceService(dAtA, i, uint64(len(m.ErrorMessage))) + i-- + dAtA[i] = 0x12 + } + if m.RejectedSpans != 0 { + i = encodeVarintTraceService(dAtA, i, uint64(m.RejectedSpans)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } @@ -323,6 +462,24 @@ func (m *ExportTraceServiceResponse) Size() (n int) { } var l int _ = l + l = m.PartialSuccess.Size() + n += 1 + l + sovTraceService(uint64(l)) + return n +} + +func (m *ExportTracePartialSuccess) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RejectedSpans != 0 { + n += 1 + sovTraceService(uint64(m.RejectedSpans)) + } + l = len(m.ErrorMessage) + if l > 0 { + n += 1 + l + sovTraceService(uint64(l)) + } return n } @@ -445,6 +602,140 @@ func (m *ExportTraceServiceResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: ExportTraceServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialSuccess", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTraceService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTraceService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PartialSuccess.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTraceService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTraceService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExportTracePartialSuccess) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExportTracePartialSuccess: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExportTracePartialSuccess: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RejectedSpans", wireType) + } + m.RejectedSpans = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RejectedSpans |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrorMessage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTraceService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTraceService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ErrorMessage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTraceService(dAtA[iNdEx:]) diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1/common.pb.go b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1/common.pb.go index c15aff30d5e..a6085676496 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1/common.pb.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1/common.pb.go @@ -335,79 +335,21 @@ func (m *KeyValue) GetValue() AnyValue { return AnyValue{} } -// InstrumentationLibrary is a message representing the instrumentation library information -// such as the fully qualified name and version. -// InstrumentationLibrary is wire-compatible with InstrumentationScope for binary -// Protobuf format. -// This message is deprecated and will be removed on June 15, 2022. -// -// Deprecated: Do not use. -type InstrumentationLibrary struct { - // An empty instrumentation library name means the name is unknown. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` -} - -func (m *InstrumentationLibrary) Reset() { *m = InstrumentationLibrary{} } -func (m *InstrumentationLibrary) String() string { return proto.CompactTextString(m) } -func (*InstrumentationLibrary) ProtoMessage() {} -func (*InstrumentationLibrary) Descriptor() ([]byte, []int) { - return fileDescriptor_62ba46dcb97aa817, []int{4} -} -func (m *InstrumentationLibrary) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InstrumentationLibrary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InstrumentationLibrary.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *InstrumentationLibrary) XXX_Merge(src proto.Message) { - xxx_messageInfo_InstrumentationLibrary.Merge(m, src) -} -func (m *InstrumentationLibrary) XXX_Size() int { - return m.Size() -} -func (m *InstrumentationLibrary) XXX_DiscardUnknown() { - xxx_messageInfo_InstrumentationLibrary.DiscardUnknown(m) -} - -var xxx_messageInfo_InstrumentationLibrary proto.InternalMessageInfo - -func (m *InstrumentationLibrary) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *InstrumentationLibrary) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - // InstrumentationScope is a message representing the instrumentation scope information // such as the fully qualified name and version. type InstrumentationScope struct { // An empty instrumentation scope name means the name is unknown. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Attributes []KeyValue `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes"` + DroppedAttributesCount uint32 `protobuf:"varint,4,opt,name=dropped_attributes_count,json=droppedAttributesCount,proto3" json:"dropped_attributes_count,omitempty"` } func (m *InstrumentationScope) Reset() { *m = InstrumentationScope{} } func (m *InstrumentationScope) String() string { return proto.CompactTextString(m) } func (*InstrumentationScope) ProtoMessage() {} func (*InstrumentationScope) Descriptor() ([]byte, []int) { - return fileDescriptor_62ba46dcb97aa817, []int{5} + return fileDescriptor_62ba46dcb97aa817, []int{4} } func (m *InstrumentationScope) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -450,12 +392,25 @@ func (m *InstrumentationScope) GetVersion() string { return "" } +func (m *InstrumentationScope) GetAttributes() []KeyValue { + if m != nil { + return m.Attributes + } + return nil +} + +func (m *InstrumentationScope) GetDroppedAttributesCount() uint32 { + if m != nil { + return m.DroppedAttributesCount + } + return 0 +} + func init() { proto.RegisterType((*AnyValue)(nil), "opentelemetry.proto.common.v1.AnyValue") proto.RegisterType((*ArrayValue)(nil), "opentelemetry.proto.common.v1.ArrayValue") proto.RegisterType((*KeyValueList)(nil), "opentelemetry.proto.common.v1.KeyValueList") proto.RegisterType((*KeyValue)(nil), "opentelemetry.proto.common.v1.KeyValue") - proto.RegisterType((*InstrumentationLibrary)(nil), "opentelemetry.proto.common.v1.InstrumentationLibrary") proto.RegisterType((*InstrumentationScope)(nil), "opentelemetry.proto.common.v1.InstrumentationScope") } @@ -464,38 +419,41 @@ func init() { } var fileDescriptor_62ba46dcb97aa817 = []byte{ - // 484 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0xf5, 0x26, 0x69, 0x3e, 0xc6, 0x39, 0xa0, 0x55, 0x85, 0x22, 0xa4, 0xba, 0x26, 0x1c, 0x30, - 0x20, 0xc5, 0x6a, 0xb9, 0x71, 0x6b, 0x5a, 0xa4, 0x00, 0x39, 0x44, 0xae, 0xe0, 0xc0, 0x05, 0xad, - 0xd3, 0x95, 0xb5, 0xaa, 0xbd, 0x1b, 0xad, 0x37, 0x96, 0xfc, 0x2b, 0xe0, 0x67, 0xf5, 0xd8, 0x23, - 0x27, 0x54, 0x25, 0x7f, 0x04, 0xed, 0x87, 0x5b, 0xc8, 0xa1, 0x55, 0x6e, 0x33, 0x6f, 0xde, 0x7b, - 0x33, 0xb3, 0x1f, 0xf0, 0x56, 0xac, 0x28, 0x57, 0x34, 0xa7, 0x05, 0x55, 0xb2, 0x8e, 0x57, 0x52, - 0x28, 0x11, 0x2f, 0x45, 0x51, 0x08, 0x1e, 0x57, 0x27, 0x2e, 0x9a, 0x18, 0x18, 0x1f, 0xfd, 0xc7, - 0xb5, 0xe0, 0xc4, 0x31, 0xaa, 0x93, 0x17, 0x87, 0x99, 0xc8, 0x84, 0x35, 0xd0, 0x91, 0xad, 0x8f, - 0xef, 0x5a, 0xd0, 0x3f, 0xe3, 0xf5, 0x37, 0x92, 0xaf, 0x29, 0x7e, 0x05, 0xc3, 0x52, 0x49, 0xc6, - 0xb3, 0x1f, 0x95, 0xce, 0x47, 0x28, 0x44, 0xd1, 0x60, 0xe6, 0x25, 0xbe, 0x45, 0x2d, 0xe9, 0x18, - 0x20, 0x15, 0x22, 0x77, 0x94, 0x56, 0x88, 0xa2, 0xfe, 0xcc, 0x4b, 0x06, 0x1a, 0xb3, 0x84, 0x23, - 0x18, 0x30, 0xae, 0x5c, 0xbd, 0x1d, 0xa2, 0xa8, 0x3d, 0xf3, 0x92, 0x3e, 0xe3, 0xea, 0xbe, 0xc9, - 0x95, 0x58, 0xa7, 0x39, 0x75, 0x8c, 0x4e, 0x88, 0x22, 0xa4, 0x9b, 0x58, 0xd4, 0x92, 0xe6, 0xe0, - 0x13, 0x29, 0x49, 0xed, 0x38, 0x07, 0x21, 0x8a, 0xfc, 0xd3, 0x37, 0x93, 0x47, 0x37, 0x9c, 0x9c, - 0x69, 0x85, 0xd1, 0xcf, 0xbc, 0x04, 0xc8, 0x7d, 0x86, 0x17, 0x30, 0xbc, 0xae, 0x72, 0x56, 0x36, - 0x43, 0x75, 0x8d, 0xdd, 0xbb, 0x27, 0xec, 0xbe, 0x50, 0x2b, 0x9f, 0xb3, 0x52, 0xe9, 0xf9, 0xac, - 0x85, 0x75, 0x7c, 0x09, 0x7e, 0x5a, 0x2b, 0x5a, 0x3a, 0xc3, 0x5e, 0x88, 0xa2, 0xa1, 0x6e, 0x6a, - 0x40, 0x43, 0x99, 0xf6, 0xe0, 0xc0, 0x14, 0xc7, 0x97, 0x00, 0x0f, 0x93, 0xe1, 0x8f, 0xd0, 0x35, - 0x70, 0x39, 0x42, 0x61, 0x3b, 0xf2, 0x4f, 0x5f, 0x3f, 0xb5, 0x94, 0xbb, 0x9c, 0x69, 0xe7, 0xe6, - 0xcf, 0xb1, 0x97, 0x38, 0xf1, 0xf8, 0x2b, 0x0c, 0xff, 0x9d, 0x6f, 0x6f, 0xdb, 0x46, 0xbc, 0x63, - 0x4b, 0xa0, 0xdf, 0x54, 0xf0, 0x33, 0x68, 0x5f, 0xd3, 0xda, 0x3e, 0x82, 0x44, 0x87, 0xf8, 0xdc, - 0xad, 0x64, 0x6e, 0x7d, 0xef, 0xd1, 0xdd, 0x71, 0x7c, 0x86, 0xe7, 0x9f, 0x78, 0xa9, 0xe4, 0xba, - 0xa0, 0x5c, 0x11, 0xc5, 0x04, 0x9f, 0xb3, 0x54, 0x12, 0x59, 0x63, 0x0c, 0x1d, 0x4e, 0x0a, 0xf7, - 0xec, 0x12, 0x13, 0xe3, 0x11, 0xf4, 0x2a, 0x2a, 0x4b, 0x26, 0xb8, 0x69, 0x3a, 0x48, 0x9a, 0xf4, - 0x43, 0x6b, 0x84, 0xc6, 0x17, 0x70, 0xb8, 0xe3, 0x75, 0xb9, 0x14, 0x2b, 0xba, 0x9f, 0xd3, 0xf4, - 0x27, 0xba, 0xd9, 0x04, 0xe8, 0x76, 0x13, 0xa0, 0xbb, 0x4d, 0x80, 0x7e, 0x6d, 0x03, 0xef, 0x76, - 0x1b, 0x78, 0xbf, 0xb7, 0x81, 0x07, 0x21, 0x13, 0x8f, 0x2f, 0x39, 0xf5, 0xcf, 0x4d, 0xb8, 0xd0, - 0xf0, 0x02, 0x7d, 0xbf, 0xc8, 0x76, 0x05, 0x4c, 0x7f, 0xd8, 0x3c, 0xa7, 0x4b, 0x25, 0x64, 0xbc, - 0xba, 0x22, 0x8a, 0xc4, 0x8c, 0x2b, 0x2a, 0x39, 0xc9, 0x63, 0x93, 0x19, 0xc7, 0x8c, 0xf2, 0x87, - 0x7f, 0x9d, 0x76, 0x0d, 0xf6, 0xfe, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x52, 0xfc, 0xa6, 0x58, - 0xff, 0x03, 0x00, 0x00, + // 532 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x4f, 0x6b, 0x13, 0x41, + 0x14, 0xdf, 0x69, 0xd2, 0xfc, 0x79, 0x1b, 0x41, 0x86, 0x22, 0x41, 0xc8, 0x76, 0x8d, 0x07, 0x57, + 0x85, 0x5d, 0x52, 0x2f, 0x5e, 0x93, 0x28, 0x44, 0xac, 0x18, 0xb6, 0xda, 0x83, 0x97, 0x30, 0x49, + 0x86, 0x30, 0x74, 0x33, 0xb3, 0xcc, 0x4e, 0x02, 0xf9, 0x16, 0x7e, 0x0e, 0x2f, 0x7e, 0x8d, 0x5e, + 0x84, 0x1e, 0x3d, 0x49, 0x49, 0xbe, 0x88, 0xcc, 0x9f, 0x24, 0xb5, 0x87, 0x96, 0x7a, 0x7b, 0xf3, + 0xfb, 0xf7, 0xde, 0xcb, 0x4c, 0x16, 0x5e, 0x89, 0x9c, 0x72, 0x45, 0x33, 0x3a, 0xa7, 0x4a, 0xae, + 0x92, 0x5c, 0x0a, 0x25, 0x92, 0x89, 0x98, 0xcf, 0x05, 0x4f, 0x96, 0x1d, 0x57, 0xc5, 0x06, 0xc6, + 0xad, 0x7f, 0xb4, 0x16, 0x8c, 0x9d, 0x62, 0xd9, 0x79, 0x7a, 0x34, 0x13, 0x33, 0x61, 0x03, 0x74, + 0x65, 0xf9, 0xf6, 0xf5, 0x01, 0xd4, 0xba, 0x7c, 0x75, 0x4e, 0xb2, 0x05, 0xc5, 0xcf, 0xa1, 0x51, + 0x28, 0xc9, 0xf8, 0x6c, 0xb4, 0xd4, 0xe7, 0x26, 0x0a, 0x51, 0x54, 0x1f, 0x78, 0xa9, 0x6f, 0x51, + 0x2b, 0x3a, 0x06, 0x18, 0x0b, 0x91, 0x39, 0xc9, 0x41, 0x88, 0xa2, 0xda, 0xc0, 0x4b, 0xeb, 0x1a, + 0xb3, 0x82, 0x16, 0xd4, 0x19, 0x57, 0x8e, 0x2f, 0x85, 0x28, 0x2a, 0x0d, 0xbc, 0xb4, 0xc6, 0xb8, + 0xda, 0x35, 0x99, 0x8a, 0xc5, 0x38, 0xa3, 0x4e, 0x51, 0x0e, 0x51, 0x84, 0x74, 0x13, 0x8b, 0x5a, + 0xd1, 0x29, 0xf8, 0x44, 0x4a, 0xb2, 0x72, 0x9a, 0xc3, 0x10, 0x45, 0xfe, 0xc9, 0xcb, 0xf8, 0xce, + 0x0d, 0xe3, 0xae, 0x76, 0x18, 0xff, 0xc0, 0x4b, 0x81, 0xec, 0x4e, 0x78, 0x08, 0x8d, 0x8b, 0x65, + 0xc6, 0x8a, 0xed, 0x50, 0x15, 0x13, 0xf7, 0xfa, 0x9e, 0xb8, 0x8f, 0xd4, 0xda, 0x4f, 0x59, 0xa1, + 0xf4, 0x7c, 0x36, 0xc2, 0x26, 0x3e, 0x03, 0x7f, 0xbc, 0x52, 0xb4, 0x70, 0x81, 0xd5, 0x10, 0x45, + 0x0d, 0xdd, 0xd4, 0x80, 0x46, 0xd2, 0xab, 0xc2, 0xa1, 0x21, 0xdb, 0x67, 0x00, 0xfb, 0xc9, 0xf0, + 0x7b, 0xa8, 0x18, 0xb8, 0x68, 0xa2, 0xb0, 0x14, 0xf9, 0x27, 0x2f, 0xee, 0x5b, 0xca, 0x5d, 0x4e, + 0xaf, 0x7c, 0xf9, 0xe7, 0xd8, 0x4b, 0x9d, 0xb9, 0xfd, 0x15, 0x1a, 0x37, 0xe7, 0x7b, 0x70, 0xec, + 0xd6, 0x7c, 0x2b, 0x96, 0x40, 0x6d, 0xcb, 0xe0, 0xc7, 0x50, 0xba, 0xa0, 0x2b, 0xfb, 0x08, 0x52, + 0x5d, 0xe2, 0xbe, 0x5b, 0xc9, 0xdc, 0xfa, 0x83, 0x47, 0x77, 0x3f, 0xc7, 0x2f, 0x04, 0x47, 0x1f, + 0x78, 0xa1, 0xe4, 0x62, 0x4e, 0xb9, 0x22, 0x8a, 0x09, 0x7e, 0x36, 0x11, 0x39, 0xc5, 0x18, 0xca, + 0x9c, 0xcc, 0xdd, 0xab, 0x4b, 0x4d, 0x8d, 0x9b, 0x50, 0x5d, 0x52, 0x59, 0x30, 0xc1, 0x4d, 0xcf, + 0x7a, 0xba, 0x3d, 0xe2, 0x4f, 0x00, 0x44, 0x29, 0xc9, 0xc6, 0x0b, 0x45, 0x8b, 0x66, 0xe9, 0x7f, + 0x96, 0xbe, 0x11, 0x80, 0xdf, 0x42, 0x73, 0x2a, 0x45, 0x9e, 0xd3, 0xe9, 0x68, 0x8f, 0x8e, 0x26, + 0x62, 0xc1, 0x95, 0x79, 0xa1, 0x8f, 0xd2, 0x27, 0x8e, 0xef, 0xee, 0xe8, 0xbe, 0x66, 0x7b, 0x3f, + 0xd1, 0xe5, 0x3a, 0x40, 0x57, 0xeb, 0x00, 0x5d, 0xaf, 0x03, 0xf4, 0x7d, 0x13, 0x78, 0x57, 0x9b, + 0xc0, 0xfb, 0xbd, 0x09, 0x3c, 0x08, 0x99, 0xb8, 0x7b, 0xa2, 0x9e, 0xdf, 0x37, 0xe5, 0x50, 0xc3, + 0x43, 0xf4, 0xed, 0xdd, 0xec, 0xb6, 0x81, 0xe9, 0xbf, 0x7b, 0x96, 0xd1, 0x89, 0x12, 0x32, 0xc9, + 0xa7, 0x44, 0x91, 0x84, 0x71, 0x45, 0x25, 0x27, 0x59, 0x62, 0x4e, 0x26, 0x71, 0x46, 0xf9, 0xfe, + 0xab, 0xf0, 0xe3, 0xa0, 0xf5, 0x39, 0xa7, 0xfc, 0xcb, 0x2e, 0xc3, 0xa4, 0xc7, 0xb6, 0x53, 0x7c, + 0xde, 0x19, 0x57, 0x8c, 0xe7, 0xcd, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x04, 0x1b, 0xbb, 0x73, + 0x5d, 0x04, 0x00, 0x00, } func (m *AnyValue) Marshal() (dAtA []byte, err error) { @@ -758,43 +716,6 @@ func (m *KeyValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *InstrumentationLibrary) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *InstrumentationLibrary) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InstrumentationLibrary) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintCommon(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintCommon(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *InstrumentationScope) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -815,6 +736,25 @@ func (m *InstrumentationScope) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.DroppedAttributesCount != 0 { + i = encodeVarintCommon(dAtA, i, uint64(m.DroppedAttributesCount)) + i-- + dAtA[i] = 0x20 + } + if len(m.Attributes) > 0 { + for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Attributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommon(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } if len(m.Version) > 0 { i -= len(m.Version) copy(dAtA[i:], m.Version) @@ -973,7 +913,7 @@ func (m *KeyValue) Size() (n int) { return n } -func (m *InstrumentationLibrary) Size() (n int) { +func (m *InstrumentationScope) Size() (n int) { if m == nil { return 0 } @@ -987,22 +927,14 @@ func (m *InstrumentationLibrary) Size() (n int) { if l > 0 { n += 1 + l + sovCommon(uint64(l)) } - return n -} - -func (m *InstrumentationScope) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovCommon(uint64(l)) + if len(m.Attributes) > 0 { + for _, e := range m.Attributes { + l = e.Size() + n += 1 + l + sovCommon(uint64(l)) + } } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovCommon(uint64(l)) + if m.DroppedAttributesCount != 0 { + n += 1 + sovCommon(uint64(m.DroppedAttributesCount)) } return n } @@ -1533,7 +1465,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { } return nil } -func (m *InstrumentationLibrary) Unmarshal(dAtA []byte) error { +func (m *InstrumentationScope) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1556,10 +1488,10 @@ func (m *InstrumentationLibrary) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: InstrumentationLibrary: wiretype end group for non-group") + return fmt.Errorf("proto: InstrumentationScope: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: InstrumentationLibrary: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: InstrumentationScope: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1626,61 +1558,11 @@ func (m *InstrumentationLibrary) Unmarshal(dAtA []byte) error { } m.Version = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCommon(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCommon - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *InstrumentationScope) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommon - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InstrumentationScope: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InstrumentationScope: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCommon @@ -1690,29 +1572,31 @@ func (m *InstrumentationScope) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthCommon } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthCommon } if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Attributes = append(m.Attributes, KeyValue{}) + if err := m.Attributes[len(m.Attributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DroppedAttributesCount", wireType) } - var stringLen uint64 + m.DroppedAttributesCount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCommon @@ -1722,24 +1606,11 @@ func (m *InstrumentationScope) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.DroppedAttributesCount |= uint32(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCommon - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCommon - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCommon(dAtA[iNdEx:]) diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1/logs.pb.go b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1/logs.pb.go index 2e54d016416..f331c7c1ae5 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1/logs.pb.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1/logs.pb.go @@ -212,39 +212,12 @@ func (m *LogsData) GetResourceLogs() []*ResourceLogs { // A collection of ScopeLogs from a Resource. type ResourceLogs struct { + DeprecatedScopeLogs []*ScopeLogs `protobuf:"bytes,1000,rep,name=deprecated_scope_logs,json=deprecatedScopeLogs,proto3" json:"deprecated_scope_logs,omitempty"` // The resource for the logs in this message. // If this field is not set then resource info is unknown. Resource v1.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource"` // A list of ScopeLogs that originate from a resource. ScopeLogs []*ScopeLogs `protobuf:"bytes,2,rep,name=scope_logs,json=scopeLogs,proto3" json:"scope_logs,omitempty"` - // A list of InstrumentationLibraryLogs that originate from a resource. - // This field is deprecated and will be removed after grace period expires on June 15, 2022. - // - // During the grace period the following rules SHOULD be followed: - // - // For Binary Protobufs - // ==================== - // Binary Protobuf senders SHOULD NOT set instrumentation_library_logs. Instead - // scope_logs SHOULD be set. - // - // Binary Protobuf receivers SHOULD check if instrumentation_library_logs is set - // and scope_logs is not set then the value in instrumentation_library_logs - // SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. - // If scope_logs is set then instrumentation_library_logs SHOULD be ignored. - // - // For JSON - // ======== - // JSON senders that set instrumentation_library_logs field MAY also set - // scope_logs to carry the same logs, essentially double-publishing the same data. - // Such double-publishing MAY be controlled by a user-settable option. - // If double-publishing is not used then the senders SHOULD set scope_logs and - // SHOULD NOT set instrumentation_library_logs. - // - // JSON receivers SHOULD check if instrumentation_library_logs is set and - // scope_logs is not set then the value in instrumentation_library_logs - // SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. - // If scope_logs is set then instrumentation_library_logs field SHOULD be ignored. - InstrumentationLibraryLogs []*InstrumentationLibraryLogs `protobuf:"bytes,1000,rep,name=instrumentation_library_logs,json=instrumentationLibraryLogs,proto3" json:"instrumentation_library_logs,omitempty"` // Deprecated: Do not use. // This schema_url applies to the data in the "resource" field. It does not apply // to the data in the "scope_logs" field which have their own schema_url field. SchemaUrl string `protobuf:"bytes,3,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"` @@ -283,6 +256,13 @@ func (m *ResourceLogs) XXX_DiscardUnknown() { var xxx_messageInfo_ResourceLogs proto.InternalMessageInfo +func (m *ResourceLogs) GetDeprecatedScopeLogs() []*ScopeLogs { + if m != nil { + return m.DeprecatedScopeLogs + } + return nil +} + func (m *ResourceLogs) GetResource() v1.Resource { if m != nil { return m.Resource @@ -297,14 +277,6 @@ func (m *ResourceLogs) GetScopeLogs() []*ScopeLogs { return nil } -// Deprecated: Do not use. -func (m *ResourceLogs) GetInstrumentationLibraryLogs() []*InstrumentationLibraryLogs { - if m != nil { - return m.InstrumentationLibraryLogs - } - return nil -} - func (m *ResourceLogs) GetSchemaUrl() string { if m != nil { return m.SchemaUrl @@ -378,77 +350,6 @@ func (m *ScopeLogs) GetSchemaUrl() string { return "" } -// A collection of Logs produced by an InstrumentationLibrary. -// InstrumentationLibraryLogs is wire-compatible with ScopeLogs for binary -// Protobuf format. -// This message is deprecated and will be removed on June 15, 2022. -// -// Deprecated: Do not use. -type InstrumentationLibraryLogs struct { - // The instrumentation library information for the logs in this message. - // Semantically when InstrumentationLibrary isn't set, it is equivalent with - // an empty instrumentation library name (unknown). - InstrumentationLibrary v11.InstrumentationLibrary `protobuf:"bytes,1,opt,name=instrumentation_library,json=instrumentationLibrary,proto3" json:"instrumentation_library"` - // A list of logs that originate from an instrumentation library. - LogRecords []*LogRecord `protobuf:"bytes,2,rep,name=log_records,json=logRecords,proto3" json:"log_records,omitempty"` - // This schema_url applies to all logs in the "logs" field. - SchemaUrl string `protobuf:"bytes,3,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"` -} - -func (m *InstrumentationLibraryLogs) Reset() { *m = InstrumentationLibraryLogs{} } -func (m *InstrumentationLibraryLogs) String() string { return proto.CompactTextString(m) } -func (*InstrumentationLibraryLogs) ProtoMessage() {} -func (*InstrumentationLibraryLogs) Descriptor() ([]byte, []int) { - return fileDescriptor_d1c030a3ec7e961e, []int{3} -} -func (m *InstrumentationLibraryLogs) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InstrumentationLibraryLogs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InstrumentationLibraryLogs.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *InstrumentationLibraryLogs) XXX_Merge(src proto.Message) { - xxx_messageInfo_InstrumentationLibraryLogs.Merge(m, src) -} -func (m *InstrumentationLibraryLogs) XXX_Size() int { - return m.Size() -} -func (m *InstrumentationLibraryLogs) XXX_DiscardUnknown() { - xxx_messageInfo_InstrumentationLibraryLogs.DiscardUnknown(m) -} - -var xxx_messageInfo_InstrumentationLibraryLogs proto.InternalMessageInfo - -func (m *InstrumentationLibraryLogs) GetInstrumentationLibrary() v11.InstrumentationLibrary { - if m != nil { - return m.InstrumentationLibrary - } - return v11.InstrumentationLibrary{} -} - -func (m *InstrumentationLibraryLogs) GetLogRecords() []*LogRecord { - if m != nil { - return m.LogRecords - } - return nil -} - -func (m *InstrumentationLibraryLogs) GetSchemaUrl() string { - if m != nil { - return m.SchemaUrl - } - return "" -} - // A log record according to OpenTelemetry Log Data Model: // https://github.com/open-telemetry/oteps/blob/main/text/logs/0097-log-data-model.md type LogRecord struct { @@ -509,7 +410,7 @@ func (m *LogRecord) Reset() { *m = LogRecord{} } func (m *LogRecord) String() string { return proto.CompactTextString(m) } func (*LogRecord) ProtoMessage() {} func (*LogRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_d1c030a3ec7e961e, []int{4} + return fileDescriptor_d1c030a3ec7e961e, []int{3} } func (m *LogRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -600,7 +501,6 @@ func init() { proto.RegisterType((*LogsData)(nil), "opentelemetry.proto.logs.v1.LogsData") proto.RegisterType((*ResourceLogs)(nil), "opentelemetry.proto.logs.v1.ResourceLogs") proto.RegisterType((*ScopeLogs)(nil), "opentelemetry.proto.logs.v1.ScopeLogs") - proto.RegisterType((*InstrumentationLibraryLogs)(nil), "opentelemetry.proto.logs.v1.InstrumentationLibraryLogs") proto.RegisterType((*LogRecord)(nil), "opentelemetry.proto.logs.v1.LogRecord") } @@ -609,68 +509,66 @@ func init() { } var fileDescriptor_d1c030a3ec7e961e = []byte{ - // 971 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x96, 0x41, 0x73, 0x22, 0x45, - 0x14, 0xc7, 0x33, 0x24, 0x04, 0xe8, 0x10, 0xb6, 0x6d, 0xb3, 0xc9, 0x48, 0x94, 0x50, 0x51, 0x57, - 0x8c, 0x55, 0x50, 0x0b, 0x6c, 0xb9, 0x7a, 0x72, 0x08, 0x43, 0x0a, 0x43, 0x20, 0xd5, 0xc0, 0xea, - 0x6e, 0x59, 0x35, 0x35, 0x40, 0x8b, 0x53, 0x35, 0x4c, 0x53, 0x3d, 0x4d, 0x2a, 0x5c, 0x3c, 0x79, - 0xf1, 0xe6, 0x57, 0xb2, 0xf4, 0xb0, 0xc7, 0x3d, 0x5a, 0x1e, 0xb6, 0xac, 0xe4, 0xe2, 0xa7, 0x50, - 0xab, 0x7b, 0x06, 0x04, 0x9c, 0x21, 0xe6, 0xb2, 0x27, 0xba, 0xdf, 0xef, 0xbd, 0x7f, 0xff, 0x5f, - 0x77, 0x4f, 0x17, 0xe0, 0x11, 0x1d, 0x13, 0x87, 0x13, 0x9b, 0x8c, 0x08, 0x67, 0xd3, 0xc2, 0x98, - 0x51, 0x4e, 0x0b, 0x36, 0x1d, 0xba, 0x85, 0xab, 0xc7, 0xf2, 0x37, 0x2f, 0x43, 0xe8, 0x70, 0x29, - 0xcf, 0x0b, 0xe6, 0x25, 0xbf, 0x7a, 0x9c, 0xde, 0x1b, 0xd2, 0x21, 0xf5, 0x4a, 0xc5, 0xc8, 0xa3, - 0xe9, 0x93, 0x20, 0xe9, 0x3e, 0x1d, 0x8d, 0xa8, 0x23, 0xc4, 0xbd, 0x91, 0x9f, 0x9b, 0x0f, 0xca, - 0x65, 0xc4, 0xa5, 0x13, 0xd6, 0x27, 0x22, 0x7b, 0x36, 0xf6, 0xf2, 0x8f, 0x5f, 0x80, 0x78, 0x83, - 0x0e, 0xdd, 0xaa, 0xc9, 0x4d, 0xd4, 0x04, 0xbb, 0x33, 0x6a, 0x08, 0x47, 0xaa, 0x92, 0xdd, 0xcc, - 0xed, 0x14, 0x3f, 0xce, 0xaf, 0xb1, 0x9c, 0xc7, 0x7e, 0x85, 0x50, 0xc1, 0x49, 0xb6, 0x30, 0x3b, - 0xfe, 0x39, 0x02, 0x92, 0x8b, 0x18, 0x9d, 0x83, 0xf8, 0x2c, 0x41, 0x55, 0xb2, 0x4a, 0xa8, 0xf6, - 0xdc, 0xe3, 0x82, 0x7e, 0x65, 0xeb, 0xe5, 0xeb, 0xa3, 0x0d, 0x3c, 0x17, 0x40, 0x3a, 0x00, 0x6e, - 0x9f, 0x8e, 0x7d, 0xab, 0x11, 0x69, 0xf5, 0xd1, 0x5a, 0xab, 0x6d, 0x91, 0x2e, 0x7d, 0x26, 0xdc, - 0xd9, 0x10, 0x7d, 0x0f, 0xde, 0xb5, 0x1c, 0x97, 0xb3, 0xc9, 0x88, 0x38, 0xdc, 0xe4, 0x16, 0x75, - 0x0c, 0xdb, 0xea, 0x31, 0x93, 0x4d, 0x3d, 0xe1, 0x3f, 0x63, 0x52, 0xf9, 0xd3, 0xb5, 0xca, 0xf5, - 0x65, 0x85, 0x86, 0x27, 0x20, 0xf4, 0x2b, 0x11, 0x55, 0xc1, 0x69, 0x2b, 0x94, 0xa3, 0xf7, 0x44, - 0x1b, 0xdf, 0x91, 0x91, 0x69, 0x4c, 0x98, 0xad, 0x6e, 0x66, 0x95, 0x5c, 0x42, 0xd8, 0x13, 0x91, - 0x2e, 0xb3, 0x8f, 0x7f, 0x55, 0x40, 0x62, 0xee, 0x1b, 0xb5, 0x40, 0x54, 0x3a, 0xf7, 0x77, 0xaf, - 0x14, 0x68, 0xca, 0xbf, 0x0f, 0xff, 0xb5, 0x25, 0x75, 0xfc, 0x7d, 0xf4, 0x74, 0xd0, 0x19, 0xd8, - 0xb1, 0xe9, 0xd0, 0x60, 0xa4, 0x4f, 0xd9, 0xe0, 0xff, 0xed, 0x62, 0x83, 0x0e, 0xb1, 0x4c, 0xc7, - 0xc0, 0x9e, 0x0d, 0xef, 0x6c, 0xe3, 0x2f, 0x05, 0xa4, 0xc3, 0x37, 0x09, 0x71, 0x70, 0x10, 0x72, - 0x08, 0x7e, 0xa7, 0x4f, 0xee, 0xd7, 0xa9, 0xaf, 0xed, 0xf7, 0xba, 0x1f, 0xbc, 0xfd, 0x6f, 0xaa, - 0xf9, 0xcf, 0x23, 0xaa, 0x72, 0xfc, 0x43, 0x14, 0x24, 0xe6, 0xc5, 0xe8, 0x03, 0x90, 0xe2, 0xd6, - 0x88, 0x18, 0x13, 0xc7, 0xba, 0x36, 0x1c, 0xd3, 0xa1, 0xb2, 0xcd, 0x6d, 0x9c, 0x14, 0xd1, 0xae, - 0x63, 0x5d, 0x37, 0x4d, 0x87, 0xa2, 0x27, 0xe0, 0x80, 0xf6, 0x5c, 0xc2, 0xae, 0xc8, 0xc0, 0x58, - 0x49, 0xdf, 0x91, 0xe9, 0x7b, 0x33, 0xdc, 0x59, 0x2c, 0xeb, 0x80, 0x07, 0x2e, 0xb9, 0x22, 0xcc, - 0xe2, 0x53, 0xc3, 0x99, 0x8c, 0x7a, 0x84, 0xa9, 0x91, 0xac, 0x92, 0x4b, 0x15, 0x3f, 0x59, 0xff, - 0x75, 0xf8, 0x35, 0x4d, 0x59, 0x82, 0x53, 0xee, 0xd2, 0x1c, 0xbd, 0x0f, 0x76, 0xe7, 0xaa, 0x9c, - 0x5c, 0x73, 0xbf, 0xcd, 0xe4, 0x2c, 0xd8, 0x21, 0xd7, 0x1c, 0x69, 0x60, 0xab, 0x47, 0x07, 0x53, - 0x35, 0x2a, 0x0f, 0xed, 0xa3, 0x3b, 0x0e, 0x4d, 0x73, 0xa6, 0xcf, 0x4c, 0x7b, 0x32, 0xbb, 0x92, - 0xb2, 0x14, 0x5d, 0x00, 0x60, 0x72, 0xce, 0xac, 0xde, 0x84, 0x13, 0x57, 0xdd, 0x96, 0x67, 0x72, - 0x97, 0xd0, 0x39, 0x59, 0x12, 0x5a, 0x10, 0x40, 0x4f, 0x81, 0x3a, 0x60, 0x74, 0x3c, 0x26, 0x03, - 0xe3, 0xdf, 0xa8, 0xd1, 0xa7, 0x13, 0x87, 0xab, 0xb1, 0xac, 0x92, 0xdb, 0xc5, 0xfb, 0x3e, 0xd7, - 0xe6, 0xf8, 0x54, 0x50, 0xb4, 0x07, 0xa2, 0xdf, 0xda, 0xe6, 0xd0, 0x55, 0xe3, 0x59, 0x25, 0x17, - 0xc3, 0xde, 0x04, 0x7d, 0x03, 0xe2, 0x9c, 0x99, 0x7d, 0x62, 0x58, 0x03, 0x35, 0x91, 0x55, 0x72, - 0xc9, 0x8a, 0x26, 0xd6, 0xfc, 0xfd, 0xf5, 0xd1, 0x67, 0x43, 0xba, 0x62, 0xd3, 0x12, 0xaf, 0xb4, - 0x6d, 0x93, 0x3e, 0xa7, 0xac, 0x30, 0x1e, 0x98, 0xdc, 0x2c, 0x58, 0x0e, 0x27, 0xcc, 0x31, 0xed, - 0x82, 0x98, 0xe5, 0x3b, 0x42, 0xa9, 0x5e, 0xc5, 0x31, 0x29, 0x59, 0x1f, 0xa0, 0xe7, 0x20, 0xe6, - 0x8e, 0x4d, 0x47, 0x88, 0x03, 0x29, 0xfe, 0x85, 0x2f, 0xfe, 0xf4, 0xfe, 0xe2, 0xed, 0xb1, 0xe9, - 0xd4, 0xab, 0x78, 0x5b, 0x08, 0xd6, 0x07, 0x5f, 0x6e, 0xc5, 0xb7, 0x60, 0xf4, 0xe4, 0x97, 0x28, - 0x48, 0x2d, 0x1f, 0x34, 0x3a, 0x02, 0x87, 0x6d, 0xfd, 0x99, 0x8e, 0xeb, 0x9d, 0xe7, 0x46, 0xb3, - 0x7b, 0x51, 0xd1, 0xb1, 0xd1, 0x6d, 0xb6, 0x2f, 0xf5, 0xd3, 0x7a, 0xad, 0xae, 0x57, 0xe1, 0x06, - 0x7a, 0x07, 0x3c, 0x5c, 0x4d, 0xe8, 0x60, 0xed, 0x54, 0x87, 0x0a, 0x4a, 0x83, 0xfd, 0x40, 0x54, - 0x84, 0x91, 0x50, 0x56, 0x82, 0x9b, 0xa1, 0xac, 0x0c, 0xb7, 0x82, 0x96, 0xab, 0xea, 0x95, 0xee, - 0x19, 0x8c, 0x06, 0x95, 0x49, 0x54, 0x84, 0xdb, 0xa1, 0xac, 0x04, 0x63, 0xa1, 0xac, 0x0c, 0xe3, - 0x48, 0x05, 0x7b, 0xab, 0xac, 0xde, 0xac, 0xb5, 0x60, 0x22, 0xc8, 0x88, 0x20, 0x45, 0x08, 0xc2, - 0x50, 0x09, 0xee, 0x84, 0xa1, 0x32, 0x4c, 0x06, 0x2d, 0xf5, 0x95, 0x86, 0x9b, 0x70, 0x37, 0xa8, - 0x48, 0x90, 0x22, 0x4c, 0x85, 0xa1, 0x12, 0x7c, 0x10, 0x86, 0xca, 0x10, 0x06, 0x21, 0x1d, 0xe3, - 0x16, 0x86, 0x6f, 0x05, 0x6d, 0x86, 0x44, 0x45, 0x88, 0x42, 0x59, 0x09, 0xbe, 0x1d, 0xca, 0xca, - 0x70, 0x2f, 0x68, 0xb9, 0x9a, 0xd6, 0xd1, 0x1a, 0xf0, 0x61, 0x50, 0x99, 0x44, 0x45, 0xb8, 0x1f, - 0xca, 0x4a, 0xf0, 0x20, 0x94, 0x95, 0xa1, 0x7a, 0xf2, 0x35, 0x48, 0xcd, 0xdf, 0xd2, 0x9a, 0xfc, - 0x2c, 0x8f, 0xc0, 0x61, 0xa3, 0x75, 0x66, 0x60, 0xfd, 0xb4, 0x85, 0xab, 0x46, 0xad, 0xa1, 0x9d, - 0xad, 0x5c, 0xe2, 0x0f, 0x41, 0x76, 0x35, 0x41, 0xde, 0x38, 0x39, 0x6c, 0x1b, 0x17, 0x5a, 0xfb, - 0x1c, 0xfe, 0xad, 0x54, 0x7e, 0x54, 0x5e, 0xde, 0x64, 0x94, 0x57, 0x37, 0x19, 0xe5, 0x8f, 0x9b, - 0x8c, 0xf2, 0xd3, 0x6d, 0x66, 0xe3, 0xd5, 0x6d, 0x66, 0xe3, 0xb7, 0xdb, 0xcc, 0x06, 0xc8, 0x58, - 0x74, 0xdd, 0xfb, 0x59, 0x11, 0xcf, 0xbb, 0x7b, 0x29, 0x42, 0x97, 0xca, 0x8b, 0xca, 0xbd, 0xbf, - 0x57, 0xef, 0xaf, 0xda, 0x90, 0x38, 0xb3, 0x3f, 0x8d, 0xbd, 0x6d, 0x19, 0x29, 0xfd, 0x13, 0x00, - 0x00, 0xff, 0xff, 0x43, 0x73, 0x1b, 0xe8, 0x5a, 0x0a, 0x00, 0x00, + // 943 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x96, 0x4f, 0x6f, 0xe2, 0x46, + 0x18, 0xc6, 0x31, 0xe1, 0xef, 0x84, 0xb0, 0xd3, 0x59, 0x92, 0x75, 0x13, 0x95, 0xa0, 0xb4, 0xdd, + 0xd2, 0x54, 0x02, 0x05, 0xa8, 0xb4, 0xbd, 0xd5, 0x04, 0x13, 0xd1, 0x10, 0x88, 0x06, 0x48, 0xbb, + 0xdb, 0x4a, 0x96, 0xc1, 0x53, 0x6a, 0xc9, 0x78, 0x2c, 0x7b, 0x40, 0xc9, 0xbd, 0x1f, 0xa0, 0x9f, + 0xa0, 0xd7, 0x4a, 0xfd, 0x1a, 0xed, 0x61, 0x8f, 0x7b, 0xac, 0x7a, 0x88, 0xaa, 0xe4, 0xd2, 0x6f, + 0xd1, 0x6a, 0x06, 0x43, 0x08, 0xb2, 0x93, 0xcd, 0x29, 0x33, 0xef, 0xef, 0x79, 0x9f, 0xf7, 0x1d, + 0x5e, 0x7b, 0x62, 0xf0, 0x92, 0x3a, 0xc4, 0x66, 0xc4, 0x22, 0x13, 0xc2, 0xdc, 0xab, 0xb2, 0xe3, + 0x52, 0x46, 0xcb, 0x16, 0x1d, 0x7b, 0xe5, 0xd9, 0x91, 0xf8, 0x5b, 0x12, 0x21, 0xb4, 0x77, 0x4f, + 0x37, 0x0f, 0x96, 0x04, 0x9f, 0x1d, 0xed, 0xe6, 0xc6, 0x74, 0x4c, 0xe7, 0xa9, 0x7c, 0x35, 0xa7, + 0xbb, 0x87, 0x41, 0xd6, 0x23, 0x3a, 0x99, 0x50, 0x9b, 0x9b, 0xcf, 0x57, 0xbe, 0xb6, 0x14, 0xa4, + 0x75, 0x89, 0x47, 0xa7, 0xee, 0x88, 0x70, 0xf5, 0x62, 0x3d, 0xd7, 0x1f, 0xbc, 0x01, 0xa9, 0x36, + 0x1d, 0x7b, 0x0d, 0x9d, 0xe9, 0xa8, 0x03, 0xb6, 0x16, 0x54, 0xe3, 0x1d, 0xc9, 0x52, 0x61, 0xa3, + 0xb8, 0x59, 0xf9, 0xbc, 0xf4, 0x40, 0xcb, 0x25, 0xec, 0x67, 0x70, 0x17, 0x9c, 0x71, 0x57, 0x76, + 0x07, 0xbf, 0x46, 0x41, 0x66, 0x15, 0xa3, 0xef, 0xc1, 0xb6, 0x41, 0x1c, 0x97, 0x8c, 0x74, 0x46, + 0x0c, 0xcd, 0x1b, 0x51, 0xc7, 0x2f, 0xf4, 0x6f, 0x52, 0x54, 0x7a, 0xf9, 0x60, 0xa5, 0x1e, 0xd7, + 0x8b, 0x32, 0xcf, 0xef, 0x5c, 0x96, 0x41, 0x74, 0x0a, 0x52, 0x8b, 0xea, 0xb2, 0x54, 0x90, 0x42, + 0x1b, 0x5f, 0xfe, 0x00, 0x2b, 0xcd, 0xd7, 0x63, 0x6f, 0xaf, 0xf7, 0x23, 0x78, 0x69, 0x80, 0x54, + 0x00, 0x56, 0xda, 0x8b, 0x3e, 0xa9, 0xbb, 0xb4, 0xb7, 0xec, 0xe9, 0x23, 0x6e, 0xf3, 0x13, 0x99, + 0xe8, 0xda, 0xd4, 0xb5, 0xe4, 0x8d, 0x82, 0x54, 0x4c, 0x73, 0xcc, 0x23, 0x03, 0xd7, 0x3a, 0xf8, + 0x53, 0x02, 0xe9, 0xbb, 0x03, 0x74, 0x41, 0x5c, 0x64, 0xfa, 0xdd, 0x57, 0x03, 0xcb, 0xf9, 0xc3, + 0x9e, 0x1d, 0x95, 0x5a, 0xb6, 0xc7, 0xdc, 0xe9, 0x84, 0xd8, 0x4c, 0x67, 0x26, 0xb5, 0x85, 0x8f, + 0x7f, 0x8e, 0xb9, 0x0f, 0x3a, 0x01, 0x9b, 0x16, 0x1d, 0x6b, 0x2e, 0x19, 0x51, 0xd7, 0x78, 0xbf, + 0x53, 0xb4, 0xe9, 0x18, 0x0b, 0x39, 0x06, 0xd6, 0x62, 0xf9, 0xe8, 0x31, 0x7e, 0x8e, 0x83, 0xf4, + 0x32, 0x11, 0x7d, 0x02, 0xb2, 0xcc, 0x9c, 0x10, 0x6d, 0x6a, 0x9b, 0x97, 0x9a, 0xad, 0xdb, 0x54, + 0x9c, 0x27, 0x81, 0x33, 0x3c, 0x3a, 0xb0, 0xcd, 0xcb, 0x8e, 0x6e, 0x53, 0xf4, 0x25, 0x78, 0x41, + 0x87, 0x1e, 0x71, 0x67, 0xc4, 0xd0, 0xd6, 0xe4, 0x9b, 0x42, 0x9e, 0x5b, 0xe0, 0xfe, 0x6a, 0x5a, + 0x1f, 0x3c, 0xf3, 0xc8, 0x8c, 0xb8, 0x26, 0xbb, 0xd2, 0xec, 0xe9, 0x64, 0x48, 0x5c, 0x39, 0x5a, + 0x90, 0x8a, 0xd9, 0xca, 0x17, 0x0f, 0x0f, 0xc7, 0xcf, 0xe9, 0x88, 0x14, 0x9c, 0xf5, 0xee, 0xed, + 0xd1, 0xc7, 0x60, 0x6b, 0xe9, 0xca, 0xc8, 0x25, 0xf3, 0x8f, 0x98, 0x59, 0x04, 0xfb, 0xe4, 0x92, + 0x21, 0x05, 0xc4, 0x86, 0xd4, 0xb8, 0x92, 0xe3, 0x62, 0x3a, 0x9f, 0x3d, 0x32, 0x1d, 0xc5, 0xbe, + 0xba, 0xd0, 0xad, 0xe9, 0x62, 0x22, 0x22, 0x15, 0x9d, 0x01, 0xa0, 0x33, 0xe6, 0x9a, 0xc3, 0x29, + 0x23, 0x9e, 0x9c, 0x10, 0xf3, 0x78, 0xcc, 0xe8, 0x94, 0xdc, 0x33, 0x5a, 0x31, 0x40, 0xaf, 0x80, + 0x6c, 0xb8, 0xd4, 0x71, 0x88, 0xa1, 0xdd, 0x45, 0xb5, 0x11, 0x9d, 0xda, 0x4c, 0x4e, 0x16, 0xa4, + 0xe2, 0x16, 0xde, 0xf1, 0xb9, 0xb2, 0xc4, 0xc7, 0x9c, 0xa2, 0x1c, 0x88, 0xff, 0x68, 0xe9, 0x63, + 0x4f, 0x4e, 0x15, 0xa4, 0x62, 0x12, 0xcf, 0x37, 0xe8, 0x07, 0x90, 0x62, 0xae, 0x3e, 0x22, 0x9a, + 0x69, 0xc8, 0xe9, 0x82, 0x54, 0xcc, 0xd4, 0x15, 0x5e, 0xf3, 0xef, 0xeb, 0xfd, 0xaf, 0xc6, 0x74, + 0xad, 0x4d, 0x93, 0xdf, 0x40, 0x96, 0x45, 0x46, 0x8c, 0xba, 0x65, 0xc7, 0xd0, 0x99, 0x5e, 0x36, + 0x6d, 0x46, 0x5c, 0x5b, 0xb7, 0xca, 0x7c, 0x57, 0xea, 0x73, 0xa7, 0x56, 0x03, 0x27, 0x85, 0x65, + 0xcb, 0x40, 0xaf, 0x41, 0xd2, 0x73, 0x74, 0x9b, 0x9b, 0x03, 0x61, 0xfe, 0xb5, 0x6f, 0xfe, 0xea, + 0xe9, 0xe6, 0x3d, 0x47, 0xb7, 0x5b, 0x0d, 0x9c, 0xe0, 0x86, 0x2d, 0xe3, 0x9b, 0x58, 0x2a, 0x06, + 0xe3, 0x87, 0x7f, 0xc4, 0x41, 0xf6, 0xfe, 0xa0, 0xd1, 0x3e, 0xd8, 0xeb, 0xa9, 0x17, 0x2a, 0x6e, + 0xf5, 0x5f, 0x6b, 0x9d, 0xc1, 0x59, 0x5d, 0xc5, 0xda, 0xa0, 0xd3, 0x3b, 0x57, 0x8f, 0x5b, 0xcd, + 0x96, 0xda, 0x80, 0x11, 0xf4, 0x21, 0xd8, 0x5e, 0x17, 0xf4, 0xb1, 0x72, 0xac, 0x42, 0x09, 0xed, + 0x82, 0x9d, 0x40, 0x54, 0x81, 0xd1, 0x50, 0x56, 0x85, 0x1b, 0xa1, 0xac, 0x06, 0x63, 0x41, 0xe5, + 0x1a, 0x6a, 0x7d, 0x70, 0x02, 0xe3, 0x41, 0x69, 0x02, 0x55, 0x60, 0x22, 0x94, 0x55, 0x61, 0x32, + 0x94, 0xd5, 0x60, 0x0a, 0xc9, 0x20, 0xb7, 0xce, 0x5a, 0x9d, 0x66, 0x17, 0xa6, 0x83, 0x1a, 0xe1, + 0xa4, 0x02, 0x41, 0x18, 0xaa, 0xc2, 0xcd, 0x30, 0x54, 0x83, 0x99, 0xa0, 0x52, 0xdf, 0x2a, 0xb8, + 0x03, 0xb7, 0x82, 0x92, 0x38, 0xa9, 0xc0, 0x6c, 0x18, 0xaa, 0xc2, 0x67, 0x61, 0xa8, 0x06, 0x61, + 0x10, 0x52, 0x31, 0xee, 0x62, 0xf8, 0x41, 0xd0, 0x8f, 0x21, 0x50, 0x05, 0xa2, 0x50, 0x56, 0x85, + 0xcf, 0x43, 0x59, 0x0d, 0xe6, 0x82, 0xca, 0x35, 0x95, 0xbe, 0xd2, 0x86, 0xdb, 0x41, 0x69, 0x02, + 0x55, 0xe0, 0x4e, 0x28, 0xab, 0xc2, 0x17, 0xa1, 0xac, 0x06, 0xe5, 0xc3, 0xef, 0x40, 0x76, 0x79, + 0x97, 0x36, 0xc5, 0x6b, 0xb9, 0x0f, 0xf6, 0xda, 0xdd, 0x13, 0x0d, 0xab, 0xc7, 0x5d, 0xdc, 0xd0, + 0x9a, 0x6d, 0xe5, 0x64, 0xed, 0x21, 0xfe, 0x14, 0x14, 0xd6, 0x05, 0xe2, 0x89, 0x13, 0xcb, 0x9e, + 0x76, 0xa6, 0xf4, 0x4e, 0xe1, 0x7f, 0x52, 0xfd, 0x37, 0xe9, 0xed, 0x4d, 0x5e, 0x7a, 0x77, 0x93, + 0x97, 0xfe, 0xb9, 0xc9, 0x4b, 0xbf, 0xdc, 0xe6, 0x23, 0xef, 0x6e, 0xf3, 0x91, 0xbf, 0x6e, 0xf3, + 0x11, 0x90, 0x37, 0xe9, 0x43, 0xf7, 0x67, 0x9d, 0x5f, 0xef, 0xde, 0x39, 0x0f, 0x9d, 0x4b, 0x6f, + 0xea, 0x4f, 0x7e, 0x5f, 0xe7, 0x9f, 0x21, 0x63, 0x62, 0x2f, 0x3e, 0x88, 0x7e, 0x8f, 0xee, 0x75, + 0x1d, 0x62, 0xf7, 0x97, 0x0e, 0xc2, 0x9b, 0xff, 0xf7, 0xf1, 0x4a, 0x17, 0x47, 0xc3, 0x84, 0xd0, + 0x57, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x76, 0x6b, 0x05, 0x54, 0x09, 0x00, 0x00, } func (m *LogsData) Marshal() (dAtA []byte, err error) { @@ -730,10 +628,10 @@ func (m *ResourceLogs) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.InstrumentationLibraryLogs) > 0 { - for iNdEx := len(m.InstrumentationLibraryLogs) - 1; iNdEx >= 0; iNdEx-- { + if len(m.DeprecatedScopeLogs) > 0 { + for iNdEx := len(m.DeprecatedScopeLogs) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.InstrumentationLibraryLogs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DeprecatedScopeLogs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -834,60 +732,6 @@ func (m *ScopeLogs) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *InstrumentationLibraryLogs) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *InstrumentationLibraryLogs) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InstrumentationLibraryLogs) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SchemaUrl) > 0 { - i -= len(m.SchemaUrl) - copy(dAtA[i:], m.SchemaUrl) - i = encodeVarintLogs(dAtA, i, uint64(len(m.SchemaUrl))) - i-- - dAtA[i] = 0x1a - } - if len(m.LogRecords) > 0 { - for iNdEx := len(m.LogRecords) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.LogRecords[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLogs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.InstrumentationLibrary.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLogs(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *LogRecord) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1034,8 +878,8 @@ func (m *ResourceLogs) Size() (n int) { if l > 0 { n += 1 + l + sovLogs(uint64(l)) } - if len(m.InstrumentationLibraryLogs) > 0 { - for _, e := range m.InstrumentationLibraryLogs { + if len(m.DeprecatedScopeLogs) > 0 { + for _, e := range m.DeprecatedScopeLogs { l = e.Size() n += 2 + l + sovLogs(uint64(l)) } @@ -1064,27 +908,6 @@ func (m *ScopeLogs) Size() (n int) { return n } -func (m *InstrumentationLibraryLogs) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.InstrumentationLibrary.Size() - n += 1 + l + sovLogs(uint64(l)) - if len(m.LogRecords) > 0 { - for _, e := range m.LogRecords { - l = e.Size() - n += 1 + l + sovLogs(uint64(l)) - } - } - l = len(m.SchemaUrl) - if l > 0 { - n += 1 + l + sovLogs(uint64(l)) - } - return n -} - func (m *LogRecord) Size() (n int) { if m == nil { return 0 @@ -1345,7 +1168,7 @@ func (m *ResourceLogs) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 1000: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InstrumentationLibraryLogs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedScopeLogs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1372,8 +1195,8 @@ func (m *ResourceLogs) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.InstrumentationLibraryLogs = append(m.InstrumentationLibraryLogs, &InstrumentationLibraryLogs{}) - if err := m.InstrumentationLibraryLogs[len(m.InstrumentationLibraryLogs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.DeprecatedScopeLogs = append(m.DeprecatedScopeLogs, &ScopeLogs{}) + if err := m.DeprecatedScopeLogs[len(m.DeprecatedScopeLogs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1547,155 +1370,6 @@ func (m *ScopeLogs) Unmarshal(dAtA []byte) error { } return nil } -func (m *InstrumentationLibraryLogs) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InstrumentationLibraryLogs: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InstrumentationLibraryLogs: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InstrumentationLibrary", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLogs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLogs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InstrumentationLibrary.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LogRecords", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLogs - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLogs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LogRecords = append(m.LogRecords, &LogRecord{}) - if err := m.LogRecords[len(m.LogRecords)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SchemaUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthLogs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLogs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SchemaUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipLogs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLogs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *LogRecord) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1/metrics.pb.go b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1/metrics.pb.go index 9c234eb3beb..78e45d8bdca 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1/metrics.pb.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1/metrics.pb.go @@ -125,8 +125,7 @@ func (AggregationTemporality) EnumDescriptor() ([]byte, []int) { // enum is a bit-mask. To test the presence of a single flag in the flags of // a data point, for example, use an expression like: // -// (point.flags & FLAG_NO_RECORDED_VALUE) == FLAG_NO_RECORDED_VALUE -// +// (point.flags & FLAG_NO_RECORDED_VALUE) == FLAG_NO_RECORDED_VALUE type DataPointFlags int32 const ( @@ -216,39 +215,12 @@ func (m *MetricsData) GetResourceMetrics() []*ResourceMetrics { // A collection of ScopeMetrics from a Resource. type ResourceMetrics struct { + DeprecatedScopeMetrics []*ScopeMetrics `protobuf:"bytes,1000,rep,name=deprecated_scope_metrics,json=deprecatedScopeMetrics,proto3" json:"deprecated_scope_metrics,omitempty"` // The resource for the metrics in this message. // If this field is not set then no resource info is known. Resource v1.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource"` // A list of metrics that originate from a resource. ScopeMetrics []*ScopeMetrics `protobuf:"bytes,2,rep,name=scope_metrics,json=scopeMetrics,proto3" json:"scope_metrics,omitempty"` - // A list of InstrumentationLibraryMetrics that originate from a resource. - // This field is deprecated and will be removed after grace period expires on June 15, 2022. - // - // During the grace period the following rules SHOULD be followed: - // - // For Binary Protobufs - // ==================== - // Binary Protobuf senders SHOULD NOT set instrumentation_library_metrics. Instead - // scope_metrics SHOULD be set. - // - // Binary Protobuf receivers SHOULD check if instrumentation_library_metrics is set - // and scope_metrics is not set then the value in instrumentation_library_metrics - // SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. - // If scope_metrics is set then instrumentation_library_metrics SHOULD be ignored. - // - // For JSON - // ======== - // JSON senders that set instrumentation_library_metrics field MAY also set - // scope_metrics to carry the same metrics, essentially double-publishing the same data. - // Such double-publishing MAY be controlled by a user-settable option. - // If double-publishing is not used then the senders SHOULD set scope_metrics and - // SHOULD NOT set instrumentation_library_metrics. - // - // JSON receivers SHOULD check if instrumentation_library_metrics is set and - // scope_metrics is not set then the value in instrumentation_library_metrics - // SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. - // If scope_metrics is set then instrumentation_library_metrics field SHOULD be ignored. - InstrumentationLibraryMetrics []*InstrumentationLibraryMetrics `protobuf:"bytes,1000,rep,name=instrumentation_library_metrics,json=instrumentationLibraryMetrics,proto3" json:"instrumentation_library_metrics,omitempty"` // Deprecated: Do not use. // This schema_url applies to the data in the "resource" field. It does not apply // to the data in the "scope_metrics" field which have their own schema_url field. SchemaUrl string `protobuf:"bytes,3,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"` @@ -287,6 +259,13 @@ func (m *ResourceMetrics) XXX_DiscardUnknown() { var xxx_messageInfo_ResourceMetrics proto.InternalMessageInfo +func (m *ResourceMetrics) GetDeprecatedScopeMetrics() []*ScopeMetrics { + if m != nil { + return m.DeprecatedScopeMetrics + } + return nil +} + func (m *ResourceMetrics) GetResource() v1.Resource { if m != nil { return m.Resource @@ -301,14 +280,6 @@ func (m *ResourceMetrics) GetScopeMetrics() []*ScopeMetrics { return nil } -// Deprecated: Do not use. -func (m *ResourceMetrics) GetInstrumentationLibraryMetrics() []*InstrumentationLibraryMetrics { - if m != nil { - return m.InstrumentationLibraryMetrics - } - return nil -} - func (m *ResourceMetrics) GetSchemaUrl() string { if m != nil { return m.SchemaUrl @@ -382,140 +353,71 @@ func (m *ScopeMetrics) GetSchemaUrl() string { return "" } -// A collection of Metrics produced by an InstrumentationLibrary. -// InstrumentationLibraryMetrics is wire-compatible with ScopeMetrics for binary -// Protobuf format. -// This message is deprecated and will be removed on June 15, 2022. -// -// Deprecated: Do not use. -type InstrumentationLibraryMetrics struct { - // The instrumentation library information for the metrics in this message. - // Semantically when InstrumentationLibrary isn't set, it is equivalent with - // an empty instrumentation library name (unknown). - InstrumentationLibrary v11.InstrumentationLibrary `protobuf:"bytes,1,opt,name=instrumentation_library,json=instrumentationLibrary,proto3" json:"instrumentation_library"` - // A list of metrics that originate from an instrumentation library. - Metrics []*Metric `protobuf:"bytes,2,rep,name=metrics,proto3" json:"metrics,omitempty"` - // This schema_url applies to all metrics in the "metrics" field. - SchemaUrl string `protobuf:"bytes,3,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"` -} - -func (m *InstrumentationLibraryMetrics) Reset() { *m = InstrumentationLibraryMetrics{} } -func (m *InstrumentationLibraryMetrics) String() string { return proto.CompactTextString(m) } -func (*InstrumentationLibraryMetrics) ProtoMessage() {} -func (*InstrumentationLibraryMetrics) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{3} -} -func (m *InstrumentationLibraryMetrics) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InstrumentationLibraryMetrics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InstrumentationLibraryMetrics.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *InstrumentationLibraryMetrics) XXX_Merge(src proto.Message) { - xxx_messageInfo_InstrumentationLibraryMetrics.Merge(m, src) -} -func (m *InstrumentationLibraryMetrics) XXX_Size() int { - return m.Size() -} -func (m *InstrumentationLibraryMetrics) XXX_DiscardUnknown() { - xxx_messageInfo_InstrumentationLibraryMetrics.DiscardUnknown(m) -} - -var xxx_messageInfo_InstrumentationLibraryMetrics proto.InternalMessageInfo - -func (m *InstrumentationLibraryMetrics) GetInstrumentationLibrary() v11.InstrumentationLibrary { - if m != nil { - return m.InstrumentationLibrary - } - return v11.InstrumentationLibrary{} -} - -func (m *InstrumentationLibraryMetrics) GetMetrics() []*Metric { - if m != nil { - return m.Metrics - } - return nil -} - -func (m *InstrumentationLibraryMetrics) GetSchemaUrl() string { - if m != nil { - return m.SchemaUrl - } - return "" -} - // Defines a Metric which has one or more timeseries. The following is a // brief summary of the Metric data model. For more details, see: // -// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/datamodel.md -// +// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/data-model.md // // The data model and relation between entities is shown in the // diagram below. Here, "DataPoint" is the term used to refer to any // one of the specific data point value types, and "points" is the term used // to refer to any one of the lists of points contained in the Metric. // -// - Metric is composed of a metadata and data. -// - Metadata part contains a name, description, unit. -// - Data is one of the possible types (Sum, Gauge, Histogram, Summary). -// - DataPoint contains timestamps, attributes, and one of the possible value type -// fields. +// - Metric is composed of a metadata and data. +// +// - Metadata part contains a name, description, unit. +// +// - Data is one of the possible types (Sum, Gauge, Histogram, Summary). +// +// - DataPoint contains timestamps, attributes, and one of the possible value type +// fields. // // Metric -// +------------+ -// |name | -// |description | -// |unit | +------------------------------------+ -// |data |---> |Gauge, Sum, Histogram, Summary, ... | -// +------------+ +------------------------------------+ +// +------------+ +// |name | +// |description | +// |unit | +------------------------------------+ +// |data |---> |Gauge, Sum, Histogram, Summary, ... | +// +------------+ +------------------------------------+ // -// Data [One of Gauge, Sum, Histogram, Summary, ...] -// +-----------+ -// |... | // Metadata about the Data. -// |points |--+ -// +-----------+ | -// | +---------------------------+ -// | |DataPoint 1 | -// v |+------+------+ +------+ | -// +-----+ ||label |label |...|label | | -// | 1 |-->||value1|value2|...|valueN| | -// +-----+ |+------+------+ +------+ | -// | . | |+-----+ | -// | . | ||value| | -// | . | |+-----+ | -// | . | +---------------------------+ -// | . | . -// | . | . -// | . | . -// | . | +---------------------------+ -// | . | |DataPoint M | -// +-----+ |+------+------+ +------+ | -// | M |-->||label |label |...|label | | -// +-----+ ||value1|value2|...|valueN| | -// |+------+------+ +------+ | -// |+-----+ | -// ||value| | -// |+-----+ | -// +---------------------------+ +// Data [One of Gauge, Sum, Histogram, Summary, ...] +// +-----------+ +// |... | // Metadata about the Data. +// |points |--+ +// +-----------+ | +// | +---------------------------+ +// | |DataPoint 1 | +// v |+------+------+ +------+ | +// +-----+ ||label |label |...|label | | +// | 1 |-->||value1|value2|...|valueN| | +// +-----+ |+------+------+ +------+ | +// | . | |+-----+ | +// | . | ||value| | +// | . | |+-----+ | +// | . | +---------------------------+ +// | . | . +// | . | . +// | . | . +// | . | +---------------------------+ +// | . | |DataPoint M | +// +-----+ |+------+------+ +------+ | +// | M |-->||label |label |...|label | | +// +-----+ ||value1|value2|...|valueN| | +// |+------+------+ +------+ | +// |+-----+ | +// ||value| | +// |+-----+ | +// +---------------------------+ // // Each distinct type of DataPoint represents the output of a specific // aggregation function, the result of applying the DataPoint's // associated function of to one or more measurements. // // All DataPoint types have three common fields: -// - Attributes includes key-value pairs associated with the data point -// - TimeUnixNano is required, set to the end time of the aggregation -// - StartTimeUnixNano is optional, but strongly encouraged for DataPoints -// having an AggregationTemporality field, as discussed below. +// - Attributes includes key-value pairs associated with the data point +// - TimeUnixNano is required, set to the end time of the aggregation +// - StartTimeUnixNano is optional, but strongly encouraged for DataPoints +// having an AggregationTemporality field, as discussed below. // // Both TimeUnixNano and StartTimeUnixNano values are expressed as // UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. @@ -563,7 +465,7 @@ func (m *Metric) Reset() { *m = Metric{} } func (m *Metric) String() string { return proto.CompactTextString(m) } func (*Metric) ProtoMessage() {} func (*Metric) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{4} + return fileDescriptor_3c3112f9fa006917, []int{3} } func (m *Metric) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -711,7 +613,7 @@ func (m *Gauge) Reset() { *m = Gauge{} } func (m *Gauge) String() string { return proto.CompactTextString(m) } func (*Gauge) ProtoMessage() {} func (*Gauge) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{5} + return fileDescriptor_3c3112f9fa006917, []int{4} } func (m *Gauge) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -762,7 +664,7 @@ func (m *Sum) Reset() { *m = Sum{} } func (m *Sum) String() string { return proto.CompactTextString(m) } func (*Sum) ProtoMessage() {} func (*Sum) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{6} + return fileDescriptor_3c3112f9fa006917, []int{5} } func (m *Sum) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -825,7 +727,7 @@ func (m *Histogram) Reset() { *m = Histogram{} } func (m *Histogram) String() string { return proto.CompactTextString(m) } func (*Histogram) ProtoMessage() {} func (*Histogram) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{7} + return fileDescriptor_3c3112f9fa006917, []int{6} } func (m *Histogram) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -881,7 +783,7 @@ func (m *ExponentialHistogram) Reset() { *m = ExponentialHistogram{} } func (m *ExponentialHistogram) String() string { return proto.CompactTextString(m) } func (*ExponentialHistogram) ProtoMessage() {} func (*ExponentialHistogram) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{8} + return fileDescriptor_3c3112f9fa006917, []int{7} } func (m *ExponentialHistogram) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -938,7 +840,7 @@ func (m *Summary) Reset() { *m = Summary{} } func (m *Summary) String() string { return proto.CompactTextString(m) } func (*Summary) ProtoMessage() {} func (*Summary) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{9} + return fileDescriptor_3c3112f9fa006917, []int{8} } func (m *Summary) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1012,7 +914,7 @@ func (m *NumberDataPoint) Reset() { *m = NumberDataPoint{} } func (m *NumberDataPoint) String() string { return proto.CompactTextString(m) } func (*NumberDataPoint) ProtoMessage() {} func (*NumberDataPoint) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{10} + return fileDescriptor_3c3112f9fa006917, []int{9} } func (m *NumberDataPoint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1208,7 +1110,7 @@ func (m *HistogramDataPoint) Reset() { *m = HistogramDataPoint{} } func (m *HistogramDataPoint) String() string { return proto.CompactTextString(m) } func (*HistogramDataPoint) ProtoMessage() {} func (*HistogramDataPoint) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{11} + return fileDescriptor_3c3112f9fa006917, []int{10} } func (m *HistogramDataPoint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1376,7 +1278,6 @@ func (*HistogramDataPoint) XXX_OneofWrappers() []interface{} { // time-varying values of a ExponentialHistogram of double values. A ExponentialHistogram contains // summary statistics for a population of values, it may optionally contain the // distribution of those values across a set of buckets. -// type ExponentialHistogramDataPoint struct { // The set of key/value pairs that uniquely identify the timeseries from // where this point belongs. The list may be empty (may contain 0 elements). @@ -1461,7 +1362,7 @@ func (m *ExponentialHistogramDataPoint) Reset() { *m = ExponentialHistog func (m *ExponentialHistogramDataPoint) String() string { return proto.CompactTextString(m) } func (*ExponentialHistogramDataPoint) ProtoMessage() {} func (*ExponentialHistogramDataPoint) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{12} + return fileDescriptor_3c3112f9fa006917, []int{11} } func (m *ExponentialHistogramDataPoint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1662,7 +1563,7 @@ func (m *ExponentialHistogramDataPoint_Buckets) Reset() { *m = Exponenti func (m *ExponentialHistogramDataPoint_Buckets) String() string { return proto.CompactTextString(m) } func (*ExponentialHistogramDataPoint_Buckets) ProtoMessage() {} func (*ExponentialHistogramDataPoint_Buckets) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{12, 0} + return fileDescriptor_3c3112f9fa006917, []int{11, 0} } func (m *ExponentialHistogramDataPoint_Buckets) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1747,7 +1648,7 @@ func (m *SummaryDataPoint) Reset() { *m = SummaryDataPoint{} } func (m *SummaryDataPoint) String() string { return proto.CompactTextString(m) } func (*SummaryDataPoint) ProtoMessage() {} func (*SummaryDataPoint) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{13} + return fileDescriptor_3c3112f9fa006917, []int{12} } func (m *SummaryDataPoint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1847,7 +1748,7 @@ func (m *SummaryDataPoint_ValueAtQuantile) Reset() { *m = SummaryDataPoi func (m *SummaryDataPoint_ValueAtQuantile) String() string { return proto.CompactTextString(m) } func (*SummaryDataPoint_ValueAtQuantile) ProtoMessage() {} func (*SummaryDataPoint_ValueAtQuantile) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{13, 0} + return fileDescriptor_3c3112f9fa006917, []int{12, 0} } func (m *SummaryDataPoint_ValueAtQuantile) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1926,7 +1827,7 @@ func (m *Exemplar) Reset() { *m = Exemplar{} } func (m *Exemplar) String() string { return proto.CompactTextString(m) } func (*Exemplar) ProtoMessage() {} func (*Exemplar) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{14} + return fileDescriptor_3c3112f9fa006917, []int{13} } func (m *Exemplar) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2020,7 +1921,6 @@ func init() { proto.RegisterType((*MetricsData)(nil), "opentelemetry.proto.metrics.v1.MetricsData") proto.RegisterType((*ResourceMetrics)(nil), "opentelemetry.proto.metrics.v1.ResourceMetrics") proto.RegisterType((*ScopeMetrics)(nil), "opentelemetry.proto.metrics.v1.ScopeMetrics") - proto.RegisterType((*InstrumentationLibraryMetrics)(nil), "opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics") proto.RegisterType((*Metric)(nil), "opentelemetry.proto.metrics.v1.Metric") proto.RegisterType((*Gauge)(nil), "opentelemetry.proto.metrics.v1.Gauge") proto.RegisterType((*Sum)(nil), "opentelemetry.proto.metrics.v1.Sum") @@ -2041,103 +1941,101 @@ func init() { } var fileDescriptor_3c3112f9fa006917 = []byte{ - // 1532 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0x5b, 0x4f, 0x1b, 0x49, - 0x16, 0x76, 0xfb, 0xee, 0x63, 0x03, 0x4e, 0x2d, 0x4b, 0x5a, 0x48, 0x10, 0xc7, 0xd9, 0x0d, 0x6c, - 0x14, 0xd9, 0x1b, 0xb2, 0xf7, 0x55, 0xa4, 0xd8, 0xd8, 0x80, 0x09, 0xb7, 0x14, 0x26, 0x52, 0xa2, - 0x28, 0xad, 0xc2, 0x2e, 0x9c, 0x52, 0xba, 0xbb, 0xbc, 0xdd, 0xd5, 0x08, 0xf6, 0x27, 0xac, 0xf6, - 0x21, 0xda, 0xdf, 0xb1, 0x3f, 0x62, 0x1f, 0xf3, 0x98, 0x7d, 0x1b, 0x8d, 0x66, 0xa2, 0x19, 0xf2, - 0x30, 0x23, 0xcd, 0x3f, 0x98, 0xa7, 0x51, 0x55, 0x77, 0xe3, 0x0b, 0x06, 0xc3, 0x24, 0x23, 0x25, - 0x4f, 0x54, 0x9d, 0x3e, 0xe7, 0x3b, 0xb7, 0xaf, 0xea, 0x14, 0x86, 0xbb, 0xbc, 0x4b, 0x6d, 0x41, - 0x4d, 0x6a, 0x51, 0xe1, 0x1c, 0x97, 0xbb, 0x0e, 0x17, 0xbc, 0x2c, 0xd7, 0xac, 0xe5, 0x96, 0x0f, - 0xef, 0x85, 0xcb, 0x92, 0xfa, 0x80, 0xe6, 0x07, 0xb4, 0x7d, 0x61, 0x29, 0x54, 0x39, 0xbc, 0x37, - 0x3b, 0xdd, 0xe1, 0x1d, 0xee, 0x63, 0xc8, 0x95, 0xaf, 0x30, 0x7b, 0x67, 0x94, 0x8f, 0x16, 0xb7, - 0x2c, 0x6e, 0x4b, 0x17, 0xfe, 0x2a, 0xd0, 0x2d, 0x8d, 0xd2, 0x75, 0xa8, 0xcb, 0x3d, 0xa7, 0x45, - 0xa5, 0x76, 0xb8, 0xf6, 0xf5, 0x8b, 0x0c, 0xb2, 0x9b, 0xbe, 0xff, 0x1a, 0x11, 0x04, 0x3d, 0x83, - 0x7c, 0xa8, 0x60, 0x04, 0x71, 0xe9, 0x5a, 0x21, 0xb6, 0x98, 0x5d, 0x2a, 0x97, 0x2e, 0x8e, 0xbd, - 0x84, 0x03, 0xbb, 0x00, 0x0e, 0x4f, 0x39, 0x83, 0x82, 0xe2, 0xd7, 0x51, 0x98, 0x1a, 0x52, 0x42, - 0x8f, 0x20, 0x1d, 0xaa, 0xe9, 0x5a, 0x41, 0x5b, 0xcc, 0x2e, 0xfd, 0x6e, 0xa4, 0x9f, 0xd3, 0xa8, - 0xfb, 0x1c, 0x55, 0xe3, 0x6f, 0xde, 0xdd, 0x88, 0xe0, 0x53, 0x00, 0xf4, 0x18, 0x26, 0xdc, 0x16, - 0xef, 0xf6, 0x22, 0x8f, 0xaa, 0xc8, 0xef, 0x8e, 0x8b, 0x7c, 0x57, 0x1a, 0x85, 0x61, 0xe7, 0xdc, - 0xbe, 0x1d, 0xfa, 0x97, 0x06, 0x37, 0x98, 0xed, 0x0a, 0xc7, 0xb3, 0xa8, 0x2d, 0x88, 0x60, 0xdc, - 0x36, 0x4c, 0xb6, 0xef, 0x10, 0xe7, 0xf8, 0xd4, 0xcb, 0xf7, 0x29, 0xe5, 0xe6, 0xc1, 0x38, 0x37, - 0x8d, 0x41, 0x9c, 0x0d, 0x1f, 0x26, 0xf0, 0x54, 0x8d, 0xea, 0x1a, 0x9e, 0x63, 0x17, 0xa9, 0xa0, - 0x39, 0x00, 0xb7, 0xf5, 0x92, 0x5a, 0xc4, 0xf0, 0x1c, 0x53, 0x8f, 0x15, 0xb4, 0xc5, 0x0c, 0xce, - 0xf8, 0x92, 0x3d, 0xc7, 0x2c, 0xfe, 0x4f, 0x83, 0x5c, 0x7f, 0x2a, 0x68, 0x1b, 0x12, 0x2a, 0x99, - 0xa0, 0xb2, 0xf7, 0x47, 0x06, 0x18, 0xb0, 0xe7, 0x6c, 0x7c, 0x0a, 0x2a, 0xa8, 0xb1, 0x8f, 0x83, - 0x1e, 0x42, 0x6a, 0xb0, 0xb4, 0xb7, 0xc7, 0xe5, 0xec, 0x87, 0x82, 0x43, 0xb3, 0x71, 0x29, 0xfc, - 0xa8, 0xc1, 0xdc, 0x85, 0x65, 0x42, 0x02, 0xae, 0x9f, 0xd3, 0x8f, 0x20, 0xcb, 0x3f, 0x5e, 0x2d, - 0xcb, 0x00, 0x3e, 0xc8, 0x73, 0x66, 0x74, 0x03, 0x7e, 0xf1, 0xc4, 0xff, 0x16, 0xd5, 0xb5, 0xe2, - 0xb7, 0x31, 0x48, 0xfa, 0x66, 0x08, 0x41, 0xdc, 0x26, 0x96, 0xdf, 0xb8, 0x0c, 0x56, 0x6b, 0x54, - 0x80, 0x6c, 0x9b, 0xba, 0x2d, 0x87, 0x75, 0x65, 0x64, 0x7a, 0x54, 0x7d, 0xea, 0x17, 0x49, 0x2b, - 0xcf, 0x66, 0x22, 0x40, 0x57, 0x6b, 0xf4, 0x00, 0x12, 0x1d, 0xe2, 0x75, 0xa8, 0x9e, 0x50, 0xd5, - 0xf9, 0xed, 0xb8, 0xb8, 0x57, 0xa5, 0xf2, 0x5a, 0x04, 0xfb, 0x56, 0xe8, 0xcf, 0x10, 0x73, 0x3d, - 0x4b, 0x4f, 0x29, 0xe3, 0x5b, 0x63, 0x0f, 0x92, 0x67, 0xad, 0x45, 0xb0, 0xb4, 0x40, 0x0d, 0xc8, - 0xbc, 0x64, 0xae, 0xe0, 0x1d, 0x87, 0x58, 0x7a, 0xe6, 0x82, 0x93, 0xdd, 0x67, 0xbe, 0x16, 0x1a, - 0xac, 0x45, 0x70, 0xcf, 0x1a, 0xbd, 0x82, 0x5f, 0xd3, 0xa3, 0x2e, 0xb7, 0xa9, 0x2d, 0x18, 0x31, - 0x8d, 0x1e, 0x2c, 0x28, 0xd8, 0x3f, 0x8c, 0x83, 0xad, 0xf7, 0x8c, 0xfb, 0x3d, 0x4c, 0xd3, 0x11, - 0x72, 0xb4, 0x0c, 0x29, 0xd7, 0xb3, 0x2c, 0xc9, 0xa7, 0xac, 0x82, 0x5f, 0xb8, 0x44, 0xd2, 0x52, - 0x7d, 0x2d, 0x82, 0x43, 0xcb, 0x6a, 0x12, 0xe2, 0x6d, 0x22, 0xc8, 0x7a, 0x3c, 0x1d, 0xcf, 0x27, - 0xd6, 0xe3, 0xe9, 0x64, 0x3e, 0xb5, 0x1e, 0x4f, 0xa7, 0xf3, 0x99, 0xe2, 0x53, 0x48, 0xa8, 0x0a, - 0xa3, 0x1d, 0xc8, 0x4a, 0x15, 0xa3, 0xcb, 0x99, 0x2d, 0x2e, 0x7d, 0xc7, 0x6e, 0x79, 0xd6, 0x3e, - 0x75, 0xe4, 0x4d, 0xbd, 0x23, 0xed, 0x30, 0xb4, 0xc3, 0xa5, 0x5b, 0xfc, 0x41, 0x83, 0xd8, 0xae, - 0x67, 0x7d, 0x7c, 0x64, 0xc4, 0xe1, 0x3a, 0xe9, 0x74, 0x1c, 0xda, 0xf1, 0xcf, 0x9b, 0xa0, 0x56, - 0x97, 0x3b, 0xc4, 0x64, 0xe2, 0x58, 0xb1, 0x70, 0x72, 0xe9, 0x4f, 0xe3, 0xd0, 0x2b, 0x3d, 0xf3, - 0x66, 0xcf, 0x1a, 0xcf, 0x90, 0x91, 0x72, 0x74, 0x13, 0x72, 0xcc, 0x35, 0x2c, 0x6e, 0x73, 0xc1, - 0x6d, 0xd6, 0x52, 0x84, 0x4e, 0xe3, 0x2c, 0x73, 0x37, 0x43, 0x51, 0xf1, 0xff, 0x1a, 0x64, 0x7a, - 0x5d, 0xdb, 0x1d, 0x95, 0xf3, 0xd2, 0xa5, 0xf9, 0xf6, 0x69, 0xa4, 0x5d, 0xfc, 0x4e, 0x83, 0xe9, - 0x51, 0x64, 0x45, 0x2f, 0x46, 0xa5, 0xf7, 0xe0, 0xe7, 0xf0, 0xfe, 0x13, 0xc9, 0xf4, 0x39, 0xa4, - 0x82, 0x63, 0x83, 0x1e, 0x8f, 0xca, 0xed, 0xf7, 0x97, 0x3c, 0x74, 0xa3, 0x4f, 0xc2, 0x49, 0x14, - 0xa6, 0x86, 0xf8, 0x8c, 0x36, 0x01, 0x88, 0x10, 0x0e, 0xdb, 0xf7, 0x04, 0x75, 0x75, 0x7f, 0x62, - 0x2f, 0x8c, 0x19, 0x15, 0x8f, 0xe8, 0xf1, 0x13, 0x62, 0x7a, 0xe1, 0x10, 0xec, 0x03, 0x40, 0x65, - 0x98, 0x76, 0x05, 0x71, 0x84, 0x21, 0x98, 0x45, 0x0d, 0xcf, 0x66, 0x47, 0x86, 0x4d, 0x6c, 0xae, - 0xca, 0x95, 0xc4, 0xd7, 0xd4, 0xb7, 0x26, 0xb3, 0xe8, 0x9e, 0xcd, 0x8e, 0xb6, 0x88, 0xcd, 0xd1, - 0x6f, 0x60, 0x72, 0x48, 0x35, 0xa6, 0x54, 0x73, 0xa2, 0x5f, 0x6b, 0x0e, 0x32, 0xc4, 0x35, 0xda, - 0xdc, 0xdb, 0x37, 0xa9, 0x1e, 0x2f, 0x68, 0x8b, 0xda, 0x5a, 0x04, 0xa7, 0x89, 0x5b, 0x53, 0x12, - 0x74, 0x1d, 0x92, 0xc4, 0x35, 0x98, 0x2d, 0xf4, 0x64, 0x41, 0x5b, 0xcc, 0xcb, 0x6b, 0x9a, 0xb8, - 0x0d, 0x5b, 0xa0, 0x0d, 0xc8, 0xd0, 0x23, 0x6a, 0x75, 0x4d, 0xe2, 0xb8, 0x7a, 0x42, 0x25, 0xb7, - 0x38, 0x9e, 0x1e, 0xbe, 0x41, 0x90, 0x5d, 0x0f, 0x00, 0x4d, 0x43, 0xe2, 0xc0, 0x24, 0x1d, 0x57, - 0x4f, 0x17, 0xb4, 0xc5, 0x09, 0xec, 0x6f, 0xaa, 0x29, 0x48, 0x1c, 0xca, 0x6a, 0xac, 0xc7, 0xd3, - 0x5a, 0x3e, 0x5a, 0xfc, 0x2a, 0x06, 0xe8, 0x2c, 0xad, 0x86, 0xea, 0x9c, 0xf9, 0x44, 0xeb, 0x3c, - 0x0d, 0x89, 0x16, 0xf7, 0x6c, 0xa1, 0x6a, 0x9c, 0xc4, 0xfe, 0x06, 0x21, 0x7f, 0xd8, 0x25, 0x82, - 0xba, 0xab, 0x39, 0x76, 0x0b, 0x26, 0xf6, 0xbd, 0xd6, 0x2b, 0x2a, 0x0c, 0xa5, 0xe3, 0xea, 0xc9, - 0x42, 0x4c, 0xc2, 0xf9, 0xc2, 0x65, 0x25, 0x43, 0x0b, 0x30, 0x45, 0x8f, 0xba, 0x26, 0x6b, 0x31, - 0x61, 0xec, 0x73, 0xcf, 0x6e, 0xfb, 0x0c, 0xd3, 0xf0, 0x64, 0x28, 0xae, 0x2a, 0xe9, 0x60, 0x9f, - 0xd2, 0x1f, 0xad, 0x4f, 0xd0, 0xd7, 0x27, 0x99, 0x85, 0xc5, 0x6c, 0x35, 0xbd, 0xb4, 0x35, 0x0d, - 0xcb, 0x8d, 0x92, 0x91, 0x23, 0x3d, 0xa7, 0x64, 0x51, 0x2c, 0x37, 0x72, 0x48, 0xb9, 0x9e, 0x65, - 0xc8, 0xbf, 0x16, 0xb3, 0xfd, 0xbf, 0xe4, 0xc8, 0x08, 0xda, 0x7b, 0x92, 0x80, 0xb9, 0x0b, 0x2f, - 0x90, 0xa1, 0x4e, 0x6b, 0x9f, 0x7d, 0xa7, 0xa7, 0xe5, 0x6b, 0x99, 0x98, 0x54, 0x9d, 0xad, 0x6b, - 0xd8, 0xdf, 0xc8, 0x77, 0xdb, 0x3f, 0xa9, 0xc3, 0xfd, 0xee, 0xab, 0x77, 0x50, 0x12, 0x67, 0xa4, - 0x44, 0xb5, 0x1e, 0x75, 0x20, 0xdd, 0xe5, 0x2e, 0x13, 0xec, 0x90, 0xaa, 0xd3, 0x92, 0x5d, 0xaa, - 0x7f, 0xd0, 0xb5, 0x5c, 0xaa, 0x2a, 0x5e, 0xb9, 0xe1, 0xff, 0x36, 0x21, 0xb8, 0x74, 0x64, 0xab, - 0x8b, 0xf4, 0x90, 0x06, 0xcf, 0xa9, 0x8f, 0xeb, 0x28, 0x04, 0x3f, 0x87, 0x54, 0x03, 0xc4, 0xcd, - 0x7e, 0x28, 0x71, 0x03, 0x8a, 0xe6, 0x46, 0x50, 0x74, 0xa2, 0x8f, 0xa2, 0xb3, 0x2b, 0x90, 0x0a, - 0xc2, 0x44, 0x33, 0x90, 0xe4, 0x07, 0x07, 0x2e, 0x15, 0xea, 0x4d, 0x7c, 0x0d, 0x07, 0xbb, 0xb3, - 0xe7, 0x53, 0xbe, 0xcf, 0xe3, 0x83, 0xe7, 0xf3, 0x3c, 0xaa, 0x17, 0xff, 0x1b, 0x83, 0xfc, 0xf0, - 0x24, 0xf9, 0x4c, 0x26, 0xc5, 0x68, 0x5e, 0xe7, 0xfb, 0x78, 0xed, 0xb3, 0x9a, 0xc1, 0xd4, 0x3f, - 0x3c, 0x62, 0x0b, 0x66, 0x52, 0x43, 0x5d, 0xdf, 0xfe, 0x0d, 0x96, 0x5d, 0x7a, 0x78, 0xd5, 0x11, - 0x5b, 0x52, 0x19, 0x56, 0xc4, 0xe3, 0x00, 0x0e, 0x4f, 0x86, 0xc0, 0xea, 0xc3, 0x39, 0x63, 0x63, - 0x76, 0x19, 0xa6, 0x86, 0x0c, 0xd1, 0x2c, 0xa4, 0x43, 0x53, 0xd5, 0x4d, 0x0d, 0x9f, 0xee, 0x25, - 0x88, 0x0a, 0x53, 0xd5, 0x47, 0xc3, 0x03, 0x23, 0xe7, 0x75, 0x0c, 0xd2, 0x21, 0xa9, 0xd0, 0x0b, - 0xf8, 0xd5, 0x01, 0x33, 0x05, 0x75, 0x68, 0xdb, 0xf8, 0xd0, 0x7e, 0xa1, 0x10, 0xa9, 0xd2, 0xeb, - 0xdb, 0xd9, 0x36, 0x44, 0xc7, 0x0d, 0xec, 0xd8, 0xe5, 0x07, 0xf6, 0x53, 0x48, 0xb9, 0x5d, 0x62, - 0x1b, 0xac, 0xad, 0x1a, 0x98, 0xab, 0x3e, 0x94, 0x81, 0x7c, 0xf9, 0xee, 0xc6, 0x5f, 0x3a, 0x7c, - 0x28, 0x76, 0xc6, 0xcb, 0x2d, 0x6e, 0x9a, 0xb4, 0x25, 0xb8, 0x53, 0xee, 0xca, 0x67, 0x4e, 0x99, - 0xd9, 0x82, 0x3a, 0x36, 0x31, 0xcb, 0x72, 0x57, 0xda, 0xed, 0x12, 0xbb, 0x51, 0xc3, 0x49, 0x09, - 0xd8, 0x68, 0xa3, 0xe7, 0x90, 0x16, 0x0e, 0x69, 0x51, 0x89, 0x9d, 0x50, 0xd8, 0x95, 0x00, 0xfb, - 0xaf, 0x57, 0xc7, 0x6e, 0x4a, 0xa4, 0x46, 0x0d, 0xa7, 0x14, 0x64, 0xa3, 0x3d, 0xf4, 0x0a, 0xb8, - 0xf3, 0x6f, 0x0d, 0x66, 0x46, 0xbf, 0xfd, 0xd0, 0x02, 0xdc, 0xaa, 0xac, 0xae, 0xe2, 0xfa, 0x6a, - 0xa5, 0xd9, 0xd8, 0xde, 0x32, 0x9a, 0xf5, 0xcd, 0x9d, 0x6d, 0x5c, 0xd9, 0x68, 0x34, 0x9f, 0x1a, - 0x7b, 0x5b, 0xbb, 0x3b, 0xf5, 0xe5, 0xc6, 0x4a, 0xa3, 0x5e, 0xcb, 0x47, 0xd0, 0x4d, 0x98, 0x3b, - 0x4f, 0xb1, 0x56, 0xdf, 0x68, 0x56, 0xf2, 0x1a, 0xba, 0x0d, 0xc5, 0xf3, 0x54, 0x96, 0xf7, 0x36, - 0xf7, 0x36, 0x2a, 0xcd, 0xc6, 0x93, 0x7a, 0x3e, 0x7a, 0xe7, 0xef, 0x30, 0x79, 0xca, 0xd7, 0x15, - 0x75, 0x71, 0x4d, 0x40, 0x66, 0x65, 0xa3, 0xb2, 0x6a, 0x6c, 0x6d, 0x6f, 0xd5, 0xf3, 0x11, 0x34, - 0x0b, 0x33, 0xc1, 0xd6, 0xc0, 0xf5, 0xe5, 0x6d, 0x5c, 0xab, 0xd7, 0x8c, 0x27, 0x95, 0x8d, 0xbd, - 0x7a, 0x5e, 0xab, 0xfe, 0x47, 0x7b, 0x73, 0x32, 0xaf, 0xbd, 0x3d, 0x99, 0xd7, 0xbe, 0x39, 0x99, - 0xd7, 0x5e, 0xbf, 0x9f, 0x8f, 0xbc, 0x7d, 0x3f, 0x1f, 0xf9, 0xe2, 0xfd, 0x7c, 0x04, 0x6e, 0x32, - 0x3e, 0xe6, 0xb8, 0x54, 0x73, 0xc1, 0x2f, 0x14, 0x3b, 0xf2, 0xc3, 0x8e, 0xf6, 0xac, 0x7e, 0xe5, - 0x62, 0xfb, 0x3f, 0xd6, 0x75, 0xa8, 0xdd, 0xf7, 0xfb, 0xe1, 0x7e, 0x52, 0x09, 0xef, 0xff, 0x14, - 0x00, 0x00, 0xff, 0xff, 0xab, 0x2c, 0xf9, 0xc6, 0x68, 0x14, 0x00, 0x00, + // 1504 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0x49, 0x6f, 0x1b, 0xc9, + 0x15, 0x66, 0x73, 0xe7, 0x23, 0x25, 0xd1, 0x15, 0x45, 0x6e, 0x08, 0x10, 0x4d, 0xd3, 0x89, 0xa5, + 0x18, 0x06, 0x19, 0xc9, 0x41, 0x16, 0x04, 0x06, 0x4c, 0x8a, 0x94, 0x44, 0x59, 0x9b, 0x4b, 0x94, + 0x00, 0x1b, 0x86, 0x1b, 0x25, 0xb2, 0x44, 0x37, 0xdc, 0x5d, 0xc5, 0x74, 0x57, 0x0b, 0x52, 0x7e, + 0x43, 0x0e, 0xfe, 0x1d, 0x41, 0x6e, 0x39, 0xe5, 0x96, 0xa3, 0x8f, 0x9e, 0xdb, 0x60, 0x30, 0x30, + 0x66, 0xe4, 0xc3, 0x0c, 0x30, 0x7f, 0x62, 0x50, 0xd5, 0xdd, 0xe2, 0x62, 0xca, 0x94, 0x97, 0x83, + 0x7d, 0x62, 0xd5, 0xeb, 0xf7, 0xbe, 0xb7, 0x7d, 0x55, 0xaf, 0x40, 0xb8, 0xcb, 0x7b, 0x94, 0x09, + 0x6a, 0x51, 0x9b, 0x0a, 0xe7, 0xac, 0xd2, 0x73, 0xb8, 0xe0, 0x15, 0xb9, 0x36, 0xdb, 0x6e, 0xe5, + 0x64, 0x39, 0x5c, 0x96, 0xd5, 0x07, 0x54, 0x18, 0xd2, 0xf6, 0x85, 0xe5, 0x50, 0xe5, 0x64, 0x79, + 0x7e, 0xb6, 0xcb, 0xbb, 0xdc, 0xc7, 0x90, 0x2b, 0x5f, 0x61, 0xfe, 0xce, 0x38, 0x1f, 0x6d, 0x6e, + 0xdb, 0x9c, 0x49, 0x17, 0xfe, 0x2a, 0xd0, 0x2d, 0x8f, 0xd3, 0x75, 0xa8, 0xcb, 0x3d, 0xa7, 0x4d, + 0xa5, 0x76, 0xb8, 0xf6, 0xf5, 0x4b, 0x26, 0x64, 0xb7, 0x7d, 0xff, 0x75, 0x22, 0x08, 0x7a, 0x02, + 0xf9, 0x50, 0xc1, 0x08, 0xe2, 0xd2, 0xb5, 0x62, 0x6c, 0x29, 0xbb, 0x52, 0x29, 0xbf, 0x3f, 0xf6, + 0x32, 0x0e, 0xec, 0x02, 0x38, 0x3c, 0xe3, 0x0c, 0x0b, 0x4a, 0xff, 0x8b, 0xc2, 0xcc, 0x88, 0x12, + 0xea, 0x82, 0xde, 0xa1, 0x3d, 0x87, 0xb6, 0x89, 0xa0, 0x1d, 0xc3, 0x6d, 0xf3, 0x5e, 0xdf, 0xef, + 0xcf, 0x29, 0xe5, 0xf8, 0xee, 0x24, 0xc7, 0xfb, 0xd2, 0x2a, 0xf4, 0x3a, 0xd7, 0x87, 0x1b, 0x94, + 0xa3, 0x87, 0x90, 0x0e, 0xe3, 0xd1, 0xb5, 0xa2, 0xb6, 0x94, 0x5d, 0xf9, 0xc3, 0x58, 0xdc, 0x8b, + 0xf2, 0x0c, 0x64, 0x54, 0x8b, 0xbf, 0x7a, 0x73, 0x23, 0x82, 0x2f, 0x00, 0xd0, 0x23, 0x98, 0x1a, + 0x0e, 0x35, 0xfa, 0x11, 0x91, 0xe6, 0xdc, 0xc1, 0xf8, 0x16, 0x00, 0xdc, 0xf6, 0x73, 0x6a, 0x13, + 0xc3, 0x73, 0x2c, 0x3d, 0x56, 0xd4, 0x96, 0x32, 0x38, 0xe3, 0x4b, 0x0e, 0x1c, 0xab, 0xf4, 0x7f, + 0x0d, 0x72, 0x43, 0xf9, 0xec, 0x42, 0x42, 0xd9, 0x07, 0xc9, 0xdc, 0x1b, 0xeb, 0x3a, 0x60, 0xc6, + 0xc9, 0x72, 0xb9, 0xc9, 0x5c, 0xe1, 0x78, 0x36, 0x65, 0x82, 0x08, 0x93, 0x33, 0x05, 0x15, 0xa4, + 0xe5, 0xe3, 0xa0, 0x07, 0x90, 0x1a, 0xce, 0xe6, 0xf6, 0xa4, 0x6c, 0xfc, 0x50, 0x70, 0x68, 0x36, + 0x29, 0x85, 0x1f, 0x63, 0x90, 0xf4, 0x4d, 0x10, 0x82, 0x38, 0x23, 0xb6, 0x1f, 0x7b, 0x06, 0xab, + 0x35, 0x2a, 0x42, 0xb6, 0x43, 0xdd, 0xb6, 0x63, 0xf6, 0x64, 0x80, 0x7a, 0x54, 0x7d, 0x1a, 0x14, + 0x49, 0x2b, 0x8f, 0x99, 0x22, 0x40, 0x56, 0x6b, 0x74, 0x1f, 0x12, 0x5d, 0xe2, 0x75, 0xa9, 0x9e, + 0x50, 0x65, 0xf8, 0xfd, 0xa4, 0x98, 0xd7, 0xa5, 0xf2, 0x46, 0x04, 0xfb, 0x56, 0xe8, 0x2f, 0x10, + 0x73, 0x3d, 0x5b, 0x4f, 0x29, 0xe3, 0x5b, 0x13, 0xdb, 0xe7, 0xd9, 0x1b, 0x11, 0x2c, 0x2d, 0x50, + 0x13, 0x32, 0xcf, 0x4d, 0x57, 0xf0, 0xae, 0x43, 0x6c, 0x3d, 0xf3, 0x1e, 0x3e, 0x0d, 0x98, 0x6f, + 0x84, 0x06, 0x1b, 0x11, 0xdc, 0xb7, 0x46, 0x2f, 0xe0, 0xb7, 0xf4, 0xb4, 0xc7, 0x19, 0x65, 0xc2, + 0x24, 0x96, 0xd1, 0x87, 0x05, 0x05, 0xfb, 0xa7, 0x49, 0xb0, 0x8d, 0xbe, 0xf1, 0xa0, 0x87, 0x59, + 0x3a, 0x46, 0x8e, 0x56, 0x21, 0xe5, 0x7a, 0xb6, 0x4d, 0x9c, 0x33, 0x3d, 0xab, 0xe0, 0x17, 0xaf, + 0x90, 0xb4, 0x54, 0xdf, 0x88, 0xe0, 0xd0, 0xb2, 0x96, 0x84, 0x78, 0x87, 0x08, 0xb2, 0x19, 0x4f, + 0xc7, 0xf3, 0x89, 0xcd, 0x78, 0x3a, 0x99, 0x4f, 0x6d, 0xc6, 0xd3, 0xe9, 0x7c, 0xa6, 0xf4, 0x18, + 0x12, 0xaa, 0xc2, 0x68, 0x0f, 0xb2, 0x52, 0xc5, 0xe8, 0x71, 0x93, 0x89, 0x2b, 0x5f, 0x21, 0x3b, + 0x9e, 0x7d, 0x44, 0x1d, 0x79, 0x11, 0xed, 0x49, 0x3b, 0x0c, 0x9d, 0x70, 0xe9, 0x96, 0x7e, 0xd1, + 0x20, 0xb6, 0xef, 0xd9, 0x9f, 0x1f, 0x19, 0x71, 0xb8, 0x4e, 0xba, 0x5d, 0x87, 0x76, 0xd5, 0xd1, + 0x30, 0x04, 0xb5, 0x7b, 0xdc, 0x21, 0x96, 0x29, 0xce, 0x14, 0x0b, 0xa7, 0x57, 0xfe, 0x3c, 0x09, + 0xbd, 0xda, 0x37, 0x6f, 0xf5, 0xad, 0xf1, 0x1c, 0x19, 0x2b, 0x47, 0x37, 0x21, 0x67, 0xba, 0x86, + 0xcd, 0x19, 0x17, 0x9c, 0x99, 0x6d, 0x45, 0xe8, 0x34, 0xce, 0x9a, 0xee, 0x76, 0x28, 0x2a, 0x7d, + 0xa3, 0x41, 0xa6, 0xdf, 0xb5, 0xfd, 0x71, 0x39, 0xaf, 0x5c, 0x99, 0x6f, 0x5f, 0x46, 0xda, 0xa5, + 0x9f, 0x34, 0x98, 0x1d, 0x47, 0x56, 0xf4, 0x6c, 0x5c, 0x7a, 0xf7, 0x3f, 0x86, 0xf7, 0x5f, 0x48, + 0xa6, 0x4f, 0x21, 0x15, 0x1c, 0x1b, 0xf4, 0x68, 0x5c, 0x6e, 0x7f, 0xbc, 0xe2, 0xa1, 0x1b, 0x7f, + 0x12, 0xce, 0xa3, 0x30, 0x33, 0xc2, 0x67, 0xb4, 0x0d, 0x40, 0x84, 0x70, 0xcc, 0x23, 0x4f, 0x50, + 0x57, 0xf7, 0x07, 0xe7, 0xe2, 0x84, 0x99, 0xf0, 0x90, 0x9e, 0x1d, 0x12, 0xcb, 0x0b, 0xe7, 0xc0, + 0x00, 0x00, 0xaa, 0xc0, 0xac, 0x2b, 0x88, 0x23, 0x0c, 0x61, 0xda, 0xd4, 0xf0, 0x98, 0x79, 0x6a, + 0x30, 0xc2, 0xb8, 0x2a, 0x57, 0x12, 0x5f, 0x53, 0xdf, 0x5a, 0xa6, 0x4d, 0x0f, 0x98, 0x79, 0xba, + 0x43, 0x18, 0x47, 0xbf, 0x83, 0xe9, 0x11, 0xd5, 0x98, 0x52, 0xcd, 0x89, 0x41, 0xad, 0x05, 0xc8, + 0x10, 0xd7, 0xe8, 0x70, 0xef, 0xc8, 0xa2, 0x7a, 0xbc, 0xa8, 0x2d, 0x69, 0x1b, 0x11, 0x9c, 0x26, + 0x6e, 0x5d, 0x49, 0xd0, 0x75, 0x48, 0x12, 0xd7, 0x30, 0x99, 0xd0, 0x93, 0x45, 0x6d, 0x29, 0x2f, + 0xaf, 0x69, 0xe2, 0x36, 0x99, 0x40, 0x5b, 0x90, 0xa1, 0xa7, 0xd4, 0xee, 0x59, 0xc4, 0x71, 0xf5, + 0x84, 0x4a, 0x6e, 0x69, 0x32, 0x3d, 0x7c, 0x83, 0x20, 0xbb, 0x3e, 0x00, 0x9a, 0x85, 0xc4, 0xb1, + 0x45, 0xba, 0xae, 0x9e, 0x2e, 0x6a, 0x4b, 0x53, 0xd8, 0xdf, 0xd4, 0x52, 0x90, 0x38, 0x91, 0xd5, + 0xd8, 0x8c, 0xa7, 0xb5, 0x7c, 0xb4, 0xf4, 0x7d, 0x0c, 0xd0, 0xbb, 0xb4, 0x1a, 0xa9, 0x73, 0xe6, + 0x0b, 0xad, 0xf3, 0x2c, 0x24, 0xda, 0xdc, 0x63, 0x42, 0xd5, 0x38, 0x89, 0xfd, 0x0d, 0x42, 0xfe, + 0xb0, 0x4b, 0x04, 0x75, 0x57, 0x73, 0xec, 0x16, 0x4c, 0x1d, 0x79, 0xed, 0x17, 0x54, 0x18, 0x4a, + 0xc7, 0xd5, 0x93, 0xc5, 0x98, 0x84, 0xf3, 0x85, 0xab, 0x4a, 0x86, 0x16, 0x61, 0x86, 0x9e, 0xf6, + 0x2c, 0xb3, 0x6d, 0x0a, 0xe3, 0x88, 0x7b, 0xac, 0xe3, 0x33, 0x4c, 0xc3, 0xd3, 0xa1, 0xb8, 0xa6, + 0xa4, 0xc3, 0x7d, 0x4a, 0x7f, 0xb6, 0x3e, 0xc1, 0x40, 0x9f, 0x64, 0x16, 0xb6, 0xc9, 0xd4, 0xf4, + 0xd2, 0x36, 0x34, 0x2c, 0x37, 0x4a, 0x46, 0x4e, 0xf5, 0x9c, 0x92, 0x45, 0xb1, 0xdc, 0xc8, 0x21, + 0xe5, 0x7a, 0xb6, 0x21, 0x7f, 0x6d, 0x93, 0xf9, 0xbf, 0xe4, 0xd4, 0x08, 0xda, 0x7b, 0x9e, 0x80, + 0x85, 0xf7, 0x5e, 0x20, 0x23, 0x9d, 0xd6, 0xbe, 0xfa, 0x4e, 0xcf, 0xca, 0x07, 0x23, 0xb1, 0xa8, + 0x3a, 0x5b, 0xd7, 0xb0, 0xbf, 0x91, 0x6f, 0xb6, 0x7f, 0x52, 0x87, 0xfb, 0xdd, 0x57, 0xef, 0xa0, + 0x24, 0xce, 0x48, 0x89, 0x6a, 0x3d, 0xea, 0x42, 0xba, 0xc7, 0x5d, 0x53, 0x98, 0x27, 0x54, 0x9d, + 0x96, 0xec, 0x4a, 0xe3, 0x93, 0xae, 0xe5, 0x72, 0x4d, 0xf1, 0xca, 0x0d, 0x5f, 0xd4, 0x21, 0xb8, + 0x74, 0xc4, 0xd4, 0x45, 0x7a, 0x42, 0x83, 0xe7, 0xd4, 0xe7, 0x75, 0x14, 0x82, 0x5f, 0x42, 0xaa, + 0x21, 0xe2, 0x66, 0x3f, 0x95, 0xb8, 0x01, 0x45, 0x73, 0x63, 0x28, 0x3a, 0x35, 0x40, 0xd1, 0xf9, + 0x35, 0x48, 0x05, 0x61, 0xa2, 0x39, 0x48, 0xf2, 0xe3, 0x63, 0x97, 0x0a, 0xf5, 0x26, 0xbe, 0x86, + 0x83, 0xdd, 0xbb, 0xe7, 0x53, 0xbe, 0xcd, 0xe3, 0xc3, 0xe7, 0xf3, 0x32, 0xaa, 0x97, 0xfe, 0x13, + 0x83, 0xfc, 0xe8, 0x24, 0xf9, 0x4a, 0x26, 0xc5, 0x78, 0x5e, 0xe7, 0x07, 0x78, 0xed, 0xb3, 0xda, + 0x84, 0x99, 0x7f, 0x78, 0x84, 0x09, 0xd3, 0xa2, 0x86, 0xba, 0xbe, 0xfd, 0x1b, 0x2c, 0xbb, 0xf2, + 0xe0, 0x43, 0x47, 0x6c, 0x59, 0x65, 0x58, 0x15, 0x8f, 0x02, 0x38, 0x3c, 0x1d, 0x02, 0xab, 0x0f, + 0x97, 0x8c, 0x8d, 0xf9, 0x55, 0x98, 0x19, 0x31, 0x44, 0xf3, 0x90, 0x0e, 0x4d, 0x55, 0x37, 0x35, + 0x7c, 0xb1, 0x97, 0x20, 0x2a, 0x4c, 0x55, 0x1f, 0x0d, 0x0f, 0x8d, 0x9c, 0x97, 0x31, 0x48, 0x87, + 0xa4, 0x42, 0xcf, 0xe0, 0x37, 0xc7, 0xa6, 0x25, 0xa8, 0x43, 0x3b, 0xc6, 0xa7, 0xf6, 0x0b, 0x85, + 0x48, 0xd5, 0x7e, 0xdf, 0xde, 0x6d, 0x43, 0x74, 0xd2, 0xc0, 0x8e, 0x5d, 0x7d, 0x60, 0x3f, 0x86, + 0x94, 0xdb, 0x23, 0xcc, 0x30, 0x3b, 0xaa, 0x81, 0xb9, 0xda, 0x03, 0x19, 0xc8, 0x77, 0x6f, 0x6e, + 0xfc, 0xb5, 0xcb, 0x47, 0x62, 0x37, 0x79, 0xa5, 0xcd, 0x2d, 0x8b, 0xb6, 0x05, 0x77, 0x2a, 0x3d, + 0xf9, 0xcc, 0xa9, 0x98, 0x4c, 0x50, 0x87, 0x11, 0xab, 0x22, 0x77, 0xe5, 0xfd, 0x1e, 0x61, 0xcd, + 0x3a, 0x4e, 0x4a, 0xc0, 0x66, 0x07, 0x3d, 0x85, 0xb4, 0x70, 0x48, 0x9b, 0x4a, 0xec, 0x84, 0xc2, + 0xae, 0x06, 0xd8, 0x7f, 0xfb, 0x70, 0xec, 0x96, 0x44, 0x6a, 0xd6, 0x71, 0x4a, 0x41, 0x36, 0x3b, + 0x23, 0xaf, 0x80, 0x3b, 0xff, 0xd2, 0x60, 0x6e, 0xfc, 0xdb, 0x0f, 0x2d, 0xc2, 0xad, 0xea, 0xfa, + 0x3a, 0x6e, 0xac, 0x57, 0x5b, 0xcd, 0xdd, 0x1d, 0xa3, 0xd5, 0xd8, 0xde, 0xdb, 0xc5, 0xd5, 0xad, + 0x66, 0xeb, 0xb1, 0x71, 0xb0, 0xb3, 0xbf, 0xd7, 0x58, 0x6d, 0xae, 0x35, 0x1b, 0xf5, 0x7c, 0x04, + 0xdd, 0x84, 0x85, 0xcb, 0x14, 0xeb, 0x8d, 0xad, 0x56, 0x35, 0xaf, 0xa1, 0xdb, 0x50, 0xba, 0x4c, + 0x65, 0xf5, 0x60, 0xfb, 0x60, 0xab, 0xda, 0x6a, 0x1e, 0x36, 0xf2, 0xd1, 0x3b, 0x7f, 0x87, 0xe9, + 0x0b, 0xbe, 0xae, 0xa9, 0x8b, 0x6b, 0x0a, 0x32, 0x6b, 0x5b, 0xd5, 0x75, 0x63, 0x67, 0x77, 0xa7, + 0x91, 0x8f, 0xa0, 0x79, 0x98, 0x0b, 0xb6, 0x06, 0x6e, 0xac, 0xee, 0xe2, 0x7a, 0xa3, 0x6e, 0x1c, + 0x56, 0xb7, 0x0e, 0x1a, 0x79, 0xad, 0xf6, 0x5f, 0xed, 0xd5, 0x79, 0x41, 0x7b, 0x7d, 0x5e, 0xd0, + 0x7e, 0x38, 0x2f, 0x68, 0x2f, 0xdf, 0x16, 0x22, 0xaf, 0xdf, 0x16, 0x22, 0xdf, 0xbe, 0x2d, 0x44, + 0xe0, 0xa6, 0xc9, 0x27, 0x1c, 0x97, 0x5a, 0x2e, 0xf8, 0xe3, 0x61, 0x4f, 0x7e, 0xd8, 0xd3, 0x9e, + 0x34, 0x3e, 0xb8, 0xd8, 0xfe, 0x7f, 0x51, 0x5d, 0xca, 0x06, 0xfe, 0x1e, 0xfb, 0x77, 0xb4, 0xb0, + 0xdb, 0xa3, 0xac, 0x75, 0x01, 0xa2, 0xe0, 0x83, 0x7f, 0x16, 0xdc, 0xf2, 0xe1, 0xf2, 0x51, 0x52, + 0x59, 0xdd, 0xfb, 0x35, 0x00, 0x00, 0xff, 0xff, 0x1f, 0xc5, 0x12, 0xc8, 0x68, 0x13, 0x00, 0x00, } func (m *MetricsData) Marshal() (dAtA []byte, err error) { @@ -2197,10 +2095,10 @@ func (m *ResourceMetrics) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.InstrumentationLibraryMetrics) > 0 { - for iNdEx := len(m.InstrumentationLibraryMetrics) - 1; iNdEx >= 0; iNdEx-- { + if len(m.DeprecatedScopeMetrics) > 0 { + for iNdEx := len(m.DeprecatedScopeMetrics) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.InstrumentationLibraryMetrics[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DeprecatedScopeMetrics[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2301,60 +2199,6 @@ func (m *ScopeMetrics) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *InstrumentationLibraryMetrics) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *InstrumentationLibraryMetrics) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InstrumentationLibraryMetrics) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SchemaUrl) > 0 { - i -= len(m.SchemaUrl) - copy(dAtA[i:], m.SchemaUrl) - i = encodeVarintMetrics(dAtA, i, uint64(len(m.SchemaUrl))) - i-- - dAtA[i] = 0x1a - } - if len(m.Metrics) > 0 { - for iNdEx := len(m.Metrics) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Metrics[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetrics(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.InstrumentationLibrary.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetrics(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *Metric) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2899,9 +2743,9 @@ func (m *HistogramDataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { } if len(m.ExplicitBounds) > 0 { for iNdEx := len(m.ExplicitBounds) - 1; iNdEx >= 0; iNdEx-- { - f9 := math.Float64bits(float64(m.ExplicitBounds[iNdEx])) + f8 := math.Float64bits(float64(m.ExplicitBounds[iNdEx])) i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f9)) + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f8)) } i = encodeVarintMetrics(dAtA, i, uint64(len(m.ExplicitBounds)*8)) i-- @@ -3177,20 +3021,20 @@ func (m *ExponentialHistogramDataPoint_Buckets) MarshalToSizedBuffer(dAtA []byte var l int _ = l if len(m.BucketCounts) > 0 { - dAtA13 := make([]byte, len(m.BucketCounts)*10) - var j12 int + dAtA12 := make([]byte, len(m.BucketCounts)*10) + var j11 int for _, num := range m.BucketCounts { for num >= 1<<7 { - dAtA13[j12] = uint8(uint64(num)&0x7f | 0x80) + dAtA12[j11] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j12++ + j11++ } - dAtA13[j12] = uint8(num) - j12++ + dAtA12[j11] = uint8(num) + j11++ } - i -= j12 - copy(dAtA[i:], dAtA13[:j12]) - i = encodeVarintMetrics(dAtA, i, uint64(j12)) + i -= j11 + copy(dAtA[i:], dAtA12[:j11]) + i = encodeVarintMetrics(dAtA, i, uint64(j11)) i-- dAtA[i] = 0x12 } @@ -3459,8 +3303,8 @@ func (m *ResourceMetrics) Size() (n int) { if l > 0 { n += 1 + l + sovMetrics(uint64(l)) } - if len(m.InstrumentationLibraryMetrics) > 0 { - for _, e := range m.InstrumentationLibraryMetrics { + if len(m.DeprecatedScopeMetrics) > 0 { + for _, e := range m.DeprecatedScopeMetrics { l = e.Size() n += 2 + l + sovMetrics(uint64(l)) } @@ -3489,27 +3333,6 @@ func (m *ScopeMetrics) Size() (n int) { return n } -func (m *InstrumentationLibraryMetrics) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.InstrumentationLibrary.Size() - n += 1 + l + sovMetrics(uint64(l)) - if len(m.Metrics) > 0 { - for _, e := range m.Metrics { - l = e.Size() - n += 1 + l + sovMetrics(uint64(l)) - } - } - l = len(m.SchemaUrl) - if l > 0 { - n += 1 + l + sovMetrics(uint64(l)) - } - return n -} - func (m *Metric) Size() (n int) { if m == nil { return 0 @@ -4220,7 +4043,7 @@ func (m *ResourceMetrics) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 1000: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InstrumentationLibraryMetrics", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedScopeMetrics", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4247,8 +4070,8 @@ func (m *ResourceMetrics) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.InstrumentationLibraryMetrics = append(m.InstrumentationLibraryMetrics, &InstrumentationLibraryMetrics{}) - if err := m.InstrumentationLibraryMetrics[len(m.InstrumentationLibraryMetrics)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.DeprecatedScopeMetrics = append(m.DeprecatedScopeMetrics, &ScopeMetrics{}) + if err := m.DeprecatedScopeMetrics[len(m.DeprecatedScopeMetrics)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -4422,155 +4245,6 @@ func (m *ScopeMetrics) Unmarshal(dAtA []byte) error { } return nil } -func (m *InstrumentationLibraryMetrics) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InstrumentationLibraryMetrics: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InstrumentationLibraryMetrics: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InstrumentationLibrary", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetrics - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetrics - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InstrumentationLibrary.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metrics", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetrics - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetrics - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metrics = append(m.Metrics, &Metric{}) - if err := m.Metrics[len(m.Metrics)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SchemaUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMetrics - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMetrics - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SchemaUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMetrics(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Metric) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/resource/v1/resource.pb.go b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/resource/v1/resource.pb.go index 7463b483e4d..d4d1565c764 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/resource/v1/resource.pb.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/resource/v1/resource.pb.go @@ -93,7 +93,7 @@ func init() { } var fileDescriptor_446f73eacf88f3f5 = []byte{ - // 284 bytes of a gzipped FileDescriptorProto + // 302 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xcb, 0x2f, 0x48, 0xcd, 0x2b, 0x49, 0xcd, 0x49, 0xcd, 0x4d, 0x2d, 0x29, 0xaa, 0xd4, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x2f, 0x4a, 0x2d, 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0xd5, 0x2f, 0x33, 0x84, 0xb3, 0xf5, 0xc0, 0x52, @@ -105,13 +105,14 @@ var fileDescriptor_446f73eacf88f3f5 = []byte{ 0x95, 0x61, 0x89, 0x39, 0xa5, 0xa9, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x21, 0x19, 0x20, 0x64, 0xc1, 0x25, 0x91, 0x52, 0x94, 0x5f, 0x50, 0x90, 0x9a, 0x12, 0x8f, 0x10, 0x8d, 0x4f, 0xce, 0x2f, 0xcd, 0x2b, 0x91, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x0d, 0x12, 0x83, 0xca, 0x3b, 0xc2, 0xa5, - 0x9d, 0x41, 0xb2, 0x4e, 0x53, 0x19, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, + 0x9d, 0x41, 0xb2, 0x4e, 0xdb, 0x19, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x81, 0x4b, 0x29, 0x33, 0x5f, 0x8f, 0x40, 0xb0, 0x38, 0xf1, 0xc2, 0x7c, 0x14, 0x00, 0x92, 0x0a, 0x60, 0x8c, 0x72, 0x4b, 0x47, 0xd7, 0x94, 0x09, 0x0a, 0x91, 0x9c, 0x9c, 0xd4, 0xe4, 0x92, 0xfc, 0x22, 0xfd, 0x82, 0x94, 0xc4, 0x92, 0x44, 0xfd, 0xcc, 0xbc, 0x92, 0xd4, 0xa2, 0xbc, 0xc4, 0x1c, 0x7d, - 0x30, 0x0f, 0x6c, 0x6a, 0x7a, 0x6a, 0x1e, 0x72, 0xfc, 0x24, 0xb1, 0x81, 0x45, 0x8d, 0x01, 0x01, - 0x00, 0x00, 0xff, 0xff, 0x9e, 0x31, 0xb9, 0x5c, 0xc9, 0x01, 0x00, 0x00, + 0x30, 0x0f, 0x6c, 0x6a, 0x7a, 0x6a, 0x1e, 0x72, 0xfc, 0xac, 0x62, 0x92, 0xf7, 0x2f, 0x48, 0xcd, + 0x0b, 0x81, 0x9b, 0x02, 0x36, 0x5f, 0x0f, 0x66, 0x9b, 0x5e, 0x98, 0x61, 0x12, 0x1b, 0x58, 0x9f, + 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xbd, 0x8b, 0xcf, 0x38, 0xeb, 0x01, 0x00, 0x00, } func (m *Resource) Marshal() (dAtA []byte, err error) { diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1/trace.pb.go b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1/trace.pb.go index 8f41776db5a..6d4f786449e 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1/trace.pb.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1/trace.pb.go @@ -79,7 +79,7 @@ func (x Span_SpanKind) String() string { } func (Span_SpanKind) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_5c407ac9c675a601, []int{4, 0} + return fileDescriptor_5c407ac9c675a601, []int{3, 0} } // For the semantics of status codes see @@ -113,7 +113,7 @@ func (x Status_StatusCode) String() string { } func (Status_StatusCode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_5c407ac9c675a601, []int{5, 0} + return fileDescriptor_5c407ac9c675a601, []int{4, 0} } // TracesData represents the traces data that can be stored in a persistent storage, @@ -177,39 +177,12 @@ func (m *TracesData) GetResourceSpans() []*ResourceSpans { // A collection of ScopeSpans from a Resource. type ResourceSpans struct { + DeprecatedScopeSpans []*ScopeSpans `protobuf:"bytes,1000,rep,name=deprecated_scope_spans,json=deprecatedScopeSpans,proto3" json:"deprecated_scope_spans,omitempty"` // The resource for the spans in this message. // If this field is not set then no resource info is known. Resource v1.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource"` // A list of ScopeSpans that originate from a resource. ScopeSpans []*ScopeSpans `protobuf:"bytes,2,rep,name=scope_spans,json=scopeSpans,proto3" json:"scope_spans,omitempty"` - // A list of InstrumentationLibrarySpans that originate from a resource. - // This field is deprecated and will be removed after grace period expires on June 15, 2022. - // - // During the grace period the following rules SHOULD be followed: - // - // For Binary Protobufs - // ==================== - // Binary Protobuf senders SHOULD NOT set instrumentation_library_spans. Instead - // scope_spans SHOULD be set. - // - // Binary Protobuf receivers SHOULD check if instrumentation_library_spans is set - // and scope_spans is not set then the value in instrumentation_library_spans - // SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. - // If scope_spans is set then instrumentation_library_spans SHOULD be ignored. - // - // For JSON - // ======== - // JSON senders that set instrumentation_library_spans field MAY also set - // scope_spans to carry the same spans, essentially double-publishing the same data. - // Such double-publishing MAY be controlled by a user-settable option. - // If double-publishing is not used then the senders SHOULD set scope_spans and - // SHOULD NOT set instrumentation_library_spans. - // - // JSON receivers SHOULD check if instrumentation_library_spans is set and - // scope_spans is not set then the value in instrumentation_library_spans - // SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. - // If scope_spans is set then instrumentation_library_spans field SHOULD be ignored. - InstrumentationLibrarySpans []*InstrumentationLibrarySpans `protobuf:"bytes,1000,rep,name=instrumentation_library_spans,json=instrumentationLibrarySpans,proto3" json:"instrumentation_library_spans,omitempty"` // Deprecated: Do not use. // This schema_url applies to the data in the "resource" field. It does not apply // to the data in the "scope_spans" field which have their own schema_url field. SchemaUrl string `protobuf:"bytes,3,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"` @@ -248,6 +221,13 @@ func (m *ResourceSpans) XXX_DiscardUnknown() { var xxx_messageInfo_ResourceSpans proto.InternalMessageInfo +func (m *ResourceSpans) GetDeprecatedScopeSpans() []*ScopeSpans { + if m != nil { + return m.DeprecatedScopeSpans + } + return nil +} + func (m *ResourceSpans) GetResource() v1.Resource { if m != nil { return m.Resource @@ -262,14 +242,6 @@ func (m *ResourceSpans) GetScopeSpans() []*ScopeSpans { return nil } -// Deprecated: Do not use. -func (m *ResourceSpans) GetInstrumentationLibrarySpans() []*InstrumentationLibrarySpans { - if m != nil { - return m.InstrumentationLibrarySpans - } - return nil -} - func (m *ResourceSpans) GetSchemaUrl() string { if m != nil { return m.SchemaUrl @@ -343,84 +315,7 @@ func (m *ScopeSpans) GetSchemaUrl() string { return "" } -// A collection of Spans produced by an InstrumentationLibrary. -// InstrumentationLibrarySpans is wire-compatible with ScopeSpans for binary -// Protobuf format. -// This message is deprecated and will be removed on June 15, 2022. -// -// Deprecated: Do not use. -type InstrumentationLibrarySpans struct { - // The instrumentation library information for the spans in this message. - // Semantically when InstrumentationLibrary isn't set, it is equivalent with - // an empty instrumentation library name (unknown). - InstrumentationLibrary v11.InstrumentationLibrary `protobuf:"bytes,1,opt,name=instrumentation_library,json=instrumentationLibrary,proto3" json:"instrumentation_library"` - // A list of Spans that originate from an instrumentation library. - Spans []*Span `protobuf:"bytes,2,rep,name=spans,proto3" json:"spans,omitempty"` - // This schema_url applies to all spans and span events in the "spans" field. - SchemaUrl string `protobuf:"bytes,3,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"` -} - -func (m *InstrumentationLibrarySpans) Reset() { *m = InstrumentationLibrarySpans{} } -func (m *InstrumentationLibrarySpans) String() string { return proto.CompactTextString(m) } -func (*InstrumentationLibrarySpans) ProtoMessage() {} -func (*InstrumentationLibrarySpans) Descriptor() ([]byte, []int) { - return fileDescriptor_5c407ac9c675a601, []int{3} -} -func (m *InstrumentationLibrarySpans) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InstrumentationLibrarySpans) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InstrumentationLibrarySpans.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *InstrumentationLibrarySpans) XXX_Merge(src proto.Message) { - xxx_messageInfo_InstrumentationLibrarySpans.Merge(m, src) -} -func (m *InstrumentationLibrarySpans) XXX_Size() int { - return m.Size() -} -func (m *InstrumentationLibrarySpans) XXX_DiscardUnknown() { - xxx_messageInfo_InstrumentationLibrarySpans.DiscardUnknown(m) -} - -var xxx_messageInfo_InstrumentationLibrarySpans proto.InternalMessageInfo - -func (m *InstrumentationLibrarySpans) GetInstrumentationLibrary() v11.InstrumentationLibrary { - if m != nil { - return m.InstrumentationLibrary - } - return v11.InstrumentationLibrary{} -} - -func (m *InstrumentationLibrarySpans) GetSpans() []*Span { - if m != nil { - return m.Spans - } - return nil -} - -func (m *InstrumentationLibrarySpans) GetSchemaUrl() string { - if m != nil { - return m.SchemaUrl - } - return "" -} - -// Span represents a single operation within a trace. Spans can be -// nested to form a trace tree. Spans may also be linked to other spans -// from the same or different trace and form graphs. Often, a trace -// contains a root span that describes the end-to-end latency, and one -// or more subspans for its sub-operations. A trace can also contain -// multiple root spans, or none at all. Spans do not need to be -// contiguous - there may be gaps or overlaps between spans in a trace. +// A Span represents a single operation performed by a single component of the system. // // The next available field id is 17. type Span struct { @@ -488,7 +383,7 @@ type Span struct { // "abc.com/score": 10.239 // // The OpenTelemetry API specification further restricts the allowed value types: - // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/common.md#attributes + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute // Attribute keys MUST be unique (it is not allowed to have more than one // attribute with the same key). Attributes []v11.KeyValue `protobuf:"bytes,9,rep,name=attributes,proto3" json:"attributes"` @@ -516,7 +411,7 @@ func (m *Span) Reset() { *m = Span{} } func (m *Span) String() string { return proto.CompactTextString(m) } func (*Span) ProtoMessage() {} func (*Span) Descriptor() ([]byte, []int) { - return fileDescriptor_5c407ac9c675a601, []int{4} + return fileDescriptor_5c407ac9c675a601, []int{3} } func (m *Span) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -650,7 +545,7 @@ func (m *Span_Event) Reset() { *m = Span_Event{} } func (m *Span_Event) String() string { return proto.CompactTextString(m) } func (*Span_Event) ProtoMessage() {} func (*Span_Event) Descriptor() ([]byte, []int) { - return fileDescriptor_5c407ac9c675a601, []int{4, 0} + return fileDescriptor_5c407ac9c675a601, []int{3, 0} } func (m *Span_Event) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -732,7 +627,7 @@ func (m *Span_Link) Reset() { *m = Span_Link{} } func (m *Span_Link) String() string { return proto.CompactTextString(m) } func (*Span_Link) ProtoMessage() {} func (*Span_Link) Descriptor() ([]byte, []int) { - return fileDescriptor_5c407ac9c675a601, []int{4, 1} + return fileDescriptor_5c407ac9c675a601, []int{3, 1} } func (m *Span_Link) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -795,7 +690,7 @@ func (m *Status) Reset() { *m = Status{} } func (m *Status) String() string { return proto.CompactTextString(m) } func (*Status) ProtoMessage() {} func (*Status) Descriptor() ([]byte, []int) { - return fileDescriptor_5c407ac9c675a601, []int{5} + return fileDescriptor_5c407ac9c675a601, []int{4} } func (m *Status) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -844,7 +739,6 @@ func init() { proto.RegisterType((*TracesData)(nil), "opentelemetry.proto.trace.v1.TracesData") proto.RegisterType((*ResourceSpans)(nil), "opentelemetry.proto.trace.v1.ResourceSpans") proto.RegisterType((*ScopeSpans)(nil), "opentelemetry.proto.trace.v1.ScopeSpans") - proto.RegisterType((*InstrumentationLibrarySpans)(nil), "opentelemetry.proto.trace.v1.InstrumentationLibrarySpans") proto.RegisterType((*Span)(nil), "opentelemetry.proto.trace.v1.Span") proto.RegisterType((*Span_Event)(nil), "opentelemetry.proto.trace.v1.Span.Event") proto.RegisterType((*Span_Link)(nil), "opentelemetry.proto.trace.v1.Span.Link") @@ -856,72 +750,70 @@ func init() { } var fileDescriptor_5c407ac9c675a601 = []byte{ - // 1040 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x56, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0x38, 0x6b, 0x27, 0x79, 0x49, 0xdc, 0xcd, 0x90, 0x86, 0x25, 0xa5, 0x8e, 0x65, 0x55, - 0xc2, 0x50, 0xc9, 0xa6, 0xa9, 0x90, 0x52, 0x24, 0x44, 0x63, 0x7b, 0x91, 0x96, 0xa4, 0x76, 0x34, - 0xb6, 0x2b, 0x81, 0x90, 0x96, 0x8d, 0x77, 0x08, 0xab, 0xd8, 0xb3, 0xd6, 0xee, 0x38, 0x6a, 0x6e, - 0x88, 0x33, 0x07, 0xae, 0xfc, 0x23, 0xdc, 0xb8, 0x57, 0x70, 0xe9, 0x11, 0x71, 0xa8, 0x50, 0x72, - 0x81, 0x1b, 0x7f, 0x02, 0x9a, 0x1f, 0x9b, 0x78, 0x43, 0x6a, 0x37, 0x12, 0xb9, 0xf4, 0x62, 0xcf, - 0xbe, 0x1f, 0xdf, 0xfb, 0xde, 0x37, 0x6f, 0x46, 0x03, 0x95, 0x70, 0x44, 0x19, 0xa7, 0x03, 0x3a, - 0xa4, 0x3c, 0x3a, 0xa9, 0x8d, 0xa2, 0x90, 0x87, 0x35, 0x1e, 0x79, 0x7d, 0x5a, 0x3b, 0x7e, 0xa0, - 0x16, 0x55, 0x69, 0xc4, 0xef, 0xa6, 0x22, 0x95, 0xb1, 0xaa, 0x02, 0x8e, 0x1f, 0x6c, 0xac, 0x1d, - 0x86, 0x87, 0xa1, 0xca, 0x16, 0x2b, 0xe5, 0xde, 0xf8, 0xe0, 0x2a, 0xf4, 0x7e, 0x38, 0x1c, 0x86, - 0x4c, 0xc0, 0xab, 0x95, 0x8e, 0xad, 0x5e, 0x15, 0x1b, 0xd1, 0x38, 0x1c, 0x47, 0x8a, 0x4c, 0xb2, - 0x56, 0xf1, 0xe5, 0xaf, 0x01, 0xba, 0xa2, 0x7a, 0xdc, 0xf4, 0xb8, 0x87, 0x09, 0x14, 0x12, 0xbf, - 0x1b, 0x8f, 0x3c, 0x16, 0x5b, 0xa8, 0x34, 0x57, 0x59, 0xda, 0xba, 0x5f, 0x9d, 0x46, 0xbb, 0x4a, - 0x74, 0x4e, 0x47, 0xa4, 0x90, 0x95, 0x68, 0xf2, 0xb3, 0xfc, 0x5b, 0x16, 0x56, 0x52, 0x01, 0x78, - 0x17, 0x16, 0x92, 0x10, 0x0b, 0x95, 0x50, 0x65, 0x69, 0xeb, 0xfd, 0x2b, 0xf1, 0xcf, 0xa9, 0x4e, - 0x94, 0xa8, 0x1b, 0xcf, 0x5f, 0x6e, 0x66, 0xc8, 0x39, 0x00, 0x76, 0x60, 0x29, 0xee, 0x87, 0xa3, - 0x84, 0x6f, 0x56, 0xf2, 0xad, 0x4c, 0xe7, 0xdb, 0x11, 0x09, 0x8a, 0x2c, 0xc4, 0xe7, 0x6b, 0xfc, - 0x3d, 0x82, 0xbb, 0x01, 0x8b, 0x79, 0x34, 0x1e, 0x52, 0xc6, 0x3d, 0x1e, 0x84, 0xcc, 0x1d, 0x04, - 0x07, 0x91, 0x17, 0x9d, 0x68, 0xf4, 0xbf, 0xe6, 0x25, 0xfc, 0xa3, 0xe9, 0xf0, 0x4e, 0x1a, 0x63, - 0x4f, 0x41, 0xc8, 0x1a, 0xf5, 0xac, 0x85, 0xc8, 0x9d, 0xe0, 0xd5, 0x01, 0xf8, 0x2e, 0x40, 0xdc, - 0xff, 0x96, 0x0e, 0x3d, 0x77, 0x1c, 0x0d, 0xac, 0xb9, 0x12, 0xaa, 0x2c, 0x92, 0x45, 0x65, 0xe9, - 0x45, 0x83, 0xf2, 0xcf, 0x08, 0xe0, 0x82, 0x3e, 0x6e, 0x43, 0x4e, 0x36, 0xa0, 0x75, 0x7c, 0x78, - 0x25, 0x31, 0x3d, 0x20, 0xff, 0x65, 0x26, 0x81, 0xb4, 0xa2, 0x0a, 0x07, 0x6f, 0x43, 0x6e, 0x52, - 0xc8, 0xf2, 0x0c, 0x21, 0x47, 0x1e, 0x23, 0x2a, 0x61, 0x16, 0xf1, 0x7f, 0x10, 0xdc, 0x99, 0x22, - 0x0c, 0xe6, 0xf0, 0xf6, 0x2b, 0xb4, 0xd7, 0xbd, 0x7d, 0x74, 0xbd, 0xde, 0x34, 0xb8, 0xee, 0x6e, - 0xfd, 0x6a, 0xc9, 0x6f, 0xac, 0xdd, 0x8f, 0xb3, 0x16, 0x2a, 0x7f, 0xb7, 0x02, 0x86, 0x48, 0xc1, - 0x5f, 0xc1, 0x82, 0xc4, 0x70, 0x03, 0x5f, 0x36, 0xb3, 0x5c, 0xdf, 0x11, 0xac, 0xfe, 0x78, 0xb9, - 0xf9, 0xe8, 0x30, 0xbc, 0x54, 0x32, 0x10, 0x47, 0x7b, 0x30, 0xa0, 0x7d, 0x1e, 0x46, 0xb5, 0x91, - 0xef, 0x71, 0xaf, 0x16, 0x30, 0x4e, 0x23, 0xe6, 0x0d, 0x6a, 0xe2, 0xab, 0x2a, 0x8f, 0xab, 0xd3, - 0x24, 0xf3, 0x12, 0xd2, 0xf1, 0xf1, 0x17, 0x30, 0x2f, 0x28, 0x09, 0xf0, 0xac, 0x04, 0x7f, 0xac, - 0xc1, 0xb7, 0xaf, 0x0f, 0x2e, 0xe8, 0x3a, 0x4d, 0x92, 0x17, 0x80, 0x8e, 0x8f, 0x37, 0x61, 0x49, - 0x11, 0x8f, 0xb9, 0xc7, 0xa9, 0xee, 0x12, 0xa4, 0xa9, 0x23, 0x2c, 0xf8, 0x1b, 0x28, 0x8c, 0xbc, - 0x88, 0x32, 0xee, 0x26, 0x14, 0x8c, 0xff, 0x89, 0xc2, 0xb2, 0xc2, 0xed, 0x28, 0x22, 0x18, 0x0c, - 0xe6, 0x0d, 0xa9, 0x95, 0x93, 0x0c, 0xe4, 0x1a, 0x7f, 0x0a, 0xc6, 0x51, 0xc0, 0x7c, 0x2b, 0x5f, - 0x42, 0x95, 0xc2, 0xac, 0x2b, 0x4a, 0xe0, 0xc8, 0x9f, 0xdd, 0x80, 0xf9, 0x44, 0x26, 0xe2, 0x1a, - 0xac, 0xc5, 0xdc, 0x8b, 0xb8, 0xcb, 0x83, 0x21, 0x75, 0xc7, 0x2c, 0x78, 0xe6, 0x32, 0x8f, 0x85, - 0xd6, 0x7c, 0x09, 0x55, 0xf2, 0x64, 0x55, 0xfa, 0xba, 0xc1, 0x90, 0xf6, 0x58, 0xf0, 0xac, 0xe5, - 0xb1, 0x10, 0xdf, 0x07, 0x4c, 0x99, 0x7f, 0x39, 0x7c, 0x41, 0x86, 0xdf, 0xa2, 0xcc, 0x4f, 0x05, - 0x3f, 0x01, 0xf0, 0x38, 0x8f, 0x82, 0x83, 0x31, 0xa7, 0xb1, 0xb5, 0x28, 0xe7, 0xeb, 0xbd, 0x19, - 0x33, 0xbc, 0x4b, 0x4f, 0x9e, 0x7a, 0x83, 0x71, 0x72, 0x26, 0x27, 0x00, 0xf0, 0x36, 0x58, 0x7e, - 0x14, 0x8e, 0x46, 0xd4, 0x77, 0x2f, 0xac, 0x6e, 0x3f, 0x1c, 0x33, 0x6e, 0x41, 0x09, 0x55, 0x56, - 0xc8, 0xba, 0xf6, 0xef, 0x9c, 0xbb, 0x1b, 0xc2, 0x8b, 0x1f, 0x43, 0x9e, 0x1e, 0x53, 0xc6, 0x63, - 0x6b, 0xe9, 0xb5, 0x2e, 0x47, 0xa1, 0x94, 0x2d, 0x12, 0x88, 0xce, 0xc3, 0x1f, 0xc2, 0x5a, 0x52, - 0x5b, 0x59, 0x74, 0xdd, 0x65, 0x59, 0x17, 0x6b, 0x9f, 0xcc, 0xd1, 0x35, 0x3f, 0x81, 0xdc, 0x20, - 0x60, 0x47, 0xb1, 0xb5, 0x32, 0xa5, 0xef, 0x74, 0xc9, 0xbd, 0x80, 0x1d, 0x11, 0x95, 0x85, 0xab, - 0xf0, 0x56, 0x52, 0x50, 0x1a, 0x74, 0xbd, 0x82, 0xac, 0xb7, 0xaa, 0x5d, 0x22, 0x41, 0x97, 0xab, - 0x43, 0x5e, 0x4c, 0xe8, 0x38, 0xb6, 0x6e, 0xc9, 0xbb, 0xe2, 0xde, 0x8c, 0x7a, 0x32, 0x56, 0x8b, - 0xac, 0x33, 0x37, 0x7e, 0x45, 0x90, 0x93, 0x2d, 0xe0, 0x7b, 0x50, 0xb8, 0xb4, 0xc5, 0x48, 0x6e, - 0xf1, 0x32, 0x9f, 0xdc, 0xdf, 0x64, 0x24, 0xb3, 0x13, 0x23, 0x99, 0xde, 0xf3, 0xb9, 0x9b, 0xdc, - 0x73, 0x63, 0xda, 0x9e, 0x6f, 0xfc, 0x9d, 0x05, 0x43, 0xe8, 0xf3, 0x06, 0x5f, 0x3d, 0x69, 0xad, - 0x8d, 0x9b, 0xd4, 0x3a, 0x37, 0x4d, 0xeb, 0xf2, 0x4f, 0x08, 0x16, 0x92, 0x9b, 0x05, 0xbf, 0x03, - 0xb7, 0x3b, 0xfb, 0x3b, 0x2d, 0x77, 0xd7, 0x69, 0x35, 0xdd, 0x5e, 0xab, 0xb3, 0x6f, 0x37, 0x9c, - 0xcf, 0x1c, 0xbb, 0x69, 0x66, 0xf0, 0x3a, 0xe0, 0x0b, 0x97, 0xd3, 0xea, 0xda, 0xa4, 0xb5, 0xb3, - 0x67, 0x22, 0xbc, 0x06, 0xe6, 0x85, 0xbd, 0x63, 0x93, 0xa7, 0x36, 0x31, 0xb3, 0x69, 0x6b, 0x63, - 0xcf, 0xb1, 0x5b, 0x5d, 0x73, 0x2e, 0x8d, 0xb1, 0x4f, 0xda, 0xcd, 0x5e, 0xc3, 0x26, 0xa6, 0x91, - 0xb6, 0x37, 0xda, 0xad, 0x4e, 0xef, 0x89, 0x4d, 0xcc, 0x5c, 0xf9, 0x17, 0x04, 0x79, 0x35, 0xed, - 0xd8, 0x82, 0xf9, 0x21, 0x8d, 0x63, 0xef, 0x30, 0x19, 0xd9, 0xe4, 0x13, 0x37, 0xc0, 0xe8, 0x87, - 0xbe, 0xd2, 0xb8, 0xb0, 0x55, 0x7b, 0x9d, 0xb3, 0xa3, 0xff, 0x1a, 0xa1, 0x4f, 0x89, 0x4c, 0x2e, - 0xb7, 0x00, 0x2e, 0x6c, 0xf8, 0x36, 0xac, 0x76, 0xba, 0x3b, 0xdd, 0x5e, 0xc7, 0x6d, 0xb4, 0x9b, - 0xb6, 0x10, 0xc2, 0xee, 0x9a, 0x19, 0x8c, 0xa1, 0x30, 0x69, 0x6e, 0xef, 0x9a, 0xe8, 0x72, 0xa8, - 0x4d, 0x48, 0x9b, 0x98, 0xd9, 0xcf, 0x8d, 0x05, 0x64, 0x66, 0xeb, 0x3f, 0xa0, 0xe7, 0xa7, 0x45, - 0xf4, 0xe2, 0xb4, 0x88, 0xfe, 0x3c, 0x2d, 0xa2, 0x1f, 0xcf, 0x8a, 0x99, 0x17, 0x67, 0xc5, 0xcc, - 0xef, 0x67, 0xc5, 0x0c, 0x6c, 0x06, 0xe1, 0x54, 0xa6, 0x75, 0xf5, 0xb0, 0xdd, 0x17, 0xc6, 0x7d, - 0xf4, 0x65, 0xe3, 0xda, 0x13, 0xa9, 0x1e, 0xcf, 0x87, 0x94, 0x9d, 0xbf, 0xe4, 0x0f, 0xf2, 0xd2, - 0xf4, 0xf0, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x56, 0xa5, 0xef, 0x0c, 0xf0, 0x0b, 0x00, 0x00, + // 1007 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x56, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0xcf, 0xa4, 0x4e, 0xda, 0xbe, 0xb6, 0x59, 0x77, 0xe8, 0x56, 0xa6, 0x5a, 0xd2, 0x28, 0x5a, + 0x89, 0xc0, 0x4a, 0x09, 0xed, 0x5e, 0xca, 0x01, 0xb1, 0x6d, 0x62, 0x24, 0xd3, 0x6e, 0x52, 0x8d, + 0x93, 0x4a, 0x20, 0x24, 0x33, 0x1b, 0x0f, 0xc5, 0x6a, 0x32, 0xb6, 0xec, 0x49, 0xb5, 0x7b, 0xe3, + 0x23, 0x70, 0xe5, 0x13, 0x20, 0xc1, 0x9d, 0x1b, 0xf7, 0x15, 0xa7, 0x3d, 0x22, 0x0e, 0x2b, 0xd4, + 0x5e, 0xe0, 0x5b, 0xa0, 0x99, 0xb1, 0xf3, 0xa7, 0xaa, 0x92, 0xad, 0xc4, 0x5e, 0xf6, 0xd2, 0x4e, + 0xde, 0x7b, 0xbf, 0x3f, 0xef, 0xcd, 0xb3, 0x65, 0xa8, 0x85, 0x11, 0xe3, 0x82, 0x0d, 0xd8, 0x90, + 0x89, 0xf8, 0x45, 0x23, 0x8a, 0x43, 0x11, 0x36, 0x44, 0x4c, 0xfb, 0xac, 0x71, 0xb9, 0xa7, 0x0f, + 0x75, 0x15, 0xc4, 0x0f, 0x66, 0x2a, 0x75, 0xb0, 0xae, 0x0b, 0x2e, 0xf7, 0x76, 0xb6, 0xce, 0xc3, + 0xf3, 0x50, 0xa3, 0xe5, 0x49, 0xa7, 0x77, 0x3e, 0xbe, 0x8d, 0xbd, 0x1f, 0x0e, 0x87, 0x21, 0x97, + 0xf4, 0xfa, 0x94, 0xd6, 0xd6, 0x6f, 0xab, 0x8d, 0x59, 0x12, 0x8e, 0x62, 0x6d, 0x26, 0x3b, 0xeb, + 0xfa, 0xea, 0xb7, 0x00, 0x5d, 0xa9, 0x9e, 0xb4, 0xa8, 0xa0, 0x98, 0x40, 0x29, 0xcb, 0x7b, 0x49, + 0x44, 0x79, 0x62, 0xa1, 0xca, 0x52, 0x6d, 0x6d, 0xff, 0x51, 0x7d, 0x9e, 0xed, 0x3a, 0x49, 0x31, + 0xae, 0x84, 0x90, 0x8d, 0x78, 0xfa, 0x67, 0xf5, 0xe7, 0x3c, 0x6c, 0xcc, 0x14, 0x60, 0x0f, 0xb6, + 0x7d, 0x16, 0xc5, 0xac, 0x4f, 0x05, 0xf3, 0xbd, 0xa4, 0x1f, 0x46, 0x99, 0xda, 0x3f, 0xcb, 0x4a, + 0xae, 0x36, 0x5f, 0xce, 0x95, 0x08, 0xad, 0xb5, 0x35, 0x21, 0x9a, 0x44, 0xf1, 0x31, 0xac, 0x64, + 0x1e, 0x2c, 0x54, 0x41, 0xb5, 0xb5, 0xfd, 0x8f, 0x6e, 0x65, 0x1c, 0xcf, 0x62, 0xaa, 0x87, 0x23, + 0xe3, 0xe5, 0xeb, 0xdd, 0x1c, 0x19, 0x13, 0x60, 0x07, 0xd6, 0xa6, 0x2d, 0xe6, 0xef, 0xe8, 0x10, + 0x92, 0x89, 0xaf, 0x0f, 0x00, 0x92, 0xfe, 0xf7, 0x6c, 0x48, 0xbd, 0x51, 0x3c, 0xb0, 0x96, 0x2a, + 0xa8, 0xb6, 0x4a, 0x56, 0x75, 0xa4, 0x17, 0x0f, 0xaa, 0xbf, 0x21, 0x80, 0xa9, 0x2e, 0x3a, 0x50, + 0x50, 0xd8, 0xb4, 0x85, 0xc7, 0xb7, 0x4a, 0xa6, 0x97, 0x7f, 0xb9, 0x57, 0x77, 0x78, 0x22, 0xe2, + 0xd1, 0x90, 0x71, 0x41, 0x45, 0x10, 0x72, 0x45, 0x94, 0x36, 0xa3, 0x79, 0xf0, 0x01, 0x14, 0xa6, + 0x7b, 0xa8, 0x2e, 0xe8, 0x21, 0xa2, 0x9c, 0x68, 0xc0, 0x22, 0xe3, 0x3f, 0x6c, 0x80, 0x21, 0xcb, + 0xf1, 0x37, 0xb0, 0xa2, 0xf0, 0x5e, 0xe0, 0x2b, 0xd7, 0xeb, 0x47, 0x87, 0xd2, 0xc0, 0x5f, 0xaf, + 0x77, 0x3f, 0x3d, 0x0f, 0x6f, 0xc8, 0x05, 0x72, 0x87, 0x07, 0x03, 0xd6, 0x17, 0x61, 0xdc, 0x88, + 0x7c, 0x2a, 0x68, 0x23, 0xe0, 0x82, 0xc5, 0x9c, 0x0e, 0x1a, 0xf2, 0x57, 0x5d, 0xed, 0xa5, 0xd3, + 0x22, 0xcb, 0x8a, 0xd2, 0xf1, 0xf1, 0x57, 0xb0, 0x2c, 0xed, 0x48, 0xf2, 0xbc, 0x22, 0x7f, 0x92, + 0x92, 0x1f, 0xdc, 0x9d, 0x5c, 0xda, 0x75, 0x5a, 0xa4, 0x28, 0x09, 0x1d, 0x1f, 0xef, 0xc2, 0x9a, + 0x36, 0x9e, 0x08, 0x2a, 0x58, 0xda, 0x21, 0xa8, 0x90, 0x2b, 0x23, 0xf8, 0x3b, 0x28, 0x45, 0x34, + 0x66, 0x5c, 0x78, 0x99, 0x05, 0xe3, 0x7f, 0xb2, 0xb0, 0xae, 0x79, 0x5d, 0x6d, 0x04, 0x83, 0xc1, + 0xe9, 0x90, 0x59, 0x05, 0xe5, 0x40, 0x9d, 0xf1, 0xe7, 0x60, 0x5c, 0x04, 0xdc, 0xb7, 0x8a, 0x15, + 0x54, 0x2b, 0x2d, 0x7a, 0x16, 0x25, 0x8f, 0xfa, 0x73, 0x1c, 0x70, 0x9f, 0x28, 0x20, 0x6e, 0xc0, + 0x56, 0x22, 0x68, 0x2c, 0x3c, 0x11, 0x0c, 0x99, 0x37, 0xe2, 0xc1, 0x73, 0x8f, 0x53, 0x1e, 0x5a, + 0xcb, 0x15, 0x54, 0x2b, 0x92, 0x4d, 0x95, 0xeb, 0x06, 0x43, 0xd6, 0xe3, 0xc1, 0xf3, 0x36, 0xe5, + 0x21, 0x7e, 0x04, 0x98, 0x71, 0xff, 0x66, 0xf9, 0x8a, 0x2a, 0xbf, 0xc7, 0xb8, 0x3f, 0x53, 0xfc, + 0x14, 0x80, 0x0a, 0x11, 0x07, 0xcf, 0x46, 0x82, 0x25, 0xd6, 0xaa, 0xda, 0xad, 0x0f, 0x17, 0x2c, + 0xeb, 0x31, 0x7b, 0x71, 0x46, 0x07, 0xa3, 0x6c, 0x41, 0xa7, 0x08, 0xf0, 0x01, 0x58, 0x7e, 0x1c, + 0x46, 0x11, 0xf3, 0xbd, 0x49, 0xd4, 0xeb, 0x87, 0x23, 0x2e, 0x2c, 0xa8, 0xa0, 0xda, 0x06, 0xd9, + 0x4e, 0xf3, 0x87, 0xe3, 0x74, 0x53, 0x66, 0xf1, 0x13, 0x28, 0xb2, 0x4b, 0xc6, 0x45, 0x62, 0xad, + 0xbd, 0xd1, 0x43, 0x2a, 0x27, 0x65, 0x4b, 0x00, 0x49, 0x71, 0xf8, 0x13, 0xd8, 0xca, 0xb4, 0x75, + 0x24, 0xd5, 0x5d, 0x57, 0xba, 0x38, 0xcd, 0x29, 0x4c, 0xaa, 0xf9, 0x19, 0x14, 0x06, 0x01, 0xbf, + 0x48, 0xac, 0x8d, 0x39, 0x7d, 0xcf, 0x4a, 0x9e, 0x04, 0xfc, 0x82, 0x68, 0x14, 0xae, 0xc3, 0x7b, + 0x99, 0xa0, 0x0a, 0xa4, 0x7a, 0x25, 0xa5, 0xb7, 0x99, 0xa6, 0x24, 0x20, 0x95, 0x3b, 0x82, 0xa2, + 0xdc, 0xd0, 0x51, 0x62, 0xdd, 0x53, 0x2f, 0x85, 0x87, 0x0b, 0xf4, 0x54, 0x6d, 0x3a, 0xe4, 0x14, + 0xb9, 0xf3, 0x07, 0x82, 0x82, 0x6a, 0x01, 0x3f, 0x84, 0xd2, 0x8d, 0x2b, 0x46, 0xea, 0x8a, 0xd7, + 0xc5, 0xf4, 0xfd, 0x66, 0x2b, 0x99, 0x9f, 0x5a, 0xc9, 0xd9, 0x3b, 0x5f, 0x7a, 0x9b, 0x77, 0x6e, + 0xcc, 0xbb, 0xf3, 0x9d, 0x7f, 0xf3, 0x60, 0xc8, 0xf9, 0xbc, 0xc3, 0xaf, 0x9e, 0xd9, 0x59, 0x1b, + 0x6f, 0x73, 0xd6, 0x85, 0x79, 0xb3, 0xae, 0xfe, 0x84, 0x60, 0x25, 0x7b, 0xb3, 0xe0, 0xf7, 0xe1, + 0xbe, 0x7b, 0x7a, 0xd8, 0xf6, 0x8e, 0x9d, 0x76, 0xcb, 0xeb, 0xb5, 0xdd, 0x53, 0xbb, 0xe9, 0x7c, + 0xe1, 0xd8, 0x2d, 0x33, 0x87, 0xb7, 0x01, 0x4f, 0x52, 0x4e, 0xbb, 0x6b, 0x93, 0xf6, 0xe1, 0x89, + 0x89, 0xf0, 0x16, 0x98, 0x93, 0xb8, 0x6b, 0x93, 0x33, 0x9b, 0x98, 0xf9, 0xd9, 0x68, 0xf3, 0xc4, + 0xb1, 0xdb, 0x5d, 0x73, 0x69, 0x96, 0xe3, 0x94, 0x74, 0x5a, 0xbd, 0xa6, 0x4d, 0x4c, 0x63, 0x36, + 0xde, 0xec, 0xb4, 0xdd, 0xde, 0x53, 0x9b, 0x98, 0x85, 0xea, 0xef, 0x08, 0x8a, 0x7a, 0xdb, 0xb1, + 0x05, 0xcb, 0x43, 0x96, 0x24, 0xf4, 0x3c, 0x5b, 0xd9, 0xec, 0x27, 0x6e, 0x82, 0xd1, 0x0f, 0x7d, + 0x3d, 0xe3, 0xd2, 0x7e, 0xe3, 0x4d, 0x9e, 0x9d, 0xf4, 0x5f, 0x33, 0xf4, 0x19, 0x51, 0xe0, 0x6a, + 0x1b, 0x60, 0x12, 0xc3, 0xf7, 0x61, 0xd3, 0xed, 0x1e, 0x76, 0x7b, 0xae, 0xd7, 0xec, 0xb4, 0x6c, + 0x39, 0x08, 0xbb, 0x6b, 0xe6, 0x30, 0x86, 0xd2, 0x74, 0xb8, 0x73, 0x6c, 0xa2, 0x9b, 0xa5, 0x36, + 0x21, 0x1d, 0x62, 0xe6, 0xbf, 0x34, 0x56, 0x90, 0x99, 0x3f, 0xfa, 0x15, 0xbd, 0xbc, 0x2a, 0xa3, + 0x57, 0x57, 0x65, 0xf4, 0xf7, 0x55, 0x19, 0xfd, 0x78, 0x5d, 0xce, 0xbd, 0xba, 0x2e, 0xe7, 0xfe, + 0xbc, 0x2e, 0xe7, 0x60, 0x37, 0x08, 0xe7, 0x3a, 0x3d, 0xd2, 0x5f, 0x70, 0xa7, 0x32, 0x78, 0x8a, + 0xbe, 0x6e, 0xde, 0x79, 0x23, 0xf5, 0x57, 0xe2, 0x39, 0xe3, 0xe3, 0x4f, 0xd6, 0x5f, 0xf2, 0x0f, + 0x3a, 0x11, 0xe3, 0xdd, 0x31, 0x85, 0x22, 0xd7, 0x8f, 0x45, 0xfd, 0x6c, 0xef, 0x59, 0x51, 0x21, + 0x1e, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0xbb, 0xe9, 0x90, 0xbc, 0xf8, 0x0a, 0x00, 0x00, } func (m *TracesData) Marshal() (dAtA []byte, err error) { @@ -981,10 +873,10 @@ func (m *ResourceSpans) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.InstrumentationLibrarySpans) > 0 { - for iNdEx := len(m.InstrumentationLibrarySpans) - 1; iNdEx >= 0; iNdEx-- { + if len(m.DeprecatedScopeSpans) > 0 { + for iNdEx := len(m.DeprecatedScopeSpans) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.InstrumentationLibrarySpans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DeprecatedScopeSpans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1085,60 +977,6 @@ func (m *ScopeSpans) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *InstrumentationLibrarySpans) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *InstrumentationLibrarySpans) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InstrumentationLibrarySpans) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SchemaUrl) > 0 { - i -= len(m.SchemaUrl) - copy(dAtA[i:], m.SchemaUrl) - i = encodeVarintTrace(dAtA, i, uint64(len(m.SchemaUrl))) - i-- - dAtA[i] = 0x1a - } - if len(m.Spans) > 0 { - for iNdEx := len(m.Spans) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Spans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTrace(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.InstrumentationLibrary.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTrace(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *Span) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1493,8 +1331,8 @@ func (m *ResourceSpans) Size() (n int) { if l > 0 { n += 1 + l + sovTrace(uint64(l)) } - if len(m.InstrumentationLibrarySpans) > 0 { - for _, e := range m.InstrumentationLibrarySpans { + if len(m.DeprecatedScopeSpans) > 0 { + for _, e := range m.DeprecatedScopeSpans { l = e.Size() n += 2 + l + sovTrace(uint64(l)) } @@ -1523,27 +1361,6 @@ func (m *ScopeSpans) Size() (n int) { return n } -func (m *InstrumentationLibrarySpans) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.InstrumentationLibrary.Size() - n += 1 + l + sovTrace(uint64(l)) - if len(m.Spans) > 0 { - for _, e := range m.Spans { - l = e.Size() - n += 1 + l + sovTrace(uint64(l)) - } - } - l = len(m.SchemaUrl) - if l > 0 { - n += 1 + l + sovTrace(uint64(l)) - } - return n -} - func (m *Span) Size() (n int) { if m == nil { return 0 @@ -1892,7 +1709,7 @@ func (m *ResourceSpans) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 1000: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InstrumentationLibrarySpans", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedScopeSpans", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1919,8 +1736,8 @@ func (m *ResourceSpans) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.InstrumentationLibrarySpans = append(m.InstrumentationLibrarySpans, &InstrumentationLibrarySpans{}) - if err := m.InstrumentationLibrarySpans[len(m.InstrumentationLibrarySpans)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.DeprecatedScopeSpans = append(m.DeprecatedScopeSpans, &ScopeSpans{}) + if err := m.DeprecatedScopeSpans[len(m.DeprecatedScopeSpans)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2094,155 +1911,6 @@ func (m *ScopeSpans) Unmarshal(dAtA []byte) error { } return nil } -func (m *InstrumentationLibrarySpans) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTrace - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InstrumentationLibrarySpans: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InstrumentationLibrarySpans: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InstrumentationLibrary", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTrace - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTrace - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTrace - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InstrumentationLibrary.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spans", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTrace - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTrace - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTrace - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Spans = append(m.Spans, &Span{}) - if err := m.Spans[len(m.Spans)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SchemaUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTrace - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTrace - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTrace - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SchemaUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTrace(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTrace - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Span) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/data/spanid.go b/vendor/go.opentelemetry.io/collector/pdata/internal/data/spanid.go index 09063199c7a..b48485d73a4 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/data/spanid.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/data/spanid.go @@ -15,76 +15,62 @@ package data // import "go.opentelemetry.io/collector/pdata/internal/data" import ( - "encoding/hex" "errors" + + "github.com/gogo/protobuf/proto" ) const spanIDSize = 8 -var errInvalidSpanIDSize = errors.New("invalid length for SpanID") +var ( + errMarshalSpanID = errors.New("marshal: invalid buffer length for SpanID") + errUnmarshalSpanID = errors.New("unmarshal: invalid SpanID length") +) // SpanID is a custom data type that is used for all span_id fields in OTLP // Protobuf messages. -type SpanID struct { - id [spanIDSize]byte -} - -// NewSpanID creates a SpanID from a byte slice. -func NewSpanID(bytes [8]byte) SpanID { - return SpanID{id: bytes} -} +type SpanID [spanIDSize]byte -// HexString returns hex representation of the ID. -func (sid SpanID) HexString() string { - if sid.IsEmpty() { - return "" - } - return hex.EncodeToString(sid.id[:]) -} +var _ proto.Sizer = (*SpanID)(nil) // Size returns the size of the data to serialize. -func (sid *SpanID) Size() int { +func (sid SpanID) Size() int { if sid.IsEmpty() { return 0 } return spanIDSize } -// Equal returns true if ids are equal. -func (sid SpanID) Equal(that SpanID) bool { - return sid.id == that.id -} - // IsEmpty returns true if id contains at least one non-zero byte. func (sid SpanID) IsEmpty() bool { - return sid.id == [8]byte{} -} - -// Bytes returns the byte array representation of the SpanID. -func (sid SpanID) Bytes() [8]byte { - return sid.id + return sid == [spanIDSize]byte{} } // MarshalTo converts trace ID into a binary representation. Called by Protobuf serialization. -func (sid *SpanID) MarshalTo(data []byte) (n int, err error) { +func (sid SpanID) MarshalTo(data []byte) (n int, err error) { if sid.IsEmpty() { return 0, nil } - return marshalBytes(data, sid.id[:]) + + if len(data) < spanIDSize { + return 0, errMarshalSpanID + } + + return copy(data, sid[:]), nil } // Unmarshal inflates this trace ID from binary representation. Called by Protobuf serialization. func (sid *SpanID) Unmarshal(data []byte) error { if len(data) == 0 { - sid.id = [8]byte{} + *sid = [spanIDSize]byte{} return nil } if len(data) != spanIDSize { - return errInvalidSpanIDSize + return errUnmarshalSpanID } - copy(sid.id[:], data) + copy(sid[:], data) return nil } @@ -93,12 +79,12 @@ func (sid SpanID) MarshalJSON() ([]byte, error) { if sid.IsEmpty() { return []byte(`""`), nil } - return marshalJSON(sid.id[:]) + return marshalJSON(sid[:]) } // UnmarshalJSON decodes SpanID from hex string, possibly enclosed in quotes. // Called by Protobuf JSON deserialization. func (sid *SpanID) UnmarshalJSON(data []byte) error { - sid.id = [8]byte{} - return unmarshalJSON(sid.id[:], data) + *sid = [spanIDSize]byte{} + return unmarshalJSON(sid[:], data) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/data/traceid.go b/vendor/go.opentelemetry.io/collector/pdata/internal/data/traceid.go index b0730a0c4a4..2f43f0e4cfc 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/data/traceid.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/data/traceid.go @@ -15,78 +15,62 @@ package data // import "go.opentelemetry.io/collector/pdata/internal/data" import ( - "encoding/hex" "errors" + + "github.com/gogo/protobuf/proto" ) const traceIDSize = 16 -var errInvalidTraceIDSize = errors.New("invalid length for TraceID") +var ( + errMarshalTraceID = errors.New("marshal: invalid buffer length for TraceID") + errUnmarshalTraceID = errors.New("unmarshal: invalid TraceID length") +) // TraceID is a custom data type that is used for all trace_id fields in OTLP // Protobuf messages. -type TraceID struct { - id [traceIDSize]byte -} - -// NewTraceID creates a TraceID from a byte slice. -func NewTraceID(bytes [16]byte) TraceID { - return TraceID{ - id: bytes, - } -} +type TraceID [traceIDSize]byte -// HexString returns hex representation of the ID. -func (tid TraceID) HexString() string { - if tid.IsEmpty() { - return "" - } - return hex.EncodeToString(tid.id[:]) -} +var _ proto.Sizer = (*SpanID)(nil) // Size returns the size of the data to serialize. -func (tid *TraceID) Size() int { +func (tid TraceID) Size() int { if tid.IsEmpty() { return 0 } return traceIDSize } -// Equal returns true if ids are equal. -func (tid TraceID) Equal(that TraceID) bool { - return tid.id == that.id -} - // IsEmpty returns true if id contains at leas one non-zero byte. func (tid TraceID) IsEmpty() bool { - return tid.id == [16]byte{} -} - -// Bytes returns the byte array representation of the TraceID. -func (tid TraceID) Bytes() [16]byte { - return tid.id + return tid == [traceIDSize]byte{} } // MarshalTo converts trace ID into a binary representation. Called by Protobuf serialization. -func (tid *TraceID) MarshalTo(data []byte) (n int, err error) { +func (tid TraceID) MarshalTo(data []byte) (n int, err error) { if tid.IsEmpty() { return 0, nil } - return marshalBytes(data, tid.id[:]) + + if len(data) < traceIDSize { + return 0, errMarshalTraceID + } + + return copy(data, tid[:]), nil } // Unmarshal inflates this trace ID from binary representation. Called by Protobuf serialization. func (tid *TraceID) Unmarshal(data []byte) error { if len(data) == 0 { - tid.id = [16]byte{} + *tid = [traceIDSize]byte{} return nil } if len(data) != traceIDSize { - return errInvalidTraceIDSize + return errUnmarshalTraceID } - copy(tid.id[:], data) + copy(tid[:], data) return nil } @@ -95,12 +79,12 @@ func (tid TraceID) MarshalJSON() ([]byte, error) { if tid.IsEmpty() { return []byte(`""`), nil } - return marshalJSON(tid.id[:]) + return marshalJSON(tid[:]) } // UnmarshalJSON inflates trace id from hex string, possibly enclosed in quotes. // Called by Protobuf JSON deserialization. func (tid *TraceID) UnmarshalJSON(data []byte) error { - tid.id = [16]byte{} - return unmarshalJSON(tid.id[:], data) + *tid = [traceIDSize]byte{} + return unmarshalJSON(tid[:], data) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_immutable_slice.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_immutable_slice.go deleted file mode 100644 index 5ca3d0f68b4..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_immutable_slice.go +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". - -package internal - -// ImmutableByteSlice represents a []byte slice that cannot be mutated. -// The instance of ImmutableByteSlice can be assigned to multiple objects since it's immutable. -type ImmutableByteSlice struct { - value []byte -} - -// NewImmutableByteSlice creates a new ImmutableByteSlice by copying the provided []byte slice. -func NewImmutableByteSlice(val []byte) ImmutableByteSlice { - is := ImmutableByteSlice{} - if len(val) != 0 { - is.value = make([]byte, len(val)) - copy(is.value, val) - } - return is -} - -// AsRaw returns a copy of the []byte slice. -func (is ImmutableByteSlice) AsRaw() []byte { - if len(is.value) == 0 { - return nil - } - val := make([]byte, len(is.value)) - copy(val, is.value) - return val -} - -// Len returns length of the []byte slice value. -func (is ImmutableByteSlice) Len() int { - return len(is.value) -} - -// At returns an item from particular index. -func (is ImmutableByteSlice) At(i int) byte { - return is.value[i] -} - -// ImmutableFloat64Slice represents a []float64 slice that cannot be mutated. -// The instance of ImmutableFloat64Slice can be assigned to multiple objects since it's immutable. -type ImmutableFloat64Slice struct { - value []float64 -} - -// NewImmutableFloat64Slice creates a new ImmutableFloat64Slice by copying the provided []float64 slice. -func NewImmutableFloat64Slice(val []float64) ImmutableFloat64Slice { - is := ImmutableFloat64Slice{} - if len(val) != 0 { - is.value = make([]float64, len(val)) - copy(is.value, val) - } - return is -} - -// AsRaw returns a copy of the []float64 slice. -func (is ImmutableFloat64Slice) AsRaw() []float64 { - if len(is.value) == 0 { - return nil - } - val := make([]float64, len(is.value)) - copy(val, is.value) - return val -} - -// Len returns length of the []float64 slice value. -func (is ImmutableFloat64Slice) Len() int { - return len(is.value) -} - -// At returns an item from particular index. -func (is ImmutableFloat64Slice) At(i int) float64 { - return is.value[i] -} - -// ImmutableUInt64Slice represents a []uint64 slice that cannot be mutated. -// The instance of ImmutableUInt64Slice can be assigned to multiple objects since it's immutable. -type ImmutableUInt64Slice struct { - value []uint64 -} - -// NewImmutableUInt64Slice creates a new ImmutableUInt64Slice by copying the provided []uint64 slice. -func NewImmutableUInt64Slice(val []uint64) ImmutableUInt64Slice { - is := ImmutableUInt64Slice{} - if len(val) != 0 { - is.value = make([]uint64, len(val)) - copy(is.value, val) - } - return is -} - -// AsRaw returns a copy of the []uint64 slice. -func (is ImmutableUInt64Slice) AsRaw() []uint64 { - if len(is.value) == 0 { - return nil - } - val := make([]uint64, len(is.value)) - copy(val, is.value) - return val -} - -// Len returns length of the []uint64 slice value. -func (is ImmutableUInt64Slice) Len() int { - return len(is.value) -} - -// At returns an item from particular index. -func (is ImmutableUInt64Slice) At(i int) uint64 { - return is.value[i] -} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_common.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_common.go new file mode 100644 index 00000000000..28c256c871c --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_common.go @@ -0,0 +1,74 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". + +package internal + +import ( + otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" +) + +type InstrumentationScope struct { + orig *otlpcommon.InstrumentationScope +} + +func GetOrigInstrumentationScope(ms InstrumentationScope) *otlpcommon.InstrumentationScope { + return ms.orig +} + +func NewInstrumentationScope(orig *otlpcommon.InstrumentationScope) InstrumentationScope { + return InstrumentationScope{orig: orig} +} + +type Slice struct { + orig *[]otlpcommon.AnyValue +} + +func GetOrigSlice(ms Slice) *[]otlpcommon.AnyValue { + return ms.orig +} + +func NewSlice(orig *[]otlpcommon.AnyValue) Slice { + return Slice{orig: orig} +} + +func GenerateTestInstrumentationScope() InstrumentationScope { + orig := otlpcommon.InstrumentationScope{} + tv := NewInstrumentationScope(&orig) + FillTestInstrumentationScope(tv) + return tv +} + +func FillTestInstrumentationScope(tv InstrumentationScope) { + tv.orig.Name = "test_name" + tv.orig.Version = "test_version" + FillTestMap(NewMap(&tv.orig.Attributes)) + tv.orig.DroppedAttributesCount = uint32(17) +} + +func GenerateTestSlice() Slice { + orig := []otlpcommon.AnyValue{} + tv := NewSlice(&orig) + FillTestSlice(tv) + return tv +} + +func FillTestSlice(tv Slice) { + *tv.orig = make([]otlpcommon.AnyValue, 7) + for i := 0; i < 7; i++ { + FillTestValue(NewValue(&(*tv.orig)[i])) + } +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_logs.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_logs.go new file mode 100644 index 00000000000..9c94a4237ca --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_logs.go @@ -0,0 +1,186 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". + +package internal + +import ( + "go.opentelemetry.io/collector/pdata/internal/data" + otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" +) + +type ResourceLogsSlice struct { + orig *[]*otlplogs.ResourceLogs +} + +func GetOrigResourceLogsSlice(ms ResourceLogsSlice) *[]*otlplogs.ResourceLogs { + return ms.orig +} + +func NewResourceLogsSlice(orig *[]*otlplogs.ResourceLogs) ResourceLogsSlice { + return ResourceLogsSlice{orig: orig} +} + +type ResourceLogs struct { + orig *otlplogs.ResourceLogs +} + +func GetOrigResourceLogs(ms ResourceLogs) *otlplogs.ResourceLogs { + return ms.orig +} + +func NewResourceLogs(orig *otlplogs.ResourceLogs) ResourceLogs { + return ResourceLogs{orig: orig} +} + +type ScopeLogsSlice struct { + orig *[]*otlplogs.ScopeLogs +} + +func GetOrigScopeLogsSlice(ms ScopeLogsSlice) *[]*otlplogs.ScopeLogs { + return ms.orig +} + +func NewScopeLogsSlice(orig *[]*otlplogs.ScopeLogs) ScopeLogsSlice { + return ScopeLogsSlice{orig: orig} +} + +type ScopeLogs struct { + orig *otlplogs.ScopeLogs +} + +func GetOrigScopeLogs(ms ScopeLogs) *otlplogs.ScopeLogs { + return ms.orig +} + +func NewScopeLogs(orig *otlplogs.ScopeLogs) ScopeLogs { + return ScopeLogs{orig: orig} +} + +type LogRecordSlice struct { + orig *[]*otlplogs.LogRecord +} + +func GetOrigLogRecordSlice(ms LogRecordSlice) *[]*otlplogs.LogRecord { + return ms.orig +} + +func NewLogRecordSlice(orig *[]*otlplogs.LogRecord) LogRecordSlice { + return LogRecordSlice{orig: orig} +} + +type LogRecord struct { + orig *otlplogs.LogRecord +} + +func GetOrigLogRecord(ms LogRecord) *otlplogs.LogRecord { + return ms.orig +} + +func NewLogRecord(orig *otlplogs.LogRecord) LogRecord { + return LogRecord{orig: orig} +} + +func GenerateTestResourceLogsSlice() ResourceLogsSlice { + orig := []*otlplogs.ResourceLogs{} + tv := NewResourceLogsSlice(&orig) + FillTestResourceLogsSlice(tv) + return tv +} + +func FillTestResourceLogsSlice(tv ResourceLogsSlice) { + *tv.orig = make([]*otlplogs.ResourceLogs, 7) + for i := 0; i < 7; i++ { + (*tv.orig)[i] = &otlplogs.ResourceLogs{} + FillTestResourceLogs(NewResourceLogs((*tv.orig)[i])) + } +} + +func GenerateTestResourceLogs() ResourceLogs { + orig := otlplogs.ResourceLogs{} + tv := NewResourceLogs(&orig) + FillTestResourceLogs(tv) + return tv +} + +func FillTestResourceLogs(tv ResourceLogs) { + FillTestResource(NewResource(&tv.orig.Resource)) + tv.orig.SchemaUrl = "https://opentelemetry.io/schemas/1.5.0" + FillTestScopeLogsSlice(NewScopeLogsSlice(&tv.orig.ScopeLogs)) +} + +func GenerateTestScopeLogsSlice() ScopeLogsSlice { + orig := []*otlplogs.ScopeLogs{} + tv := NewScopeLogsSlice(&orig) + FillTestScopeLogsSlice(tv) + return tv +} + +func FillTestScopeLogsSlice(tv ScopeLogsSlice) { + *tv.orig = make([]*otlplogs.ScopeLogs, 7) + for i := 0; i < 7; i++ { + (*tv.orig)[i] = &otlplogs.ScopeLogs{} + FillTestScopeLogs(NewScopeLogs((*tv.orig)[i])) + } +} + +func GenerateTestScopeLogs() ScopeLogs { + orig := otlplogs.ScopeLogs{} + tv := NewScopeLogs(&orig) + FillTestScopeLogs(tv) + return tv +} + +func FillTestScopeLogs(tv ScopeLogs) { + FillTestInstrumentationScope(NewInstrumentationScope(&tv.orig.Scope)) + tv.orig.SchemaUrl = "https://opentelemetry.io/schemas/1.5.0" + FillTestLogRecordSlice(NewLogRecordSlice(&tv.orig.LogRecords)) +} + +func GenerateTestLogRecordSlice() LogRecordSlice { + orig := []*otlplogs.LogRecord{} + tv := NewLogRecordSlice(&orig) + FillTestLogRecordSlice(tv) + return tv +} + +func FillTestLogRecordSlice(tv LogRecordSlice) { + *tv.orig = make([]*otlplogs.LogRecord, 7) + for i := 0; i < 7; i++ { + (*tv.orig)[i] = &otlplogs.LogRecord{} + FillTestLogRecord(NewLogRecord((*tv.orig)[i])) + } +} + +func GenerateTestLogRecord() LogRecord { + orig := otlplogs.LogRecord{} + tv := NewLogRecord(&orig) + FillTestLogRecord(tv) + return tv +} + +func FillTestLogRecord(tv LogRecord) { + tv.orig.ObservedTimeUnixNano = 1234567890 + tv.orig.TimeUnixNano = 1234567890 + tv.orig.TraceId = data.TraceID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1}) + tv.orig.SpanId = data.SpanID([8]byte{8, 7, 6, 5, 4, 3, 2, 1}) + tv.orig.Flags = 1 + tv.orig.SeverityText = "INFO" + tv.orig.SeverityNumber = otlplogs.SeverityNumber(5) + FillTestValue(NewValue(&tv.orig.Body)) + FillTestMap(NewMap(&tv.orig.Attributes)) + tv.orig.DroppedAttributesCount = uint32(17) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_logs_otlp.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_logs_otlp.go new file mode 100644 index 00000000000..eb2109f0a92 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_logs_otlp.go @@ -0,0 +1,46 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". + +package internal + +import ( + otlpcollectorlog "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1" +) + +type LogsExportPartialSuccess struct { + orig *otlpcollectorlog.ExportLogsPartialSuccess +} + +func GetOrigLogsExportPartialSuccess(ms LogsExportPartialSuccess) *otlpcollectorlog.ExportLogsPartialSuccess { + return ms.orig +} + +func NewLogsExportPartialSuccess(orig *otlpcollectorlog.ExportLogsPartialSuccess) LogsExportPartialSuccess { + return LogsExportPartialSuccess{orig: orig} +} + +func GenerateTestLogsExportPartialSuccess() LogsExportPartialSuccess { + orig := otlpcollectorlog.ExportLogsPartialSuccess{} + tv := NewLogsExportPartialSuccess(&orig) + FillTestLogsExportPartialSuccess(tv) + return tv +} + +func FillTestLogsExportPartialSuccess(tv LogsExportPartialSuccess) { + tv.orig.RejectedLogRecords = int64(13) + tv.orig.ErrorMessage = "error message" +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_metrics.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_metrics.go new file mode 100644 index 00000000000..1345b0cab30 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_metrics.go @@ -0,0 +1,661 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". + +package internal + +import ( + "go.opentelemetry.io/collector/pdata/internal/data" + otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" +) + +type ResourceMetricsSlice struct { + orig *[]*otlpmetrics.ResourceMetrics +} + +func GetOrigResourceMetricsSlice(ms ResourceMetricsSlice) *[]*otlpmetrics.ResourceMetrics { + return ms.orig +} + +func NewResourceMetricsSlice(orig *[]*otlpmetrics.ResourceMetrics) ResourceMetricsSlice { + return ResourceMetricsSlice{orig: orig} +} + +type ResourceMetrics struct { + orig *otlpmetrics.ResourceMetrics +} + +func GetOrigResourceMetrics(ms ResourceMetrics) *otlpmetrics.ResourceMetrics { + return ms.orig +} + +func NewResourceMetrics(orig *otlpmetrics.ResourceMetrics) ResourceMetrics { + return ResourceMetrics{orig: orig} +} + +type ScopeMetricsSlice struct { + orig *[]*otlpmetrics.ScopeMetrics +} + +func GetOrigScopeMetricsSlice(ms ScopeMetricsSlice) *[]*otlpmetrics.ScopeMetrics { + return ms.orig +} + +func NewScopeMetricsSlice(orig *[]*otlpmetrics.ScopeMetrics) ScopeMetricsSlice { + return ScopeMetricsSlice{orig: orig} +} + +type ScopeMetrics struct { + orig *otlpmetrics.ScopeMetrics +} + +func GetOrigScopeMetrics(ms ScopeMetrics) *otlpmetrics.ScopeMetrics { + return ms.orig +} + +func NewScopeMetrics(orig *otlpmetrics.ScopeMetrics) ScopeMetrics { + return ScopeMetrics{orig: orig} +} + +type MetricSlice struct { + orig *[]*otlpmetrics.Metric +} + +func GetOrigMetricSlice(ms MetricSlice) *[]*otlpmetrics.Metric { + return ms.orig +} + +func NewMetricSlice(orig *[]*otlpmetrics.Metric) MetricSlice { + return MetricSlice{orig: orig} +} + +type Metric struct { + orig *otlpmetrics.Metric +} + +func GetOrigMetric(ms Metric) *otlpmetrics.Metric { + return ms.orig +} + +func NewMetric(orig *otlpmetrics.Metric) Metric { + return Metric{orig: orig} +} + +type Gauge struct { + orig *otlpmetrics.Gauge +} + +func GetOrigGauge(ms Gauge) *otlpmetrics.Gauge { + return ms.orig +} + +func NewGauge(orig *otlpmetrics.Gauge) Gauge { + return Gauge{orig: orig} +} + +type Sum struct { + orig *otlpmetrics.Sum +} + +func GetOrigSum(ms Sum) *otlpmetrics.Sum { + return ms.orig +} + +func NewSum(orig *otlpmetrics.Sum) Sum { + return Sum{orig: orig} +} + +type Histogram struct { + orig *otlpmetrics.Histogram +} + +func GetOrigHistogram(ms Histogram) *otlpmetrics.Histogram { + return ms.orig +} + +func NewHistogram(orig *otlpmetrics.Histogram) Histogram { + return Histogram{orig: orig} +} + +type ExponentialHistogram struct { + orig *otlpmetrics.ExponentialHistogram +} + +func GetOrigExponentialHistogram(ms ExponentialHistogram) *otlpmetrics.ExponentialHistogram { + return ms.orig +} + +func NewExponentialHistogram(orig *otlpmetrics.ExponentialHistogram) ExponentialHistogram { + return ExponentialHistogram{orig: orig} +} + +type Summary struct { + orig *otlpmetrics.Summary +} + +func GetOrigSummary(ms Summary) *otlpmetrics.Summary { + return ms.orig +} + +func NewSummary(orig *otlpmetrics.Summary) Summary { + return Summary{orig: orig} +} + +type NumberDataPointSlice struct { + orig *[]*otlpmetrics.NumberDataPoint +} + +func GetOrigNumberDataPointSlice(ms NumberDataPointSlice) *[]*otlpmetrics.NumberDataPoint { + return ms.orig +} + +func NewNumberDataPointSlice(orig *[]*otlpmetrics.NumberDataPoint) NumberDataPointSlice { + return NumberDataPointSlice{orig: orig} +} + +type NumberDataPoint struct { + orig *otlpmetrics.NumberDataPoint +} + +func GetOrigNumberDataPoint(ms NumberDataPoint) *otlpmetrics.NumberDataPoint { + return ms.orig +} + +func NewNumberDataPoint(orig *otlpmetrics.NumberDataPoint) NumberDataPoint { + return NumberDataPoint{orig: orig} +} + +type HistogramDataPointSlice struct { + orig *[]*otlpmetrics.HistogramDataPoint +} + +func GetOrigHistogramDataPointSlice(ms HistogramDataPointSlice) *[]*otlpmetrics.HistogramDataPoint { + return ms.orig +} + +func NewHistogramDataPointSlice(orig *[]*otlpmetrics.HistogramDataPoint) HistogramDataPointSlice { + return HistogramDataPointSlice{orig: orig} +} + +type HistogramDataPoint struct { + orig *otlpmetrics.HistogramDataPoint +} + +func GetOrigHistogramDataPoint(ms HistogramDataPoint) *otlpmetrics.HistogramDataPoint { + return ms.orig +} + +func NewHistogramDataPoint(orig *otlpmetrics.HistogramDataPoint) HistogramDataPoint { + return HistogramDataPoint{orig: orig} +} + +type ExponentialHistogramDataPointSlice struct { + orig *[]*otlpmetrics.ExponentialHistogramDataPoint +} + +func GetOrigExponentialHistogramDataPointSlice(ms ExponentialHistogramDataPointSlice) *[]*otlpmetrics.ExponentialHistogramDataPoint { + return ms.orig +} + +func NewExponentialHistogramDataPointSlice(orig *[]*otlpmetrics.ExponentialHistogramDataPoint) ExponentialHistogramDataPointSlice { + return ExponentialHistogramDataPointSlice{orig: orig} +} + +type ExponentialHistogramDataPoint struct { + orig *otlpmetrics.ExponentialHistogramDataPoint +} + +func GetOrigExponentialHistogramDataPoint(ms ExponentialHistogramDataPoint) *otlpmetrics.ExponentialHistogramDataPoint { + return ms.orig +} + +func NewExponentialHistogramDataPoint(orig *otlpmetrics.ExponentialHistogramDataPoint) ExponentialHistogramDataPoint { + return ExponentialHistogramDataPoint{orig: orig} +} + +type ExponentialHistogramDataPointBuckets struct { + orig *otlpmetrics.ExponentialHistogramDataPoint_Buckets +} + +func GetOrigExponentialHistogramDataPointBuckets(ms ExponentialHistogramDataPointBuckets) *otlpmetrics.ExponentialHistogramDataPoint_Buckets { + return ms.orig +} + +func NewExponentialHistogramDataPointBuckets(orig *otlpmetrics.ExponentialHistogramDataPoint_Buckets) ExponentialHistogramDataPointBuckets { + return ExponentialHistogramDataPointBuckets{orig: orig} +} + +type SummaryDataPointSlice struct { + orig *[]*otlpmetrics.SummaryDataPoint +} + +func GetOrigSummaryDataPointSlice(ms SummaryDataPointSlice) *[]*otlpmetrics.SummaryDataPoint { + return ms.orig +} + +func NewSummaryDataPointSlice(orig *[]*otlpmetrics.SummaryDataPoint) SummaryDataPointSlice { + return SummaryDataPointSlice{orig: orig} +} + +type SummaryDataPoint struct { + orig *otlpmetrics.SummaryDataPoint +} + +func GetOrigSummaryDataPoint(ms SummaryDataPoint) *otlpmetrics.SummaryDataPoint { + return ms.orig +} + +func NewSummaryDataPoint(orig *otlpmetrics.SummaryDataPoint) SummaryDataPoint { + return SummaryDataPoint{orig: orig} +} + +type SummaryDataPointValueAtQuantileSlice struct { + orig *[]*otlpmetrics.SummaryDataPoint_ValueAtQuantile +} + +func GetOrigSummaryDataPointValueAtQuantileSlice(ms SummaryDataPointValueAtQuantileSlice) *[]*otlpmetrics.SummaryDataPoint_ValueAtQuantile { + return ms.orig +} + +func NewSummaryDataPointValueAtQuantileSlice(orig *[]*otlpmetrics.SummaryDataPoint_ValueAtQuantile) SummaryDataPointValueAtQuantileSlice { + return SummaryDataPointValueAtQuantileSlice{orig: orig} +} + +type SummaryDataPointValueAtQuantile struct { + orig *otlpmetrics.SummaryDataPoint_ValueAtQuantile +} + +func GetOrigSummaryDataPointValueAtQuantile(ms SummaryDataPointValueAtQuantile) *otlpmetrics.SummaryDataPoint_ValueAtQuantile { + return ms.orig +} + +func NewSummaryDataPointValueAtQuantile(orig *otlpmetrics.SummaryDataPoint_ValueAtQuantile) SummaryDataPointValueAtQuantile { + return SummaryDataPointValueAtQuantile{orig: orig} +} + +type ExemplarSlice struct { + orig *[]otlpmetrics.Exemplar +} + +func GetOrigExemplarSlice(ms ExemplarSlice) *[]otlpmetrics.Exemplar { + return ms.orig +} + +func NewExemplarSlice(orig *[]otlpmetrics.Exemplar) ExemplarSlice { + return ExemplarSlice{orig: orig} +} + +type Exemplar struct { + orig *otlpmetrics.Exemplar +} + +func GetOrigExemplar(ms Exemplar) *otlpmetrics.Exemplar { + return ms.orig +} + +func NewExemplar(orig *otlpmetrics.Exemplar) Exemplar { + return Exemplar{orig: orig} +} + +func GenerateTestResourceMetricsSlice() ResourceMetricsSlice { + orig := []*otlpmetrics.ResourceMetrics{} + tv := NewResourceMetricsSlice(&orig) + FillTestResourceMetricsSlice(tv) + return tv +} + +func FillTestResourceMetricsSlice(tv ResourceMetricsSlice) { + *tv.orig = make([]*otlpmetrics.ResourceMetrics, 7) + for i := 0; i < 7; i++ { + (*tv.orig)[i] = &otlpmetrics.ResourceMetrics{} + FillTestResourceMetrics(NewResourceMetrics((*tv.orig)[i])) + } +} + +func GenerateTestResourceMetrics() ResourceMetrics { + orig := otlpmetrics.ResourceMetrics{} + tv := NewResourceMetrics(&orig) + FillTestResourceMetrics(tv) + return tv +} + +func FillTestResourceMetrics(tv ResourceMetrics) { + FillTestResource(NewResource(&tv.orig.Resource)) + tv.orig.SchemaUrl = "https://opentelemetry.io/schemas/1.5.0" + FillTestScopeMetricsSlice(NewScopeMetricsSlice(&tv.orig.ScopeMetrics)) +} + +func GenerateTestScopeMetricsSlice() ScopeMetricsSlice { + orig := []*otlpmetrics.ScopeMetrics{} + tv := NewScopeMetricsSlice(&orig) + FillTestScopeMetricsSlice(tv) + return tv +} + +func FillTestScopeMetricsSlice(tv ScopeMetricsSlice) { + *tv.orig = make([]*otlpmetrics.ScopeMetrics, 7) + for i := 0; i < 7; i++ { + (*tv.orig)[i] = &otlpmetrics.ScopeMetrics{} + FillTestScopeMetrics(NewScopeMetrics((*tv.orig)[i])) + } +} + +func GenerateTestScopeMetrics() ScopeMetrics { + orig := otlpmetrics.ScopeMetrics{} + tv := NewScopeMetrics(&orig) + FillTestScopeMetrics(tv) + return tv +} + +func FillTestScopeMetrics(tv ScopeMetrics) { + FillTestInstrumentationScope(NewInstrumentationScope(&tv.orig.Scope)) + tv.orig.SchemaUrl = "https://opentelemetry.io/schemas/1.5.0" + FillTestMetricSlice(NewMetricSlice(&tv.orig.Metrics)) +} + +func GenerateTestMetricSlice() MetricSlice { + orig := []*otlpmetrics.Metric{} + tv := NewMetricSlice(&orig) + FillTestMetricSlice(tv) + return tv +} + +func FillTestMetricSlice(tv MetricSlice) { + *tv.orig = make([]*otlpmetrics.Metric, 7) + for i := 0; i < 7; i++ { + (*tv.orig)[i] = &otlpmetrics.Metric{} + FillTestMetric(NewMetric((*tv.orig)[i])) + } +} + +func GenerateTestMetric() Metric { + orig := otlpmetrics.Metric{} + tv := NewMetric(&orig) + FillTestMetric(tv) + return tv +} + +func FillTestMetric(tv Metric) { + tv.orig.Name = "test_name" + tv.orig.Description = "test_description" + tv.orig.Unit = "1" + tv.orig.Data = &otlpmetrics.Metric_Sum{Sum: &otlpmetrics.Sum{}} + FillTestSum(NewSum(tv.orig.GetSum())) +} + +func GenerateTestGauge() Gauge { + orig := otlpmetrics.Gauge{} + tv := NewGauge(&orig) + FillTestGauge(tv) + return tv +} + +func FillTestGauge(tv Gauge) { + FillTestNumberDataPointSlice(NewNumberDataPointSlice(&tv.orig.DataPoints)) +} + +func GenerateTestSum() Sum { + orig := otlpmetrics.Sum{} + tv := NewSum(&orig) + FillTestSum(tv) + return tv +} + +func FillTestSum(tv Sum) { + tv.orig.AggregationTemporality = otlpmetrics.AggregationTemporality(1) + tv.orig.IsMonotonic = true + FillTestNumberDataPointSlice(NewNumberDataPointSlice(&tv.orig.DataPoints)) +} + +func GenerateTestHistogram() Histogram { + orig := otlpmetrics.Histogram{} + tv := NewHistogram(&orig) + FillTestHistogram(tv) + return tv +} + +func FillTestHistogram(tv Histogram) { + tv.orig.AggregationTemporality = otlpmetrics.AggregationTemporality(1) + FillTestHistogramDataPointSlice(NewHistogramDataPointSlice(&tv.orig.DataPoints)) +} + +func GenerateTestExponentialHistogram() ExponentialHistogram { + orig := otlpmetrics.ExponentialHistogram{} + tv := NewExponentialHistogram(&orig) + FillTestExponentialHistogram(tv) + return tv +} + +func FillTestExponentialHistogram(tv ExponentialHistogram) { + tv.orig.AggregationTemporality = otlpmetrics.AggregationTemporality(1) + FillTestExponentialHistogramDataPointSlice(NewExponentialHistogramDataPointSlice(&tv.orig.DataPoints)) +} + +func GenerateTestSummary() Summary { + orig := otlpmetrics.Summary{} + tv := NewSummary(&orig) + FillTestSummary(tv) + return tv +} + +func FillTestSummary(tv Summary) { + FillTestSummaryDataPointSlice(NewSummaryDataPointSlice(&tv.orig.DataPoints)) +} + +func GenerateTestNumberDataPointSlice() NumberDataPointSlice { + orig := []*otlpmetrics.NumberDataPoint{} + tv := NewNumberDataPointSlice(&orig) + FillTestNumberDataPointSlice(tv) + return tv +} + +func FillTestNumberDataPointSlice(tv NumberDataPointSlice) { + *tv.orig = make([]*otlpmetrics.NumberDataPoint, 7) + for i := 0; i < 7; i++ { + (*tv.orig)[i] = &otlpmetrics.NumberDataPoint{} + FillTestNumberDataPoint(NewNumberDataPoint((*tv.orig)[i])) + } +} + +func GenerateTestNumberDataPoint() NumberDataPoint { + orig := otlpmetrics.NumberDataPoint{} + tv := NewNumberDataPoint(&orig) + FillTestNumberDataPoint(tv) + return tv +} + +func FillTestNumberDataPoint(tv NumberDataPoint) { + FillTestMap(NewMap(&tv.orig.Attributes)) + tv.orig.StartTimeUnixNano = 1234567890 + tv.orig.TimeUnixNano = 1234567890 + tv.orig.Value = &otlpmetrics.NumberDataPoint_AsDouble{AsDouble: float64(17.13)} + FillTestExemplarSlice(NewExemplarSlice(&tv.orig.Exemplars)) + tv.orig.Flags = 1 +} + +func GenerateTestHistogramDataPointSlice() HistogramDataPointSlice { + orig := []*otlpmetrics.HistogramDataPoint{} + tv := NewHistogramDataPointSlice(&orig) + FillTestHistogramDataPointSlice(tv) + return tv +} + +func FillTestHistogramDataPointSlice(tv HistogramDataPointSlice) { + *tv.orig = make([]*otlpmetrics.HistogramDataPoint, 7) + for i := 0; i < 7; i++ { + (*tv.orig)[i] = &otlpmetrics.HistogramDataPoint{} + FillTestHistogramDataPoint(NewHistogramDataPoint((*tv.orig)[i])) + } +} + +func GenerateTestHistogramDataPoint() HistogramDataPoint { + orig := otlpmetrics.HistogramDataPoint{} + tv := NewHistogramDataPoint(&orig) + FillTestHistogramDataPoint(tv) + return tv +} + +func FillTestHistogramDataPoint(tv HistogramDataPoint) { + FillTestMap(NewMap(&tv.orig.Attributes)) + tv.orig.StartTimeUnixNano = 1234567890 + tv.orig.TimeUnixNano = 1234567890 + tv.orig.Count = uint64(17) + tv.orig.Sum_ = &otlpmetrics.HistogramDataPoint_Sum{Sum: float64(17.13)} + tv.orig.BucketCounts = []uint64{1, 2, 3} + tv.orig.ExplicitBounds = []float64{1, 2, 3} + FillTestExemplarSlice(NewExemplarSlice(&tv.orig.Exemplars)) + tv.orig.Flags = 1 + tv.orig.Min_ = &otlpmetrics.HistogramDataPoint_Min{Min: float64(9.23)} + tv.orig.Max_ = &otlpmetrics.HistogramDataPoint_Max{Max: float64(182.55)} +} + +func GenerateTestExponentialHistogramDataPointSlice() ExponentialHistogramDataPointSlice { + orig := []*otlpmetrics.ExponentialHistogramDataPoint{} + tv := NewExponentialHistogramDataPointSlice(&orig) + FillTestExponentialHistogramDataPointSlice(tv) + return tv +} + +func FillTestExponentialHistogramDataPointSlice(tv ExponentialHistogramDataPointSlice) { + *tv.orig = make([]*otlpmetrics.ExponentialHistogramDataPoint, 7) + for i := 0; i < 7; i++ { + (*tv.orig)[i] = &otlpmetrics.ExponentialHistogramDataPoint{} + FillTestExponentialHistogramDataPoint(NewExponentialHistogramDataPoint((*tv.orig)[i])) + } +} + +func GenerateTestExponentialHistogramDataPoint() ExponentialHistogramDataPoint { + orig := otlpmetrics.ExponentialHistogramDataPoint{} + tv := NewExponentialHistogramDataPoint(&orig) + FillTestExponentialHistogramDataPoint(tv) + return tv +} + +func FillTestExponentialHistogramDataPoint(tv ExponentialHistogramDataPoint) { + FillTestMap(NewMap(&tv.orig.Attributes)) + tv.orig.StartTimeUnixNano = 1234567890 + tv.orig.TimeUnixNano = 1234567890 + tv.orig.Count = uint64(17) + tv.orig.Sum_ = &otlpmetrics.ExponentialHistogramDataPoint_Sum{Sum: float64(17.13)} + tv.orig.Scale = int32(4) + tv.orig.ZeroCount = uint64(201) + FillTestExponentialHistogramDataPointBuckets(NewExponentialHistogramDataPointBuckets(&tv.orig.Positive)) + FillTestExponentialHistogramDataPointBuckets(NewExponentialHistogramDataPointBuckets(&tv.orig.Negative)) + FillTestExemplarSlice(NewExemplarSlice(&tv.orig.Exemplars)) + tv.orig.Flags = 1 + tv.orig.Min_ = &otlpmetrics.ExponentialHistogramDataPoint_Min{Min: float64(9.23)} + tv.orig.Max_ = &otlpmetrics.ExponentialHistogramDataPoint_Max{Max: float64(182.55)} +} + +func GenerateTestExponentialHistogramDataPointBuckets() ExponentialHistogramDataPointBuckets { + orig := otlpmetrics.ExponentialHistogramDataPoint_Buckets{} + tv := NewExponentialHistogramDataPointBuckets(&orig) + FillTestExponentialHistogramDataPointBuckets(tv) + return tv +} + +func FillTestExponentialHistogramDataPointBuckets(tv ExponentialHistogramDataPointBuckets) { + tv.orig.Offset = int32(909) + tv.orig.BucketCounts = []uint64{1, 2, 3} +} + +func GenerateTestSummaryDataPointSlice() SummaryDataPointSlice { + orig := []*otlpmetrics.SummaryDataPoint{} + tv := NewSummaryDataPointSlice(&orig) + FillTestSummaryDataPointSlice(tv) + return tv +} + +func FillTestSummaryDataPointSlice(tv SummaryDataPointSlice) { + *tv.orig = make([]*otlpmetrics.SummaryDataPoint, 7) + for i := 0; i < 7; i++ { + (*tv.orig)[i] = &otlpmetrics.SummaryDataPoint{} + FillTestSummaryDataPoint(NewSummaryDataPoint((*tv.orig)[i])) + } +} + +func GenerateTestSummaryDataPoint() SummaryDataPoint { + orig := otlpmetrics.SummaryDataPoint{} + tv := NewSummaryDataPoint(&orig) + FillTestSummaryDataPoint(tv) + return tv +} + +func FillTestSummaryDataPoint(tv SummaryDataPoint) { + FillTestMap(NewMap(&tv.orig.Attributes)) + tv.orig.StartTimeUnixNano = 1234567890 + tv.orig.TimeUnixNano = 1234567890 + tv.orig.Count = uint64(17) + tv.orig.Sum = float64(17.13) + FillTestSummaryDataPointValueAtQuantileSlice(NewSummaryDataPointValueAtQuantileSlice(&tv.orig.QuantileValues)) + tv.orig.Flags = 1 +} + +func GenerateTestSummaryDataPointValueAtQuantileSlice() SummaryDataPointValueAtQuantileSlice { + orig := []*otlpmetrics.SummaryDataPoint_ValueAtQuantile{} + tv := NewSummaryDataPointValueAtQuantileSlice(&orig) + FillTestSummaryDataPointValueAtQuantileSlice(tv) + return tv +} + +func FillTestSummaryDataPointValueAtQuantileSlice(tv SummaryDataPointValueAtQuantileSlice) { + *tv.orig = make([]*otlpmetrics.SummaryDataPoint_ValueAtQuantile, 7) + for i := 0; i < 7; i++ { + (*tv.orig)[i] = &otlpmetrics.SummaryDataPoint_ValueAtQuantile{} + FillTestSummaryDataPointValueAtQuantile(NewSummaryDataPointValueAtQuantile((*tv.orig)[i])) + } +} + +func GenerateTestSummaryDataPointValueAtQuantile() SummaryDataPointValueAtQuantile { + orig := otlpmetrics.SummaryDataPoint_ValueAtQuantile{} + tv := NewSummaryDataPointValueAtQuantile(&orig) + FillTestSummaryDataPointValueAtQuantile(tv) + return tv +} + +func FillTestSummaryDataPointValueAtQuantile(tv SummaryDataPointValueAtQuantile) { + tv.orig.Quantile = float64(17.13) + tv.orig.Value = float64(17.13) +} + +func GenerateTestExemplarSlice() ExemplarSlice { + orig := []otlpmetrics.Exemplar{} + tv := NewExemplarSlice(&orig) + FillTestExemplarSlice(tv) + return tv +} + +func FillTestExemplarSlice(tv ExemplarSlice) { + *tv.orig = make([]otlpmetrics.Exemplar, 7) + for i := 0; i < 7; i++ { + FillTestExemplar(NewExemplar(&(*tv.orig)[i])) + } +} + +func GenerateTestExemplar() Exemplar { + orig := otlpmetrics.Exemplar{} + tv := NewExemplar(&orig) + FillTestExemplar(tv) + return tv +} + +func FillTestExemplar(tv Exemplar) { + tv.orig.TimeUnixNano = 1234567890 + tv.orig.Value = &otlpmetrics.Exemplar_AsInt{AsInt: int64(17)} + FillTestMap(NewMap(&tv.orig.FilteredAttributes)) + tv.orig.TraceId = data.TraceID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1}) + tv.orig.SpanId = data.SpanID([8]byte{8, 7, 6, 5, 4, 3, 2, 1}) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_metrics_otlp.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_metrics_otlp.go new file mode 100644 index 00000000000..7256ee8d6ee --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_metrics_otlp.go @@ -0,0 +1,46 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". + +package internal + +import ( + otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1" +) + +type MetricsExportPartialSuccess struct { + orig *otlpcollectormetrics.ExportMetricsPartialSuccess +} + +func GetOrigMetricsExportPartialSuccess(ms MetricsExportPartialSuccess) *otlpcollectormetrics.ExportMetricsPartialSuccess { + return ms.orig +} + +func NewMetricsExportPartialSuccess(orig *otlpcollectormetrics.ExportMetricsPartialSuccess) MetricsExportPartialSuccess { + return MetricsExportPartialSuccess{orig: orig} +} + +func GenerateTestMetricsExportPartialSuccess() MetricsExportPartialSuccess { + orig := otlpcollectormetrics.ExportMetricsPartialSuccess{} + tv := NewMetricsExportPartialSuccess(&orig) + FillTestMetricsExportPartialSuccess(tv) + return tv +} + +func FillTestMetricsExportPartialSuccess(tv MetricsExportPartialSuccess) { + tv.orig.RejectedDataPoints = int64(13) + tv.orig.ErrorMessage = "error message" +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_primitive_slice.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_primitive_slice.go new file mode 100644 index 00000000000..7274a94c764 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_primitive_slice.go @@ -0,0 +1,54 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". + +package internal + +type ByteSlice struct { + orig *[]byte +} + +func GetOrigByteSlice(ms ByteSlice) *[]byte { + return ms.orig +} + +func NewByteSlice(orig *[]byte) ByteSlice { + return ByteSlice{orig: orig} +} + +type Float64Slice struct { + orig *[]float64 +} + +func GetOrigFloat64Slice(ms Float64Slice) *[]float64 { + return ms.orig +} + +func NewFloat64Slice(orig *[]float64) Float64Slice { + return Float64Slice{orig: orig} +} + +type UInt64Slice struct { + orig *[]uint64 +} + +func GetOrigUInt64Slice(ms UInt64Slice) *[]uint64 { + return ms.orig +} + +func NewUInt64Slice(orig *[]uint64) UInt64Slice { + return UInt64Slice{orig: orig} +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_resource_alias.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_resource.go similarity index 55% rename from vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_resource_alias.go rename to vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_resource.go index 3c10716d16e..96119dc6a60 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_resource_alias.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_resource.go @@ -15,18 +15,32 @@ // Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". -package pcommon +package internal -import "go.opentelemetry.io/collector/pdata/internal" +import ( + otlpresource "go.opentelemetry.io/collector/pdata/internal/data/protogen/resource/v1" +) -// Resource is a message representing the resource information. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewResource function to create new instances. -// Important: zero-initialized instance is not valid for use. -type Resource = internal.Resource +type Resource struct { + orig *otlpresource.Resource +} + +func GetOrigResource(ms Resource) *otlpresource.Resource { + return ms.orig +} + +func NewResource(orig *otlpresource.Resource) Resource { + return Resource{orig: orig} +} + +func GenerateTestResource() Resource { + orig := otlpresource.Resource{} + tv := NewResource(&orig) + FillTestResource(tv) + return tv +} -// NewResource is an alias for a function to create a new empty Resource. -var NewResource = internal.NewResource +func FillTestResource(tv Resource) { + FillTestMap(NewMap(&tv.orig.Attributes)) + tv.orig.DroppedAttributesCount = uint32(17) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_traces.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_traces.go new file mode 100644 index 00000000000..38d7e69d117 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_traces.go @@ -0,0 +1,322 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". + +package internal + +import ( + "go.opentelemetry.io/collector/pdata/internal/data" + otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" +) + +type ResourceSpansSlice struct { + orig *[]*otlptrace.ResourceSpans +} + +func GetOrigResourceSpansSlice(ms ResourceSpansSlice) *[]*otlptrace.ResourceSpans { + return ms.orig +} + +func NewResourceSpansSlice(orig *[]*otlptrace.ResourceSpans) ResourceSpansSlice { + return ResourceSpansSlice{orig: orig} +} + +type ResourceSpans struct { + orig *otlptrace.ResourceSpans +} + +func GetOrigResourceSpans(ms ResourceSpans) *otlptrace.ResourceSpans { + return ms.orig +} + +func NewResourceSpans(orig *otlptrace.ResourceSpans) ResourceSpans { + return ResourceSpans{orig: orig} +} + +type ScopeSpansSlice struct { + orig *[]*otlptrace.ScopeSpans +} + +func GetOrigScopeSpansSlice(ms ScopeSpansSlice) *[]*otlptrace.ScopeSpans { + return ms.orig +} + +func NewScopeSpansSlice(orig *[]*otlptrace.ScopeSpans) ScopeSpansSlice { + return ScopeSpansSlice{orig: orig} +} + +type ScopeSpans struct { + orig *otlptrace.ScopeSpans +} + +func GetOrigScopeSpans(ms ScopeSpans) *otlptrace.ScopeSpans { + return ms.orig +} + +func NewScopeSpans(orig *otlptrace.ScopeSpans) ScopeSpans { + return ScopeSpans{orig: orig} +} + +type SpanSlice struct { + orig *[]*otlptrace.Span +} + +func GetOrigSpanSlice(ms SpanSlice) *[]*otlptrace.Span { + return ms.orig +} + +func NewSpanSlice(orig *[]*otlptrace.Span) SpanSlice { + return SpanSlice{orig: orig} +} + +type Span struct { + orig *otlptrace.Span +} + +func GetOrigSpan(ms Span) *otlptrace.Span { + return ms.orig +} + +func NewSpan(orig *otlptrace.Span) Span { + return Span{orig: orig} +} + +type SpanEventSlice struct { + orig *[]*otlptrace.Span_Event +} + +func GetOrigSpanEventSlice(ms SpanEventSlice) *[]*otlptrace.Span_Event { + return ms.orig +} + +func NewSpanEventSlice(orig *[]*otlptrace.Span_Event) SpanEventSlice { + return SpanEventSlice{orig: orig} +} + +type SpanEvent struct { + orig *otlptrace.Span_Event +} + +func GetOrigSpanEvent(ms SpanEvent) *otlptrace.Span_Event { + return ms.orig +} + +func NewSpanEvent(orig *otlptrace.Span_Event) SpanEvent { + return SpanEvent{orig: orig} +} + +type SpanLinkSlice struct { + orig *[]*otlptrace.Span_Link +} + +func GetOrigSpanLinkSlice(ms SpanLinkSlice) *[]*otlptrace.Span_Link { + return ms.orig +} + +func NewSpanLinkSlice(orig *[]*otlptrace.Span_Link) SpanLinkSlice { + return SpanLinkSlice{orig: orig} +} + +type SpanLink struct { + orig *otlptrace.Span_Link +} + +func GetOrigSpanLink(ms SpanLink) *otlptrace.Span_Link { + return ms.orig +} + +func NewSpanLink(orig *otlptrace.Span_Link) SpanLink { + return SpanLink{orig: orig} +} + +type Status struct { + orig *otlptrace.Status +} + +func GetOrigStatus(ms Status) *otlptrace.Status { + return ms.orig +} + +func NewStatus(orig *otlptrace.Status) Status { + return Status{orig: orig} +} + +func GenerateTestResourceSpansSlice() ResourceSpansSlice { + orig := []*otlptrace.ResourceSpans{} + tv := NewResourceSpansSlice(&orig) + FillTestResourceSpansSlice(tv) + return tv +} + +func FillTestResourceSpansSlice(tv ResourceSpansSlice) { + *tv.orig = make([]*otlptrace.ResourceSpans, 7) + for i := 0; i < 7; i++ { + (*tv.orig)[i] = &otlptrace.ResourceSpans{} + FillTestResourceSpans(NewResourceSpans((*tv.orig)[i])) + } +} + +func GenerateTestResourceSpans() ResourceSpans { + orig := otlptrace.ResourceSpans{} + tv := NewResourceSpans(&orig) + FillTestResourceSpans(tv) + return tv +} + +func FillTestResourceSpans(tv ResourceSpans) { + FillTestResource(NewResource(&tv.orig.Resource)) + tv.orig.SchemaUrl = "https://opentelemetry.io/schemas/1.5.0" + FillTestScopeSpansSlice(NewScopeSpansSlice(&tv.orig.ScopeSpans)) +} + +func GenerateTestScopeSpansSlice() ScopeSpansSlice { + orig := []*otlptrace.ScopeSpans{} + tv := NewScopeSpansSlice(&orig) + FillTestScopeSpansSlice(tv) + return tv +} + +func FillTestScopeSpansSlice(tv ScopeSpansSlice) { + *tv.orig = make([]*otlptrace.ScopeSpans, 7) + for i := 0; i < 7; i++ { + (*tv.orig)[i] = &otlptrace.ScopeSpans{} + FillTestScopeSpans(NewScopeSpans((*tv.orig)[i])) + } +} + +func GenerateTestScopeSpans() ScopeSpans { + orig := otlptrace.ScopeSpans{} + tv := NewScopeSpans(&orig) + FillTestScopeSpans(tv) + return tv +} + +func FillTestScopeSpans(tv ScopeSpans) { + FillTestInstrumentationScope(NewInstrumentationScope(&tv.orig.Scope)) + tv.orig.SchemaUrl = "https://opentelemetry.io/schemas/1.5.0" + FillTestSpanSlice(NewSpanSlice(&tv.orig.Spans)) +} + +func GenerateTestSpanSlice() SpanSlice { + orig := []*otlptrace.Span{} + tv := NewSpanSlice(&orig) + FillTestSpanSlice(tv) + return tv +} + +func FillTestSpanSlice(tv SpanSlice) { + *tv.orig = make([]*otlptrace.Span, 7) + for i := 0; i < 7; i++ { + (*tv.orig)[i] = &otlptrace.Span{} + FillTestSpan(NewSpan((*tv.orig)[i])) + } +} + +func GenerateTestSpan() Span { + orig := otlptrace.Span{} + tv := NewSpan(&orig) + FillTestSpan(tv) + return tv +} + +func FillTestSpan(tv Span) { + tv.orig.TraceId = data.TraceID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1}) + tv.orig.SpanId = data.SpanID([8]byte{8, 7, 6, 5, 4, 3, 2, 1}) + FillTestTraceState(NewTraceState(&tv.orig.TraceState)) + tv.orig.ParentSpanId = data.SpanID([8]byte{8, 7, 6, 5, 4, 3, 2, 1}) + tv.orig.Name = "test_name" + tv.orig.Kind = otlptrace.Span_SpanKind(3) + tv.orig.StartTimeUnixNano = 1234567890 + tv.orig.EndTimeUnixNano = 1234567890 + FillTestMap(NewMap(&tv.orig.Attributes)) + tv.orig.DroppedAttributesCount = uint32(17) + FillTestSpanEventSlice(NewSpanEventSlice(&tv.orig.Events)) + tv.orig.DroppedEventsCount = uint32(17) + FillTestSpanLinkSlice(NewSpanLinkSlice(&tv.orig.Links)) + tv.orig.DroppedLinksCount = uint32(17) + FillTestStatus(NewStatus(&tv.orig.Status)) +} + +func GenerateTestSpanEventSlice() SpanEventSlice { + orig := []*otlptrace.Span_Event{} + tv := NewSpanEventSlice(&orig) + FillTestSpanEventSlice(tv) + return tv +} + +func FillTestSpanEventSlice(tv SpanEventSlice) { + *tv.orig = make([]*otlptrace.Span_Event, 7) + for i := 0; i < 7; i++ { + (*tv.orig)[i] = &otlptrace.Span_Event{} + FillTestSpanEvent(NewSpanEvent((*tv.orig)[i])) + } +} + +func GenerateTestSpanEvent() SpanEvent { + orig := otlptrace.Span_Event{} + tv := NewSpanEvent(&orig) + FillTestSpanEvent(tv) + return tv +} + +func FillTestSpanEvent(tv SpanEvent) { + tv.orig.TimeUnixNano = 1234567890 + tv.orig.Name = "test_name" + FillTestMap(NewMap(&tv.orig.Attributes)) + tv.orig.DroppedAttributesCount = uint32(17) +} + +func GenerateTestSpanLinkSlice() SpanLinkSlice { + orig := []*otlptrace.Span_Link{} + tv := NewSpanLinkSlice(&orig) + FillTestSpanLinkSlice(tv) + return tv +} + +func FillTestSpanLinkSlice(tv SpanLinkSlice) { + *tv.orig = make([]*otlptrace.Span_Link, 7) + for i := 0; i < 7; i++ { + (*tv.orig)[i] = &otlptrace.Span_Link{} + FillTestSpanLink(NewSpanLink((*tv.orig)[i])) + } +} + +func GenerateTestSpanLink() SpanLink { + orig := otlptrace.Span_Link{} + tv := NewSpanLink(&orig) + FillTestSpanLink(tv) + return tv +} + +func FillTestSpanLink(tv SpanLink) { + tv.orig.TraceId = data.TraceID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1}) + tv.orig.SpanId = data.SpanID([8]byte{8, 7, 6, 5, 4, 3, 2, 1}) + FillTestTraceState(NewTraceState(&tv.orig.TraceState)) + FillTestMap(NewMap(&tv.orig.Attributes)) + tv.orig.DroppedAttributesCount = uint32(17) +} + +func GenerateTestStatus() Status { + orig := otlptrace.Status{} + tv := NewStatus(&orig) + FillTestStatus(tv) + return tv +} + +func FillTestStatus(tv Status) { + tv.orig.Code = 1 + tv.orig.Message = "cancelled" +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_traces_otlp.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_traces_otlp.go new file mode 100644 index 00000000000..1949149976a --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_traces_otlp.go @@ -0,0 +1,46 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". + +package internal + +import ( + otlpcollectortrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1" +) + +type TracesExportPartialSuccess struct { + orig *otlpcollectortrace.ExportTracePartialSuccess +} + +func GetOrigTracesExportPartialSuccess(ms TracesExportPartialSuccess) *otlpcollectortrace.ExportTracePartialSuccess { + return ms.orig +} + +func NewTracesExportPartialSuccess(orig *otlpcollectortrace.ExportTracePartialSuccess) TracesExportPartialSuccess { + return TracesExportPartialSuccess{orig: orig} +} + +func GenerateTestTracesExportPartialSuccess() TracesExportPartialSuccess { + orig := otlpcollectortrace.ExportTracePartialSuccess{} + tv := NewTracesExportPartialSuccess(&orig) + FillTestTracesExportPartialSuccess(tv) + return tv +} + +func FillTestTracesExportPartialSuccess(tv TracesExportPartialSuccess) { + tv.orig.RejectedSpans = int64(13) + tv.orig.ErrorMessage = "error message" +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/json/attribute.go b/vendor/go.opentelemetry.io/collector/pdata/internal/json/attribute.go new file mode 100644 index 00000000000..c4c80502f28 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/json/attribute.go @@ -0,0 +1,121 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package json // import "go.opentelemetry.io/collector/pdata/internal/json" + +import ( + "encoding/base64" + "fmt" + + jsoniter "github.com/json-iterator/go" + + otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" +) + +// ReadAttribute Unmarshal JSON data and return otlpcommon.KeyValue +func ReadAttribute(iter *jsoniter.Iterator) otlpcommon.KeyValue { + kv := otlpcommon.KeyValue{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "key": + kv.Key = iter.ReadString() + case "value": + ReadValue(iter, &kv.Value) + default: + iter.Skip() + } + return true + }) + return kv +} + +// ReadValue Unmarshal JSON data and return otlpcommon.AnyValue +func ReadValue(iter *jsoniter.Iterator, val *otlpcommon.AnyValue) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "stringValue", "string_value": + val.Value = &otlpcommon.AnyValue_StringValue{ + StringValue: iter.ReadString(), + } + + case "boolValue", "bool_value": + val.Value = &otlpcommon.AnyValue_BoolValue{ + BoolValue: iter.ReadBool(), + } + case "intValue", "int_value": + val.Value = &otlpcommon.AnyValue_IntValue{ + IntValue: ReadInt64(iter), + } + case "doubleValue", "double_value": + val.Value = &otlpcommon.AnyValue_DoubleValue{ + DoubleValue: ReadFloat64(iter), + } + case "bytesValue", "bytes_value": + v, err := base64.StdEncoding.DecodeString(iter.ReadString()) + if err != nil { + iter.ReportError("bytesValue", fmt.Sprintf("base64 decode:%v", err)) + break + } + val.Value = &otlpcommon.AnyValue_BytesValue{ + BytesValue: v, + } + case "arrayValue", "array_value": + val.Value = &otlpcommon.AnyValue_ArrayValue{ + ArrayValue: readArray(iter), + } + case "kvlistValue", "kvlist_value": + val.Value = &otlpcommon.AnyValue_KvlistValue{ + KvlistValue: readKvlistValue(iter), + } + default: + iter.Skip() + } + return true + }) +} + +func readArray(iter *jsoniter.Iterator) *otlpcommon.ArrayValue { + v := &otlpcommon.ArrayValue{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "values": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + v.Values = append(v.Values, otlpcommon.AnyValue{}) + ReadValue(iter, &v.Values[len(v.Values)-1]) + return true + }) + default: + iter.Skip() + } + return true + }) + return v +} + +func readKvlistValue(iter *jsoniter.Iterator) *otlpcommon.KeyValueList { + v := &otlpcommon.KeyValueList{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "values": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + v.Values = append(v.Values, ReadAttribute(iter)) + return true + }) + default: + iter.Skip() + } + return true + }) + return v +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/json/enum.go b/vendor/go.opentelemetry.io/collector/pdata/internal/json/enum.go new file mode 100644 index 00000000000..160bc5fb51e --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/json/enum.go @@ -0,0 +1,40 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package json // import "go.opentelemetry.io/collector/pdata/internal/json" + +import ( + jsoniter "github.com/json-iterator/go" +) + +// ReadEnumValue returns the enum integer value representation. Accepts both enum names and enum integer values. +// See https://developers.google.com/protocol-buffers/docs/proto3#json. +func ReadEnumValue(iter *jsoniter.Iterator, valueMap map[string]int32) int32 { + switch iter.WhatIsNext() { + case jsoniter.NumberValue: + return iter.ReadInt32() + case jsoniter.StringValue: + val, ok := valueMap[iter.ReadString()] + // Same behavior with official protbuf JSON decoder, + // see https://github.com/open-telemetry/opentelemetry-proto-go/pull/81 + if !ok { + iter.ReportError("ReadEnumValue", "unknown string value") + return 0 + } + return val + default: + iter.ReportError("ReadEnumValue", "unsupported value type") + return 0 + } +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/json/number.go b/vendor/go.opentelemetry.io/collector/pdata/internal/json/number.go new file mode 100644 index 00000000000..c58d5d6100a --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/json/number.go @@ -0,0 +1,114 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package json // import "go.opentelemetry.io/collector/pdata/internal/json" + +import ( + "strconv" + + jsoniter "github.com/json-iterator/go" +) + +// ReadInt32 unmarshalls JSON data into an int32. Accepts both numbers and strings decimal. +// See https://developers.google.com/protocol-buffers/docs/proto3#json. +func ReadInt32(iter *jsoniter.Iterator) int32 { + switch iter.WhatIsNext() { + case jsoniter.NumberValue: + return iter.ReadInt32() + case jsoniter.StringValue: + val, err := strconv.ParseInt(iter.ReadString(), 10, 32) + if err != nil { + iter.ReportError("ReadInt32", err.Error()) + return 0 + } + return int32(val) + default: + iter.ReportError("ReadInt32", "unsupported value type") + return 0 + } +} + +// ReadUint32 unmarshalls JSON data into an uint32. Accepts both numbers and strings decimal. +// See https://developers.google.com/protocol-buffers/docs/proto3#json. +func ReadUint32(iter *jsoniter.Iterator) uint32 { + switch iter.WhatIsNext() { + case jsoniter.NumberValue: + return iter.ReadUint32() + case jsoniter.StringValue: + val, err := strconv.ParseUint(iter.ReadString(), 10, 32) + if err != nil { + iter.ReportError("ReadUint32", err.Error()) + return 0 + } + return uint32(val) + default: + iter.ReportError("ReadUint32", "unsupported value type") + return 0 + } +} + +// ReadInt64 unmarshalls JSON data into an int64. Accepts both numbers and strings decimal. +// See https://developers.google.com/protocol-buffers/docs/proto3#json. +func ReadInt64(iter *jsoniter.Iterator) int64 { + switch iter.WhatIsNext() { + case jsoniter.NumberValue: + return iter.ReadInt64() + case jsoniter.StringValue: + val, err := strconv.ParseInt(iter.ReadString(), 10, 64) + if err != nil { + iter.ReportError("ReadInt64", err.Error()) + return 0 + } + return val + default: + iter.ReportError("ReadInt64", "unsupported value type") + return 0 + } +} + +// ReadUint64 unmarshalls JSON data into an uint64. Accepts both numbers and strings decimal. +// See https://developers.google.com/protocol-buffers/docs/proto3#json. +func ReadUint64(iter *jsoniter.Iterator) uint64 { + switch iter.WhatIsNext() { + case jsoniter.NumberValue: + return iter.ReadUint64() + case jsoniter.StringValue: + val, err := strconv.ParseUint(iter.ReadString(), 10, 64) + if err != nil { + iter.ReportError("ReadUint64", err.Error()) + return 0 + } + return val + default: + iter.ReportError("ReadUint64", "unsupported value type") + return 0 + } +} + +func ReadFloat64(iter *jsoniter.Iterator) float64 { + switch iter.WhatIsNext() { + case jsoniter.NumberValue: + return iter.ReadFloat64() + case jsoniter.StringValue: + val, err := strconv.ParseFloat(iter.ReadString(), 64) + if err != nil { + iter.ReportError("ReadUint64", err.Error()) + return 0 + } + return val + default: + iter.ReportError("ReadUint64", "unsupported value type") + return 0 + } +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/json/resource.go b/vendor/go.opentelemetry.io/collector/pdata/internal/json/resource.go new file mode 100644 index 00000000000..3abe43fd23a --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/json/resource.go @@ -0,0 +1,38 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package json // import "go.opentelemetry.io/collector/pdata/internal/json" + +import ( + jsoniter "github.com/json-iterator/go" + + otlpresource "go.opentelemetry.io/collector/pdata/internal/data/protogen/resource/v1" +) + +func ReadResource(iter *jsoniter.Iterator, resource *otlpresource.Resource) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "attributes": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + resource.Attributes = append(resource.Attributes, ReadAttribute(iter)) + return true + }) + case "droppedAttributesCount", "dropped_attributes_count": + resource.DroppedAttributesCount = ReadUint32(iter) + default: + iter.Skip() + } + return true + }) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/json/scope.go b/vendor/go.opentelemetry.io/collector/pdata/internal/json/scope.go new file mode 100644 index 00000000000..c978d86a5aa --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/json/scope.go @@ -0,0 +1,42 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package json // import "go.opentelemetry.io/collector/pdata/internal/json" + +import ( + jsoniter "github.com/json-iterator/go" + + otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" +) + +func ReadScope(iter *jsoniter.Iterator, scope *otlpcommon.InstrumentationScope) { + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "name": + scope.Name = iter.ReadString() + case "version": + scope.Version = iter.ReadString() + case "attributes": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + scope.Attributes = append(scope.Attributes, ReadAttribute(iter)) + return true + }) + case "droppedAttributesCount", "dropped_attributes_count": + scope.DroppedAttributesCount = ReadUint32(iter) + default: + iter.Skip() + } + return true + }) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/logs.go b/vendor/go.opentelemetry.io/collector/pdata/internal/logs.go deleted file mode 100644 index 709e512152f..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/logs.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -package internal // import "go.opentelemetry.io/collector/pdata/internal" - -import ( - otlpcollectorlog "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1" - otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" -) - -// LogsToOtlp internal helper to convert Logs to otlp request representation. -func LogsToOtlp(mw Logs) *otlpcollectorlog.ExportLogsServiceRequest { - return mw.orig -} - -// LogsFromOtlp internal helper to convert otlp request representation to Logs. -func LogsFromOtlp(orig *otlpcollectorlog.ExportLogsServiceRequest) Logs { - return Logs{orig: orig} -} - -// LogsToProto internal helper to convert Logs to protobuf representation. -func LogsToProto(l Logs) otlplogs.LogsData { - return otlplogs.LogsData{ - ResourceLogs: l.orig.ResourceLogs, - } -} - -// LogsFromProto internal helper to convert protobuf representation to Logs. -func LogsFromProto(orig otlplogs.LogsData) Logs { - return Logs{orig: &otlpcollectorlog.ExportLogsServiceRequest{ - ResourceLogs: orig.ResourceLogs, - }} -} - -// Logs is the top-level struct that is propagated through the logs pipeline. -// Use NewLogs to create new instance, zero-initialized instance is not valid for use. -type Logs struct { - orig *otlpcollectorlog.ExportLogsServiceRequest -} - -// NewLogs creates a new Logs struct. -func NewLogs() Logs { - return Logs{orig: &otlpcollectorlog.ExportLogsServiceRequest{}} -} - -// MoveTo moves all properties from the current struct to dest -// resetting the current instance to its zero value. -func (ld Logs) MoveTo(dest Logs) { - *dest.orig = *ld.orig - *ld.orig = otlpcollectorlog.ExportLogsServiceRequest{} -} - -// Clone returns a copy of Logs. -func (ld Logs) Clone() Logs { - cloneLd := NewLogs() - ld.ResourceLogs().CopyTo(cloneLd.ResourceLogs()) - return cloneLd -} - -// LogRecordCount calculates the total number of log records. -func (ld Logs) LogRecordCount() int { - logCount := 0 - rss := ld.ResourceLogs() - for i := 0; i < rss.Len(); i++ { - rs := rss.At(i) - ill := rs.ScopeLogs() - for i := 0; i < ill.Len(); i++ { - logs := ill.At(i) - logCount += logs.LogRecords().Len() - } - } - return logCount -} - -// ResourceLogs returns the ResourceLogsSlice associated with this Logs. -func (ld Logs) ResourceLogs() ResourceLogsSlice { - return newResourceLogsSlice(&ld.orig.ResourceLogs) -} - -// SeverityNumber represents severity number of a log record. -type SeverityNumber int32 - -const ( - SeverityNumberUNDEFINED = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_UNSPECIFIED) - SeverityNumberTRACE = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_TRACE) - SeverityNumberTRACE2 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_TRACE2) - SeverityNumberTRACE3 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_TRACE3) - SeverityNumberTRACE4 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_TRACE4) - SeverityNumberDEBUG = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_DEBUG) - SeverityNumberDEBUG2 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_DEBUG2) - SeverityNumberDEBUG3 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_DEBUG3) - SeverityNumberDEBUG4 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_DEBUG4) - SeverityNumberINFO = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_INFO) - SeverityNumberINFO2 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_INFO2) - SeverityNumberINFO3 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_INFO3) - SeverityNumberINFO4 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_INFO4) - SeverityNumberWARN = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_WARN) - SeverityNumberWARN2 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_WARN2) - SeverityNumberWARN3 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_WARN3) - SeverityNumberWARN4 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_WARN4) - SeverityNumberERROR = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_ERROR) - SeverityNumberERROR2 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_ERROR2) - SeverityNumberERROR3 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_ERROR3) - SeverityNumberERROR4 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_ERROR4) - SeverityNumberFATAL = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL) - SeverityNumberFATAL2 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL2) - SeverityNumberFATAL3 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL3) - SeverityNumberFATAL4 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL4) -) - -// String returns the string representation of the SeverityNumber. -func (sn SeverityNumber) String() string { return otlplogs.SeverityNumber(sn).String() } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/metrics.go b/vendor/go.opentelemetry.io/collector/pdata/internal/metrics.go deleted file mode 100644 index 8aeedbb2eba..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/metrics.go +++ /dev/null @@ -1,390 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -package internal // import "go.opentelemetry.io/collector/pdata/internal" - -import ( - otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1" - otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" -) - -// MetricsToOtlp internal helper to convert Metrics to otlp request representation. -func MetricsToOtlp(mw Metrics) *otlpcollectormetrics.ExportMetricsServiceRequest { - return mw.orig -} - -// MetricsFromOtlp internal helper to convert otlp request representation to Metrics. -func MetricsFromOtlp(orig *otlpcollectormetrics.ExportMetricsServiceRequest) Metrics { - return Metrics{orig: orig} -} - -// MetricsToProto internal helper to convert Metrics to protobuf representation. -func MetricsToProto(l Metrics) otlpmetrics.MetricsData { - return otlpmetrics.MetricsData{ - ResourceMetrics: l.orig.ResourceMetrics, - } -} - -// MetricsFromProto internal helper to convert protobuf representation to Metrics. -func MetricsFromProto(orig otlpmetrics.MetricsData) Metrics { - return Metrics{orig: &otlpcollectormetrics.ExportMetricsServiceRequest{ - ResourceMetrics: orig.ResourceMetrics, - }} -} - -// Metrics is the top-level struct that is propagated through the metrics pipeline. -// Use NewMetrics to create new instance, zero-initialized instance is not valid for use. -type Metrics struct { - orig *otlpcollectormetrics.ExportMetricsServiceRequest -} - -// NewMetrics creates a new Metrics struct. -func NewMetrics() Metrics { - return Metrics{orig: &otlpcollectormetrics.ExportMetricsServiceRequest{}} -} - -// Clone returns a copy of MetricData. -func (md Metrics) Clone() Metrics { - cloneMd := NewMetrics() - md.ResourceMetrics().CopyTo(cloneMd.ResourceMetrics()) - return cloneMd -} - -// MoveTo moves all properties from the current struct to dest -// resetting the current instance to its zero value. -func (md Metrics) MoveTo(dest Metrics) { - *dest.orig = *md.orig - *md.orig = otlpcollectormetrics.ExportMetricsServiceRequest{} -} - -// ResourceMetrics returns the ResourceMetricsSlice associated with this Metrics. -func (md Metrics) ResourceMetrics() ResourceMetricsSlice { - return newResourceMetricsSlice(&md.orig.ResourceMetrics) -} - -// MetricCount calculates the total number of metrics. -func (md Metrics) MetricCount() int { - metricCount := 0 - rms := md.ResourceMetrics() - for i := 0; i < rms.Len(); i++ { - rm := rms.At(i) - ilms := rm.ScopeMetrics() - for j := 0; j < ilms.Len(); j++ { - ilm := ilms.At(j) - metricCount += ilm.Metrics().Len() - } - } - return metricCount -} - -// DataPointCount calculates the total number of data points. -func (md Metrics) DataPointCount() (dataPointCount int) { - rms := md.ResourceMetrics() - for i := 0; i < rms.Len(); i++ { - rm := rms.At(i) - ilms := rm.ScopeMetrics() - for j := 0; j < ilms.Len(); j++ { - ilm := ilms.At(j) - ms := ilm.Metrics() - for k := 0; k < ms.Len(); k++ { - m := ms.At(k) - switch m.DataType() { - case MetricDataTypeGauge: - dataPointCount += m.Gauge().DataPoints().Len() - case MetricDataTypeSum: - dataPointCount += m.Sum().DataPoints().Len() - case MetricDataTypeHistogram: - dataPointCount += m.Histogram().DataPoints().Len() - case MetricDataTypeExponentialHistogram: - dataPointCount += m.ExponentialHistogram().DataPoints().Len() - case MetricDataTypeSummary: - dataPointCount += m.Summary().DataPoints().Len() - } - } - } - } - return -} - -// MetricDataType specifies the type of data in a Metric. -type MetricDataType int32 - -const ( - MetricDataTypeNone MetricDataType = iota - MetricDataTypeGauge - MetricDataTypeSum - MetricDataTypeHistogram - MetricDataTypeExponentialHistogram - MetricDataTypeSummary -) - -// String returns the string representation of the MetricDataType. -func (mdt MetricDataType) String() string { - switch mdt { - case MetricDataTypeNone: - return "None" - case MetricDataTypeGauge: - return "Gauge" - case MetricDataTypeSum: - return "Sum" - case MetricDataTypeHistogram: - return "Histogram" - case MetricDataTypeExponentialHistogram: - return "ExponentialHistogram" - case MetricDataTypeSummary: - return "Summary" - } - return "" -} - -// SetDataType clears any existing data and initialize it with an empty data of the given type. -// Calling this function on zero-initialized Metric will cause a panic. -func (ms Metric) SetDataType(ty MetricDataType) { - switch ty { - case MetricDataTypeGauge: - ms.orig.Data = &otlpmetrics.Metric_Gauge{Gauge: &otlpmetrics.Gauge{}} - case MetricDataTypeSum: - ms.orig.Data = &otlpmetrics.Metric_Sum{Sum: &otlpmetrics.Sum{}} - case MetricDataTypeHistogram: - ms.orig.Data = &otlpmetrics.Metric_Histogram{Histogram: &otlpmetrics.Histogram{}} - case MetricDataTypeExponentialHistogram: - ms.orig.Data = &otlpmetrics.Metric_ExponentialHistogram{ExponentialHistogram: &otlpmetrics.ExponentialHistogram{}} - case MetricDataTypeSummary: - ms.orig.Data = &otlpmetrics.Metric_Summary{Summary: &otlpmetrics.Summary{}} - } -} - -// MetricAggregationTemporality defines how a metric aggregator reports aggregated values. -// It describes how those values relate to the time interval over which they are aggregated. -type MetricAggregationTemporality int32 - -const ( - // MetricAggregationTemporalityUnspecified is the default MetricAggregationTemporality, it MUST NOT be used. - MetricAggregationTemporalityUnspecified = MetricAggregationTemporality(otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED) - // MetricAggregationTemporalityDelta is a MetricAggregationTemporality for a metric aggregator which reports changes since last report time. - MetricAggregationTemporalityDelta = MetricAggregationTemporality(otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_DELTA) - // MetricAggregationTemporalityCumulative is a MetricAggregationTemporality for a metric aggregator which reports changes since a fixed start time. - MetricAggregationTemporalityCumulative = MetricAggregationTemporality(otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE) -) - -// String returns the string representation of the MetricAggregationTemporality. -func (at MetricAggregationTemporality) String() string { - return otlpmetrics.AggregationTemporality(at).String() -} - -// Flags returns the flags associated with this NumberDataPoint. -// Deprecated: [v0.57.0] Use FlagsStruct instead. -func (ms NumberDataPoint) Flags() MetricDataPointFlags { - return MetricDataPointFlags(ms.orig.Flags) -} - -// SetFlags replaces the flags associated with this NumberDataPoint. -// Deprecated: [v0.57.0] Use FlagsStruct instead. -func (ms NumberDataPoint) SetFlags(v MetricDataPointFlags) { - ms.orig.Flags = uint32(v) -} - -// Flags returns the flags associated with this HistogramDataPoint. -// Deprecated: [v0.57.0] Use FlagsStruct instead. -func (ms HistogramDataPoint) Flags() MetricDataPointFlags { - return MetricDataPointFlags(ms.orig.Flags) -} - -// SetFlags replaces the flags associated with this HistogramDataPoint. -// Deprecated: [v0.57.0] Use FlagsStruct instead. -func (ms HistogramDataPoint) SetFlags(v MetricDataPointFlags) { - ms.orig.Flags = uint32(v) -} - -// Flags returns the flags associated with this ExponentialHistogramDataPoint. -// Deprecated: [v0.57.0] Use FlagsStruct instead. -func (ms ExponentialHistogramDataPoint) Flags() MetricDataPointFlags { - return MetricDataPointFlags(ms.orig.Flags) -} - -// SetFlags replaces the flags associated with this ExponentialHistogramDataPoint. -// Deprecated: [v0.57.0] Use FlagsStruct instead. -func (ms ExponentialHistogramDataPoint) SetFlags(v MetricDataPointFlags) { - ms.orig.Flags = uint32(v) -} - -// Flags returns the flags associated with this SummaryDataPoint. -// Deprecated: [v0.57.0] Use FlagsStruct instead. -func (ms SummaryDataPoint) Flags() MetricDataPointFlags { - return MetricDataPointFlags(ms.orig.Flags) -} - -// SetFlags replaces the flags associated with this SummaryDataPoint. -// Deprecated: [v0.57.0] Use FlagsStruct instead. -func (ms SummaryDataPoint) SetFlags(v MetricDataPointFlags) { - ms.orig.Flags = uint32(v) -} - -// MetricDataPointFlagsStruct defines how a metric aggregator reports aggregated values. -// It describes how those values relate to the time interval over which they are aggregated. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewMetricDataPointFlagsStruct function to create new instances. -// Important: zero-initialized instance is not valid for use. -type MetricDataPointFlagsStruct struct { - orig *uint32 -} - -func newMetricDataPointFlagsStruct(orig *uint32) MetricDataPointFlagsStruct { - return MetricDataPointFlagsStruct{orig: orig} -} - -// NewMetricDataPointFlagsStruct creates a new empty MetricDataPointFlagsStruct. -// -// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, -// OR directly access the member if this is embedded in another struct. -func NewMetricDataPointFlagsStruct() MetricDataPointFlagsStruct { - return newMetricDataPointFlagsStruct(new(uint32)) -} - -// MoveTo moves all properties from the current struct to dest -// resetting the current instance to its zero value -func (ms MetricDataPointFlagsStruct) MoveTo(dest MetricDataPointFlagsStruct) { - *dest.orig = *ms.orig - *ms.orig = uint32(otlpmetrics.DataPointFlags_FLAG_NONE) -} - -// CopyTo copies all properties from the current struct to the dest. -func (ms MetricDataPointFlagsStruct) CopyTo(dest MetricDataPointFlagsStruct) { - *dest.orig = *ms.orig -} - -// NoRecordedValue returns true if the MetricDataPointFlags contains the NO_RECORDED_VALUE flag. -func (ms MetricDataPointFlagsStruct) NoRecordedValue() bool { - return *ms.orig&uint32(otlpmetrics.DataPointFlags_FLAG_NO_RECORDED_VALUE) != 0 -} - -// SetNoRecordedValue sets the FLAG_NO_RECORDED_VALUE flag if true and removes it if false. -// Setting this Flag when it is already set will change nothing. -func (ms MetricDataPointFlagsStruct) SetNoRecordedValue(b bool) { - if b { - *ms.orig |= uint32(otlpmetrics.DataPointFlags_FLAG_NO_RECORDED_VALUE) - } else { - *ms.orig &^= uint32(otlpmetrics.DataPointFlags_FLAG_NO_RECORDED_VALUE) - } -} - -// String returns the string representation of the MetricDataPointFlags. -func (ms MetricDataPointFlagsStruct) String() string { - return otlpmetrics.DataPointFlags(*ms.orig).String() -} - -// MetricDataPointFlags defines how a metric aggregator reports aggregated values. -// It describes how those values relate to the time interval over which they are aggregated. -type MetricDataPointFlags uint32 - -const ( - // MetricDataPointFlagsNone is the default MetricDataPointFlags. - MetricDataPointFlagsNone = MetricDataPointFlags(otlpmetrics.DataPointFlags_FLAG_NONE) -) - -// NewMetricDataPointFlags returns a new MetricDataPointFlags combining the flags passed -// in as parameters. -func NewMetricDataPointFlags(flags ...MetricDataPointFlag) MetricDataPointFlags { - var flag MetricDataPointFlags - for _, f := range flags { - flag |= MetricDataPointFlags(f) - } - return flag -} - -// HasFlag returns true if the MetricDataPointFlags contains the specified flag -func (d MetricDataPointFlags) HasFlag(flag MetricDataPointFlag) bool { - return d&MetricDataPointFlags(flag) != 0 -} - -// String returns the string representation of the MetricDataPointFlags. -func (d MetricDataPointFlags) String() string { - return otlpmetrics.DataPointFlags(d).String() -} - -// MetricDataPointFlag allow users to configure DataPointFlags. This is achieved via NewMetricDataPointFlags. -// The separation between MetricDataPointFlags and MetricDataPointFlag exists to prevent users accidentally -// comparing the value of individual flags with MetricDataPointFlags. Instead, users must use the HasFlag method. -type MetricDataPointFlag uint32 - -const ( - // MetricDataPointFlagNoRecordedValue is flag for a metric aggregator which reports changes since last report time. - MetricDataPointFlagNoRecordedValue = MetricDataPointFlag(otlpmetrics.DataPointFlags_FLAG_NO_RECORDED_VALUE) -) - -// NumberDataPointValueType specifies the type of NumberDataPoint value. -type NumberDataPointValueType int32 - -const ( - NumberDataPointValueTypeNone NumberDataPointValueType = iota - NumberDataPointValueTypeInt - NumberDataPointValueTypeDouble -) - -// String returns the string representation of the NumberDataPointValueType. -func (nt NumberDataPointValueType) String() string { - switch nt { - case NumberDataPointValueTypeNone: - return "None" - case NumberDataPointValueTypeInt: - return "Int" - case NumberDataPointValueTypeDouble: - return "Double" - } - return "" -} - -// ExemplarValueType specifies the type of Exemplar measurement value. -type ExemplarValueType int32 - -const ( - ExemplarValueTypeNone ExemplarValueType = iota - ExemplarValueTypeInt - ExemplarValueTypeDouble -) - -// String returns the string representation of the ExemplarValueType. -func (nt ExemplarValueType) String() string { - switch nt { - case ExemplarValueTypeNone: - return "None" - case ExemplarValueTypeInt: - return "Int" - case ExemplarValueTypeDouble: - return "Double" - } - return "" -} - -// OptionalType wraps optional fields into oneof fields -type OptionalType int32 - -const ( - OptionalTypeNone OptionalType = iota - OptionalTypeDouble -) - -// String returns the string representation of the OptionalType. -func (ot OptionalType) String() string { - switch ot { - case OptionalTypeNone: - return "None" - case OptionalTypeDouble: - return "Double" - } - return "" -} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/logs.go b/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/logs.go index 68c76f839f1..e829c7f585d 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/logs.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/logs.go @@ -15,32 +15,16 @@ package otlp // import "go.opentelemetry.io/collector/pdata/internal/otlp" import ( - otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" ) -// InstrumentationLibraryLogsToScope implements the translation of resource logs data -// following the v0.15.0 upgrade: -// receivers SHOULD check if instrumentation_library_logs is set -// and scope_logs is not set then the value in instrumentation_library_logs -// SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. -// If scope_logs is set then instrumentation_library_logs SHOULD be ignored. -// https://github.com/open-telemetry/opentelemetry-proto/blob/3c2915c01a9fb37abfc0415ec71247c4978386b0/opentelemetry/proto/logs/v1/logs.proto#L58 -func InstrumentationLibraryLogsToScope(rls []*otlplogs.ResourceLogs) { +// MigrateLogs implements any translation needed due to deprecation in OTLP logs protocol. +// Any plog.Unmarshaler implementation from OTLP (proto/json) MUST call this, and the gRPC Server implementation. +func MigrateLogs(rls []*otlplogs.ResourceLogs) { for _, rl := range rls { if len(rl.ScopeLogs) == 0 { - for _, ill := range rl.InstrumentationLibraryLogs { - scopeLogs := otlplogs.ScopeLogs{ - Scope: otlpcommon.InstrumentationScope{ - Name: ill.InstrumentationLibrary.Name, - Version: ill.InstrumentationLibrary.Version, - }, - LogRecords: ill.LogRecords, - SchemaUrl: ill.SchemaUrl, - } - rl.ScopeLogs = append(rl.ScopeLogs, &scopeLogs) - } + rl.ScopeLogs = rl.DeprecatedScopeLogs } - rl.InstrumentationLibraryLogs = nil + rl.DeprecatedScopeLogs = nil } } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/metrics.go b/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/metrics.go index 4ce73350b9b..e686a51f98c 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/metrics.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/metrics.go @@ -15,32 +15,16 @@ package otlp // import "go.opentelemetry.io/collector/pdata/internal/otlp" import ( - otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" ) -// InstrumentationLibraryMetricsToScope implements the translation of resource metrics data -// following the v0.15.0 upgrade: -// receivers SHOULD check if instrumentation_library_metrics is set -// and scope_metrics is not set then the value in instrumentation_library_metrics -// SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. -// If scope_metrics is set then instrumentation_library_metrics SHOULD be ignored. -// https://github.com/open-telemetry/opentelemetry-proto/blob/3c2915c01a9fb37abfc0415ec71247c4978386b0/opentelemetry/proto/metrics/v1/metrics.proto#L58 -func InstrumentationLibraryMetricsToScope(rms []*otlpmetrics.ResourceMetrics) { +// MigrateMetrics implements any translation needed due to deprecation in OTLP metrics protocol. +// Any pmetric.Unmarshaler implementation from OTLP (proto/json) MUST call this, and the gRPC Server implementation. +func MigrateMetrics(rms []*otlpmetrics.ResourceMetrics) { for _, rm := range rms { if len(rm.ScopeMetrics) == 0 { - for _, ilm := range rm.InstrumentationLibraryMetrics { - scopeMetrics := otlpmetrics.ScopeMetrics{ - Scope: otlpcommon.InstrumentationScope{ - Name: ilm.InstrumentationLibrary.Name, - Version: ilm.InstrumentationLibrary.Version, - }, - Metrics: ilm.Metrics, - SchemaUrl: ilm.SchemaUrl, - } - rm.ScopeMetrics = append(rm.ScopeMetrics, &scopeMetrics) - } + rm.ScopeMetrics = rm.DeprecatedScopeMetrics } - rm.InstrumentationLibraryMetrics = nil + rm.DeprecatedScopeMetrics = nil } } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/traces.go b/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/traces.go index 1a364b57793..3913d9e10c4 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/traces.go +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/otlp/traces.go @@ -15,32 +15,16 @@ package otlp // import "go.opentelemetry.io/collector/pdata/internal/otlp" import ( - otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" ) -// InstrumentationLibraryToScope implements the translation of resource span data -// following the v0.15.0 upgrade: -// receivers SHOULD check if instrumentation_library_spans is set -// and scope_spans is not set then the value in instrumentation_library_spans -// SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. -// If scope_spans is set then instrumentation_library_spans SHOULD be ignored. -// https://github.com/open-telemetry/opentelemetry-proto/blob/3c2915c01a9fb37abfc0415ec71247c4978386b0/opentelemetry/proto/trace/v1/trace.proto#L58 -func InstrumentationLibrarySpansToScope(rss []*otlptrace.ResourceSpans) { +// MigrateTraces implements any translation needed due to deprecation in OTLP traces protocol. +// Any ptrace.Unmarshaler implementation from OTLP (proto/json) MUST call this, and the gRPC Server implementation. +func MigrateTraces(rss []*otlptrace.ResourceSpans) { for _, rs := range rss { if len(rs.ScopeSpans) == 0 { - for _, ils := range rs.InstrumentationLibrarySpans { - scopeSpans := otlptrace.ScopeSpans{ - Scope: otlpcommon.InstrumentationScope{ - Name: ils.InstrumentationLibrary.Name, - Version: ils.InstrumentationLibrary.Version, - }, - Spans: ils.Spans, - SchemaUrl: ils.SchemaUrl, - } - rs.ScopeSpans = append(rs.ScopeSpans, &scopeSpans) - } + rs.ScopeSpans = rs.DeprecatedScopeSpans } - rs.InstrumentationLibrarySpans = nil + rs.DeprecatedScopeSpans = nil } } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_common.go b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_common.go new file mode 100644 index 00000000000..f78ff175425 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_common.go @@ -0,0 +1,89 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package internal // import "go.opentelemetry.io/collector/pdata/internal" + +import ( + otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" +) + +type Value struct { + orig *otlpcommon.AnyValue +} + +func GetOrigValue(ms Value) *otlpcommon.AnyValue { + return ms.orig +} + +func NewValue(orig *otlpcommon.AnyValue) Value { + return Value{orig: orig} +} + +func FillTestValue(dest Value) { + dest.orig.Value = &otlpcommon.AnyValue_StringValue{StringValue: "v"} +} + +func GenerateTestValue() Value { + var orig otlpcommon.AnyValue + ms := NewValue(&orig) + FillTestValue(ms) + return ms +} + +type Map struct { + orig *[]otlpcommon.KeyValue +} + +func GetOrigMap(ms Map) *[]otlpcommon.KeyValue { + return ms.orig +} + +func NewMap(orig *[]otlpcommon.KeyValue) Map { + return Map{orig: orig} +} + +func GenerateTestMap() Map { + var orig []otlpcommon.KeyValue + ms := NewMap(&orig) + FillTestMap(ms) + return ms +} + +func FillTestMap(dest Map) { + *dest.orig = nil + *dest.orig = append(*dest.orig, otlpcommon.KeyValue{Key: "k", Value: otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_StringValue{StringValue: "v"}}}) +} + +type TraceState struct { + orig *string +} + +func GetOrigTraceState(ms TraceState) *string { + return ms.orig +} + +func NewTraceState(orig *string) TraceState { + return TraceState{orig: orig} +} + +func GenerateTestTraceState() TraceState { + var orig string + ms := NewTraceState(&orig) + FillTestTraceState(ms) + return ms +} + +func FillTestTraceState(dest TraceState) { + *dest.orig = "rojo=00f067aa0ba902b7" +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_logs.go b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_logs.go new file mode 100644 index 00000000000..e66b06296e5 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_logs.go @@ -0,0 +1,46 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package internal // import "go.opentelemetry.io/collector/pdata/internal" + +import ( + otlpcollectorlog "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1" + otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" +) + +type Logs struct { + orig *otlpcollectorlog.ExportLogsServiceRequest +} + +func GetOrigLogs(ms Logs) *otlpcollectorlog.ExportLogsServiceRequest { + return ms.orig +} + +func NewLogs(orig *otlpcollectorlog.ExportLogsServiceRequest) Logs { + return Logs{orig: orig} +} + +// LogsToProto internal helper to convert Logs to protobuf representation. +func LogsToProto(l Logs) otlplogs.LogsData { + return otlplogs.LogsData{ + ResourceLogs: l.orig.ResourceLogs, + } +} + +// LogsFromProto internal helper to convert protobuf representation to Logs. +func LogsFromProto(orig otlplogs.LogsData) Logs { + return Logs{orig: &otlpcollectorlog.ExportLogsServiceRequest{ + ResourceLogs: orig.ResourceLogs, + }} +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_metrics.go b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_metrics.go new file mode 100644 index 00000000000..1f142172a1f --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_metrics.go @@ -0,0 +1,46 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package internal // import "go.opentelemetry.io/collector/pdata/internal" + +import ( + otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1" + otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" +) + +type Metrics struct { + orig *otlpcollectormetrics.ExportMetricsServiceRequest +} + +func GetOrigMetrics(ms Metrics) *otlpcollectormetrics.ExportMetricsServiceRequest { + return ms.orig +} + +func NewMetrics(orig *otlpcollectormetrics.ExportMetricsServiceRequest) Metrics { + return Metrics{orig: orig} +} + +// MetricsToProto internal helper to convert Metrics to protobuf representation. +func MetricsToProto(l Metrics) otlpmetrics.MetricsData { + return otlpmetrics.MetricsData{ + ResourceMetrics: l.orig.ResourceMetrics, + } +} + +// MetricsFromProto internal helper to convert protobuf representation to Metrics. +func MetricsFromProto(orig otlpmetrics.MetricsData) Metrics { + return Metrics{orig: &otlpcollectormetrics.ExportMetricsServiceRequest{ + ResourceMetrics: orig.ResourceMetrics, + }} +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_traces.go b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_traces.go new file mode 100644 index 00000000000..63589cd79e4 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/internal/wrapper_traces.go @@ -0,0 +1,46 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package internal // import "go.opentelemetry.io/collector/pdata/internal" + +import ( + otlpcollectortrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1" + otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" +) + +type Traces struct { + orig *otlpcollectortrace.ExportTraceServiceRequest +} + +func GetOrigTraces(ms Traces) *otlpcollectortrace.ExportTraceServiceRequest { + return ms.orig +} + +func NewTraces(orig *otlpcollectortrace.ExportTraceServiceRequest) Traces { + return Traces{orig: orig} +} + +// TracesToProto internal helper to convert Traces to protobuf representation. +func TracesToProto(l Traces) otlptrace.TracesData { + return otlptrace.TracesData{ + ResourceSpans: l.orig.ResourceSpans, + } +} + +// TracesFromProto internal helper to convert protobuf representation to Traces. +func TracesFromProto(orig otlptrace.TracesData) Traces { + return Traces{orig: &otlpcollectortrace.ExportTraceServiceRequest{ + ResourceSpans: orig.ResourceSpans, + }} +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/alias.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/alias.go deleted file mode 100644 index 23861ddda4e..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/alias.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -package pcommon // import "go.opentelemetry.io/collector/pdata/pcommon" - -// This file contains aliases to data structures that are common for all -// signal types, such as timestamps, attributes, etc. - -import "go.opentelemetry.io/collector/pdata/internal" - -// ValueType specifies the type of Value. -type ValueType = internal.ValueType - -const ( - ValueTypeEmpty = internal.ValueTypeEmpty - ValueTypeString = internal.ValueTypeString - ValueTypeInt = internal.ValueTypeInt - ValueTypeDouble = internal.ValueTypeDouble - ValueTypeBool = internal.ValueTypeBool - ValueTypeMap = internal.ValueTypeMap - ValueTypeSlice = internal.ValueTypeSlice - ValueTypeBytes = internal.ValueTypeBytes -) - -// Value is a mutable cell containing any value. Typically used as an element of Map or Slice. -// Must use one of NewValue+ functions below to create new instances. -// -// Intended to be passed by value since internally it is just a pointer to actual -// value representation. For the same reason passing by value and calling setters -// will modify the original, e.g.: -// -// func f1(val Value) { val.SetIntVal(234) } -// func f2() { -// v := NewValueString("a string") -// f1(v) -// _ := v.Type() // this will return ValueTypeInt -// } -// -// Important: zero-initialized instance is not valid for use. All Value functions below must -// be called only on instances that are created via NewValue+ functions. -type Value = internal.Value - -var ( - // NewValueEmpty creates a new Value with an empty value. - NewValueEmpty = internal.NewValueEmpty - - // NewValueString creates a new Value with the given string value. - NewValueString = internal.NewValueString - - // NewValueInt creates a new Value with the given int64 value. - NewValueInt = internal.NewValueInt - - // NewValueDouble creates a new Value with the given float64 value. - NewValueDouble = internal.NewValueDouble - - // NewValueBool creates a new Value with the given bool value. - NewValueBool = internal.NewValueBool - - // NewValueMap creates a new Value of map type. - NewValueMap = internal.NewValueMap - - // NewValueSlice creates a new Value of array type. - NewValueSlice = internal.NewValueSlice - - // NewValueBytes creates a new Value with the given ImmutableByteSlice value. - NewValueBytes = internal.NewValueBytes -) - -// Map stores a map of string keys to elements of Value type. -type Map = internal.Map - -var ( - // NewMap creates a Map with 0 elements. - NewMap = internal.NewMap - - // NewMapFromRaw creates a Map with values from the given map[string]interface{}. - NewMapFromRaw = internal.NewMapFromRaw -) - -// NewSliceFromRaw creates a Slice with values from the given []interface{}. -var NewSliceFromRaw = internal.NewSliceFromRaw diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/common.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/common.go new file mode 100644 index 00000000000..297a3ff6858 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/common.go @@ -0,0 +1,833 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package pcommon // import "go.opentelemetry.io/collector/pdata/pcommon" + +// This file contains data structures that are common for all telemetry types, +// such as timestamps, attributes, etc. + +import ( + "bytes" + "encoding/base64" + "encoding/json" + "fmt" + "math" + "sort" + "strconv" + + "go.uber.org/multierr" + + "go.opentelemetry.io/collector/pdata/internal" + otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" +) + +// ValueType specifies the type of Value. +type ValueType int32 + +const ( + ValueTypeEmpty ValueType = iota + ValueTypeStr + ValueTypeInt + ValueTypeDouble + ValueTypeBool + ValueTypeMap + ValueTypeSlice + ValueTypeBytes +) + +// String returns the string representation of the ValueType. +func (avt ValueType) String() string { + switch avt { + case ValueTypeEmpty: + return "Empty" + case ValueTypeStr: + return "Str" + case ValueTypeBool: + return "Bool" + case ValueTypeInt: + return "Int" + case ValueTypeDouble: + return "Double" + case ValueTypeMap: + return "Map" + case ValueTypeSlice: + return "Slice" + case ValueTypeBytes: + return "Bytes" + } + return "" +} + +// Value is a mutable cell containing any value. Typically used as an element of Map or Slice. +// Must use one of NewValue+ functions below to create new instances. +// +// Intended to be passed by value since internally it is just a pointer to actual +// value representation. For the same reason passing by value and calling setters +// will modify the original, e.g.: +// +// func f1(val Value) { val.SetInt(234) } +// func f2() { +// v := NewValueStr("a string") +// f1(v) +// _ := v.Type() // this will return ValueTypeInt +// } +// +// Important: zero-initialized instance is not valid for use. All Value functions below must +// be called only on instances that are created via NewValue+ functions. +type Value internal.Value + +// NewValueEmpty creates a new Value with an empty value. +func NewValueEmpty() Value { + return newValue(&otlpcommon.AnyValue{}) +} + +// NewValueStr creates a new Value with the given string value. +func NewValueStr(v string) Value { + return newValue(&otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_StringValue{StringValue: v}}) +} + +// NewValueInt creates a new Value with the given int64 value. +func NewValueInt(v int64) Value { + return newValue(&otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_IntValue{IntValue: v}}) +} + +// NewValueDouble creates a new Value with the given float64 value. +func NewValueDouble(v float64) Value { + return newValue(&otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_DoubleValue{DoubleValue: v}}) +} + +// NewValueBool creates a new Value with the given bool value. +func NewValueBool(v bool) Value { + return newValue(&otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_BoolValue{BoolValue: v}}) +} + +// NewValueMap creates a new Value of map type. +func NewValueMap() Value { + return newValue(&otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_KvlistValue{KvlistValue: &otlpcommon.KeyValueList{}}}) +} + +// NewValueSlice creates a new Value of array type. +func NewValueSlice() Value { + return newValue(&otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_ArrayValue{ArrayValue: &otlpcommon.ArrayValue{}}}) +} + +// NewValueBytes creates a new empty Value of byte type. +func NewValueBytes() Value { + return newValue(&otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_BytesValue{BytesValue: nil}}) +} + +func newValue(orig *otlpcommon.AnyValue) Value { + return Value(internal.NewValue(orig)) +} + +func (v Value) getOrig() *otlpcommon.AnyValue { + return internal.GetOrigValue(internal.Value(v)) +} + +func (v Value) FromRaw(iv any) error { + switch tv := iv.(type) { + case nil: + v.getOrig().Value = nil + case string: + v.SetStr(tv) + case int: + v.SetInt(int64(tv)) + case int8: + v.SetInt(int64(tv)) + case int16: + v.SetInt(int64(tv)) + case int32: + v.SetInt(int64(tv)) + case int64: + v.SetInt(tv) + case uint: + v.SetInt(int64(tv)) + case uint8: + v.SetInt(int64(tv)) + case uint16: + v.SetInt(int64(tv)) + case uint32: + v.SetInt(int64(tv)) + case uint64: + v.SetInt(int64(tv)) + case float32: + v.SetDouble(float64(tv)) + case float64: + v.SetDouble(tv) + case bool: + v.SetBool(tv) + case []byte: + v.SetEmptyBytes().FromRaw(tv) + case map[string]any: + return v.SetEmptyMap().FromRaw(tv) + case []any: + return v.SetEmptySlice().FromRaw(tv) + default: + return fmt.Errorf("", tv) + } + return nil +} + +// Type returns the type of the value for this Value. +// Calling this function on zero-initialized Value will cause a panic. +func (v Value) Type() ValueType { + switch v.getOrig().Value.(type) { + case *otlpcommon.AnyValue_StringValue: + return ValueTypeStr + case *otlpcommon.AnyValue_BoolValue: + return ValueTypeBool + case *otlpcommon.AnyValue_IntValue: + return ValueTypeInt + case *otlpcommon.AnyValue_DoubleValue: + return ValueTypeDouble + case *otlpcommon.AnyValue_KvlistValue: + return ValueTypeMap + case *otlpcommon.AnyValue_ArrayValue: + return ValueTypeSlice + case *otlpcommon.AnyValue_BytesValue: + return ValueTypeBytes + } + return ValueTypeEmpty +} + +// Str returns the string value associated with this Value. +// The shorter name is used instead of String to avoid implementing fmt.Stringer interface. +// If the Type() is not ValueTypeStr then returns empty string. +// Calling this function on zero-initialized Value will cause a panic. +func (v Value) Str() string { + return v.getOrig().GetStringValue() +} + +// Int returns the int64 value associated with this Value. +// If the Type() is not ValueTypeInt then returns int64(0). +// Calling this function on zero-initialized Value will cause a panic. +func (v Value) Int() int64 { + return v.getOrig().GetIntValue() +} + +// Double returns the float64 value associated with this Value. +// If the Type() is not ValueTypeDouble then returns float64(0). +// Calling this function on zero-initialized Value will cause a panic. +func (v Value) Double() float64 { + return v.getOrig().GetDoubleValue() +} + +// Bool returns the bool value associated with this Value. +// If the Type() is not ValueTypeBool then returns false. +// Calling this function on zero-initialized Value will cause a panic. +func (v Value) Bool() bool { + return v.getOrig().GetBoolValue() +} + +// Map returns the map value associated with this Value. +// If the Type() is not ValueTypeMap then returns an invalid map. Note that using +// such map can cause panic. +// +// Calling this function on zero-initialized Value will cause a panic. +func (v Value) Map() Map { + kvlist := v.getOrig().GetKvlistValue() + if kvlist == nil { + return Map{} + } + return newMap(&kvlist.Values) +} + +// Slice returns the slice value associated with this Value. +// If the Type() is not ValueTypeSlice then returns an invalid slice. Note that using +// such slice can cause panic. +// +// Calling this function on zero-initialized Value will cause a panic. +func (v Value) Slice() Slice { + arr := v.getOrig().GetArrayValue() + if arr == nil { + return Slice{} + } + return newSlice(&arr.Values) +} + +// Bytes returns the ByteSlice value associated with this Value. +// If the Type() is not ValueTypeBytes then returns an invalid ByteSlice object. Note that using +// such slice can cause panic. +// +// Calling this function on zero-initialized Value will cause a panic. +func (v Value) Bytes() ByteSlice { + bv, ok := v.getOrig().GetValue().(*otlpcommon.AnyValue_BytesValue) + if !ok { + return ByteSlice{} + } + return ByteSlice(internal.NewByteSlice(&bv.BytesValue)) +} + +// SetStr replaces the string value associated with this Value, +// it also changes the type to be ValueTypeStr. +// The shorter name is used instead of SetString to avoid implementing +// fmt.Stringer interface by the corresponding getter method. +// Calling this function on zero-initialized Value will cause a panic. +func (v Value) SetStr(sv string) { + v.getOrig().Value = &otlpcommon.AnyValue_StringValue{StringValue: sv} +} + +// SetInt replaces the int64 value associated with this Value, +// it also changes the type to be ValueTypeInt. +// Calling this function on zero-initialized Value will cause a panic. +func (v Value) SetInt(iv int64) { + v.getOrig().Value = &otlpcommon.AnyValue_IntValue{IntValue: iv} +} + +// SetDouble replaces the float64 value associated with this Value, +// it also changes the type to be ValueTypeDouble. +// Calling this function on zero-initialized Value will cause a panic. +func (v Value) SetDouble(dv float64) { + v.getOrig().Value = &otlpcommon.AnyValue_DoubleValue{DoubleValue: dv} +} + +// SetBool replaces the bool value associated with this Value, +// it also changes the type to be ValueTypeBool. +// Calling this function on zero-initialized Value will cause a panic. +func (v Value) SetBool(bv bool) { + v.getOrig().Value = &otlpcommon.AnyValue_BoolValue{BoolValue: bv} +} + +// SetEmptyBytes sets value to an empty byte slice and returns it. +// Calling this function on zero-initialized Value will cause a panic. +func (v Value) SetEmptyBytes() ByteSlice { + bv := otlpcommon.AnyValue_BytesValue{BytesValue: nil} + v.getOrig().Value = &bv + return ByteSlice(internal.NewByteSlice(&bv.BytesValue)) +} + +// SetEmptyMap sets value to an empty map and returns it. +// Calling this function on zero-initialized Value will cause a panic. +func (v Value) SetEmptyMap() Map { + kv := &otlpcommon.AnyValue_KvlistValue{KvlistValue: &otlpcommon.KeyValueList{}} + v.getOrig().Value = kv + return newMap(&kv.KvlistValue.Values) +} + +// SetEmptySlice sets value to an empty slice and returns it. +// Calling this function on zero-initialized Value will cause a panic. +func (v Value) SetEmptySlice() Slice { + av := &otlpcommon.AnyValue_ArrayValue{ArrayValue: &otlpcommon.ArrayValue{}} + v.getOrig().Value = av + return newSlice(&av.ArrayValue.Values) +} + +// CopyTo copies the Value instance overriding the destination. +func (v Value) CopyTo(dest Value) { + destOrig := dest.getOrig() + switch ov := v.getOrig().Value.(type) { + case *otlpcommon.AnyValue_KvlistValue: + kv, ok := destOrig.Value.(*otlpcommon.AnyValue_KvlistValue) + if !ok { + kv = &otlpcommon.AnyValue_KvlistValue{KvlistValue: &otlpcommon.KeyValueList{}} + destOrig.Value = kv + } + if ov.KvlistValue == nil { + kv.KvlistValue = nil + return + } + // Deep copy to dest. + newMap(&ov.KvlistValue.Values).CopyTo(newMap(&kv.KvlistValue.Values)) + case *otlpcommon.AnyValue_ArrayValue: + av, ok := destOrig.Value.(*otlpcommon.AnyValue_ArrayValue) + if !ok { + av = &otlpcommon.AnyValue_ArrayValue{ArrayValue: &otlpcommon.ArrayValue{}} + destOrig.Value = av + } + if ov.ArrayValue == nil { + av.ArrayValue = nil + return + } + // Deep copy to dest. + newSlice(&ov.ArrayValue.Values).CopyTo(newSlice(&av.ArrayValue.Values)) + case *otlpcommon.AnyValue_BytesValue: + bv, ok := destOrig.Value.(*otlpcommon.AnyValue_BytesValue) + if !ok { + bv = &otlpcommon.AnyValue_BytesValue{} + destOrig.Value = bv + } + bv.BytesValue = make([]byte, len(ov.BytesValue)) + copy(bv.BytesValue, ov.BytesValue) + default: + // Primitive immutable type, no need for deep copy. + destOrig.Value = ov + } +} + +// Equal checks for equality, it returns true if the objects are equal otherwise false. +// Deprecated: [1.0.0-rc2] Use reflect.DeepEqual(v1.AsRaw(), v2.AsRaw()) in tests. +// If you need this method where performance is critical, please share your use case in +// https://github.com/open-telemetry/opentelemetry-collector/issues/6811 +func (v Value) Equal(av Value) bool { + if v.getOrig() == av.getOrig() { + return true + } + + if v.getOrig().Value == nil || av.getOrig().Value == nil { + return v.getOrig().Value == av.getOrig().Value + } + + if v.Type() != av.Type() { + return false + } + + switch v := v.getOrig().Value.(type) { + case *otlpcommon.AnyValue_StringValue: + return v.StringValue == av.getOrig().GetStringValue() + case *otlpcommon.AnyValue_BoolValue: + return v.BoolValue == av.getOrig().GetBoolValue() + case *otlpcommon.AnyValue_IntValue: + return v.IntValue == av.getOrig().GetIntValue() + case *otlpcommon.AnyValue_DoubleValue: + return v.DoubleValue == av.getOrig().GetDoubleValue() + case *otlpcommon.AnyValue_ArrayValue: + vv := v.ArrayValue.GetValues() + avv := av.getOrig().GetArrayValue().GetValues() + if len(vv) != len(avv) { + return false + } + + for i := range avv { + if !newValue(&vv[i]).Equal(newValue(&avv[i])) { + return false + } + } + return true + case *otlpcommon.AnyValue_KvlistValue: + cc := v.KvlistValue.GetValues() + avv := av.getOrig().GetKvlistValue().GetValues() + if len(cc) != len(avv) { + return false + } + + m := newMap(&avv) + + for i := range cc { + newAv, ok := m.Get(cc[i].Key) + if !ok { + return false + } + + if !newAv.Equal(newValue(&cc[i].Value)) { + return false + } + } + return true + case *otlpcommon.AnyValue_BytesValue: + return bytes.Equal(v.BytesValue, av.getOrig().GetBytesValue()) + } + + return false +} + +// AsString converts an OTLP Value object of any type to its equivalent string +// representation. This differs from GetString which only returns a non-empty value +// if the ValueType is ValueTypeStr. +func (v Value) AsString() string { + switch v.Type() { + case ValueTypeEmpty: + return "" + + case ValueTypeStr: + return v.Str() + + case ValueTypeBool: + return strconv.FormatBool(v.Bool()) + + case ValueTypeDouble: + return float64AsString(v.Double()) + + case ValueTypeInt: + return strconv.FormatInt(v.Int(), 10) + + case ValueTypeMap: + jsonStr, _ := json.Marshal(v.Map().AsRaw()) + return string(jsonStr) + + case ValueTypeBytes: + return base64.StdEncoding.EncodeToString(*v.Bytes().getOrig()) + + case ValueTypeSlice: + jsonStr, _ := json.Marshal(v.Slice().AsRaw()) + return string(jsonStr) + + default: + return fmt.Sprintf("", v.Type()) + } +} + +// See https://cs.opensource.google/go/go/+/refs/tags/go1.17.7:src/encoding/json/encode.go;l=585. +// This allows us to avoid using reflection. +func float64AsString(f float64) string { + if math.IsInf(f, 0) || math.IsNaN(f) { + return fmt.Sprintf("json: unsupported value: %s", strconv.FormatFloat(f, 'g', -1, 64)) + } + + // Convert as if by ES6 number to string conversion. + // This matches most other JSON generators. + // See golang.org/issue/6384 and golang.org/issue/14135. + // Like fmt %g, but the exponent cutoffs are different + // and exponents themselves are not padded to two digits. + scratch := [64]byte{} + b := scratch[:0] + abs := math.Abs(f) + fmt := byte('f') + if abs != 0 && (abs < 1e-6 || abs >= 1e21) { + fmt = 'e' + } + b = strconv.AppendFloat(b, f, fmt, -1, 64) + if fmt == 'e' { + // clean up e-09 to e-9 + n := len(b) + if n >= 4 && b[n-4] == 'e' && b[n-3] == '-' && b[n-2] == '0' { + b[n-2] = b[n-1] + b = b[:n-1] + } + } + return string(b) +} + +func (v Value) AsRaw() any { + switch v.Type() { + case ValueTypeEmpty: + return nil + case ValueTypeStr: + return v.Str() + case ValueTypeBool: + return v.Bool() + case ValueTypeDouble: + return v.Double() + case ValueTypeInt: + return v.Int() + case ValueTypeBytes: + return v.Bytes().AsRaw() + case ValueTypeMap: + return v.Map().AsRaw() + case ValueTypeSlice: + return v.Slice().AsRaw() + } + return fmt.Sprintf("", v.Type()) +} + +func newKeyValueString(k string, v string) otlpcommon.KeyValue { + orig := otlpcommon.KeyValue{Key: k} + akv := newValue(&orig.Value) + akv.SetStr(v) + return orig +} + +func newKeyValueInt(k string, v int64) otlpcommon.KeyValue { + orig := otlpcommon.KeyValue{Key: k} + akv := newValue(&orig.Value) + akv.SetInt(v) + return orig +} + +func newKeyValueDouble(k string, v float64) otlpcommon.KeyValue { + orig := otlpcommon.KeyValue{Key: k} + akv := newValue(&orig.Value) + akv.SetDouble(v) + return orig +} + +func newKeyValueBool(k string, v bool) otlpcommon.KeyValue { + orig := otlpcommon.KeyValue{Key: k} + akv := newValue(&orig.Value) + akv.SetBool(v) + return orig +} + +// Map stores a map of string keys to elements of Value type. +type Map internal.Map + +// NewMap creates a Map with 0 elements. +func NewMap() Map { + orig := []otlpcommon.KeyValue(nil) + return Map(internal.NewMap(&orig)) +} + +func (m Map) getOrig() *[]otlpcommon.KeyValue { + return internal.GetOrigMap(internal.Map(m)) +} + +func newMap(orig *[]otlpcommon.KeyValue) Map { + return Map(internal.NewMap(orig)) +} + +// Clear erases any existing entries in this Map instance. +func (m Map) Clear() { + *m.getOrig() = nil +} + +// EnsureCapacity increases the capacity of this Map instance, if necessary, +// to ensure that it can hold at least the number of elements specified by the capacity argument. +func (m Map) EnsureCapacity(capacity int) { + if capacity <= cap(*m.getOrig()) { + return + } + oldOrig := *m.getOrig() + *m.getOrig() = make([]otlpcommon.KeyValue, 0, capacity) + copy(*m.getOrig(), oldOrig) +} + +// Get returns the Value associated with the key and true. Returned +// Value is not a copy, it is a reference to the value stored in this map. +// It is allowed to modify the returned value using Value.Set* functions. +// Such modification will be applied to the value stored in this map. +// +// If the key does not exist returns an invalid instance of the KeyValue and false. +// Calling any functions on the returned invalid instance will cause a panic. +func (m Map) Get(key string) (Value, bool) { + for i := range *m.getOrig() { + akv := &(*m.getOrig())[i] + if akv.Key == key { + return newValue(&akv.Value), true + } + } + return newValue(nil), false +} + +// Remove removes the entry associated with the key and returns true if the key +// was present in the map, otherwise returns false. +func (m Map) Remove(key string) bool { + for i := range *m.getOrig() { + akv := &(*m.getOrig())[i] + if akv.Key == key { + *akv = (*m.getOrig())[len(*m.getOrig())-1] + *m.getOrig() = (*m.getOrig())[:len(*m.getOrig())-1] + return true + } + } + return false +} + +// RemoveIf removes the entries for which the function in question returns true +func (m Map) RemoveIf(f func(string, Value) bool) { + newLen := 0 + for i := 0; i < len(*m.getOrig()); i++ { + akv := &(*m.getOrig())[i] + if f(akv.Key, newValue(&akv.Value)) { + continue + } + if newLen == i { + // Nothing to move, element is at the right place. + newLen++ + continue + } + (*m.getOrig())[newLen] = (*m.getOrig())[i] + newLen++ + } + *m.getOrig() = (*m.getOrig())[:newLen] +} + +// PutEmpty inserts or updates an empty value to the map under given key +// and return the updated/inserted value. +func (m Map) PutEmpty(k string) Value { + if av, existing := m.Get(k); existing { + av.getOrig().Value = nil + return newValue(av.getOrig()) + } + *m.getOrig() = append(*m.getOrig(), otlpcommon.KeyValue{Key: k}) + return newValue(&(*m.getOrig())[len(*m.getOrig())-1].Value) +} + +// PutStr performs the Insert or Update action. The Value is +// inserted to the map that did not originally have the key. The key/value is +// updated to the map where the key already existed. +func (m Map) PutStr(k string, v string) { + if av, existing := m.Get(k); existing { + av.SetStr(v) + } else { + *m.getOrig() = append(*m.getOrig(), newKeyValueString(k, v)) + } +} + +// PutInt performs the Insert or Update action. The int Value is +// inserted to the map that did not originally have the key. The key/value is +// updated to the map where the key already existed. +func (m Map) PutInt(k string, v int64) { + if av, existing := m.Get(k); existing { + av.SetInt(v) + } else { + *m.getOrig() = append(*m.getOrig(), newKeyValueInt(k, v)) + } +} + +// PutDouble performs the Insert or Update action. The double Value is +// inserted to the map that did not originally have the key. The key/value is +// updated to the map where the key already existed. +func (m Map) PutDouble(k string, v float64) { + if av, existing := m.Get(k); existing { + av.SetDouble(v) + } else { + *m.getOrig() = append(*m.getOrig(), newKeyValueDouble(k, v)) + } +} + +// PutBool performs the Insert or Update action. The bool Value is +// inserted to the map that did not originally have the key. The key/value is +// updated to the map where the key already existed. +func (m Map) PutBool(k string, v bool) { + if av, existing := m.Get(k); existing { + av.SetBool(v) + } else { + *m.getOrig() = append(*m.getOrig(), newKeyValueBool(k, v)) + } +} + +// PutEmptyBytes inserts or updates an empty byte slice under given key and returns it. +func (m Map) PutEmptyBytes(k string) ByteSlice { + bv := otlpcommon.AnyValue_BytesValue{} + if av, existing := m.Get(k); existing { + av.getOrig().Value = &bv + } else { + *m.getOrig() = append(*m.getOrig(), otlpcommon.KeyValue{Key: k, Value: otlpcommon.AnyValue{Value: &bv}}) + } + return ByteSlice(internal.NewByteSlice(&bv.BytesValue)) +} + +// PutEmptyMap inserts or updates an empty map under given key and returns it. +func (m Map) PutEmptyMap(k string) Map { + kvl := otlpcommon.AnyValue_KvlistValue{KvlistValue: &otlpcommon.KeyValueList{Values: []otlpcommon.KeyValue(nil)}} + if av, existing := m.Get(k); existing { + av.getOrig().Value = &kvl + } else { + *m.getOrig() = append(*m.getOrig(), otlpcommon.KeyValue{Key: k, Value: otlpcommon.AnyValue{Value: &kvl}}) + } + return Map(internal.NewMap(&kvl.KvlistValue.Values)) +} + +// PutEmptySlice inserts or updates an empty slice under given key and returns it. +func (m Map) PutEmptySlice(k string) Slice { + vl := otlpcommon.AnyValue_ArrayValue{ArrayValue: &otlpcommon.ArrayValue{Values: []otlpcommon.AnyValue(nil)}} + if av, existing := m.Get(k); existing { + av.getOrig().Value = &vl + } else { + *m.getOrig() = append(*m.getOrig(), otlpcommon.KeyValue{Key: k, Value: otlpcommon.AnyValue{Value: &vl}}) + } + return Slice(internal.NewSlice(&vl.ArrayValue.Values)) +} + +// Sort sorts the entries in the Map so two instances can be compared. +// +// IMPORTANT: Sort mutates the data, if you call this function in a consumer, +// the consumer must be configured that it mutates data. +func (m Map) Sort() { + // Intention is to move the nil values at the end. + sort.SliceStable(*m.getOrig(), func(i, j int) bool { + return (*m.getOrig())[i].Key < (*m.getOrig())[j].Key + }) +} + +// Len returns the length of this map. +// +// Because the Map is represented internally by a slice of pointers, and the data are comping from the wire, +// it is possible that when iterating using "Range" to get access to fewer elements because nil elements are skipped. +func (m Map) Len() int { + return len(*m.getOrig()) +} + +// Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration. +// +// Example: +// +// sm.Range(func(k string, v Value) bool { +// ... +// }) +func (m Map) Range(f func(k string, v Value) bool) { + for i := range *m.getOrig() { + kv := &(*m.getOrig())[i] + if !f(kv.Key, Value(internal.NewValue(&kv.Value))) { + break + } + } +} + +// CopyTo copies all elements from the current map overriding the destination. +func (m Map) CopyTo(dest Map) { + newLen := len(*m.getOrig()) + oldCap := cap(*dest.getOrig()) + if newLen <= oldCap { + // New slice fits in existing slice, no need to reallocate. + *dest.getOrig() = (*dest.getOrig())[:newLen:oldCap] + for i := range *m.getOrig() { + akv := &(*m.getOrig())[i] + destAkv := &(*dest.getOrig())[i] + destAkv.Key = akv.Key + newValue(&akv.Value).CopyTo(newValue(&destAkv.Value)) + } + return + } + + // New slice is bigger than exist slice. Allocate new space. + origs := make([]otlpcommon.KeyValue, len(*m.getOrig())) + for i := range *m.getOrig() { + akv := &(*m.getOrig())[i] + origs[i].Key = akv.Key + newValue(&akv.Value).CopyTo(newValue(&origs[i].Value)) + } + *dest.getOrig() = origs +} + +// AsRaw converts an OTLP Map to a standard go map +func (m Map) AsRaw() map[string]any { + rawMap := make(map[string]any) + m.Range(func(k string, v Value) bool { + rawMap[k] = v.AsRaw() + return true + }) + return rawMap +} + +func (m Map) FromRaw(rawMap map[string]any) error { + if len(rawMap) == 0 { + *m.getOrig() = nil + return nil + } + + var errs error + origs := make([]otlpcommon.KeyValue, len(rawMap)) + ix := 0 + for k, iv := range rawMap { + origs[ix].Key = k + errs = multierr.Append(errs, newValue(&origs[ix].Value).FromRaw(iv)) + ix++ + } + *m.getOrig() = origs + return errs +} + +// AsRaw return []any copy of the Slice. +func (es Slice) AsRaw() []any { + rawSlice := make([]any, 0, es.Len()) + for i := 0; i < es.Len(); i++ { + rawSlice = append(rawSlice, es.At(i).AsRaw()) + } + return rawSlice +} + +// FromRaw copies []any into the Slice. +func (es Slice) FromRaw(rawSlice []any) error { + if len(rawSlice) == 0 { + *es.getOrig() = nil + return nil + } + var errs error + origs := make([]otlpcommon.AnyValue, len(rawSlice)) + for ix, iv := range rawSlice { + errs = multierr.Append(errs, newValue(&origs[ix]).FromRaw(iv)) + } + *es.getOrig() = origs + return errs +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_common.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_common.go similarity index 61% rename from vendor/go.opentelemetry.io/collector/pdata/internal/generated_common.go rename to vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_common.go index f1155285ace..e53019a3725 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_common.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_common.go @@ -15,9 +15,10 @@ // Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". -package internal +package pcommon import ( + "go.opentelemetry.io/collector/pdata/internal" otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" ) @@ -28,12 +29,15 @@ import ( // // Must use NewInstrumentationScope function to create new instances. // Important: zero-initialized instance is not valid for use. -type InstrumentationScope struct { - orig *otlpcommon.InstrumentationScope -} + +type InstrumentationScope internal.InstrumentationScope func newInstrumentationScope(orig *otlpcommon.InstrumentationScope) InstrumentationScope { - return InstrumentationScope{orig: orig} + return InstrumentationScope(internal.NewInstrumentationScope(orig)) +} + +func (ms InstrumentationScope) getOrig() *otlpcommon.InstrumentationScope { + return internal.GetOrigInstrumentationScope(internal.InstrumentationScope(ms)) } // NewInstrumentationScope creates a new empty InstrumentationScope. @@ -44,37 +48,54 @@ func NewInstrumentationScope() InstrumentationScope { return newInstrumentationScope(&otlpcommon.InstrumentationScope{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms InstrumentationScope) MoveTo(dest InstrumentationScope) { - *dest.orig = *ms.orig - *ms.orig = otlpcommon.InstrumentationScope{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpcommon.InstrumentationScope{} } // Name returns the name associated with this InstrumentationScope. func (ms InstrumentationScope) Name() string { - return (*ms.orig).Name + return ms.getOrig().Name } // SetName replaces the name associated with this InstrumentationScope. func (ms InstrumentationScope) SetName(v string) { - (*ms.orig).Name = v + ms.getOrig().Name = v } // Version returns the version associated with this InstrumentationScope. func (ms InstrumentationScope) Version() string { - return (*ms.orig).Version + return ms.getOrig().Version } // SetVersion replaces the version associated with this InstrumentationScope. func (ms InstrumentationScope) SetVersion(v string) { - (*ms.orig).Version = v + ms.getOrig().Version = v +} + +// Attributes returns the Attributes associated with this InstrumentationScope. +func (ms InstrumentationScope) Attributes() Map { + return Map(internal.NewMap(&ms.getOrig().Attributes)) +} + +// DroppedAttributesCount returns the droppedattributescount associated with this InstrumentationScope. +func (ms InstrumentationScope) DroppedAttributesCount() uint32 { + return ms.getOrig().DroppedAttributesCount } -// CopyTo copies all properties from the current struct to the dest. +// SetDroppedAttributesCount replaces the droppedattributescount associated with this InstrumentationScope. +func (ms InstrumentationScope) SetDroppedAttributesCount(v uint32) { + ms.getOrig().DroppedAttributesCount = v +} + +// CopyTo copies all properties from the current struct overriding the destination. func (ms InstrumentationScope) CopyTo(dest InstrumentationScope) { dest.SetName(ms.Name()) dest.SetVersion(ms.Version()) + ms.Attributes().CopyTo(dest.Attributes()) + dest.SetDroppedAttributesCount(ms.DroppedAttributesCount()) } // Slice logically represents a slice of Value. @@ -84,53 +105,54 @@ func (ms InstrumentationScope) CopyTo(dest InstrumentationScope) { // // Must use NewSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type Slice struct { - // orig points to the slice otlpcommon.AnyValue field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]otlpcommon.AnyValue -} +type Slice internal.Slice func newSlice(orig *[]otlpcommon.AnyValue) Slice { - return Slice{orig} + return Slice(internal.NewSlice(orig)) +} + +func (ms Slice) getOrig() *[]otlpcommon.AnyValue { + return internal.GetOrigSlice(internal.Slice(ms)) } // NewSlice creates a Slice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewSlice() Slice { orig := []otlpcommon.AnyValue(nil) - return Slice{&orig} + return Slice(internal.NewSlice(&orig)) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewSlice()". func (es Slice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es Slice) At(ix int) Value { - return newValue(&(*es.orig)[ix]) + return newValue(&(*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es Slice) CopyTo(dest Slice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] } else { - (*dest.orig) = make([]otlpcommon.AnyValue, srcLen) + (*dest.getOrig()) = make([]otlpcommon.AnyValue, srcLen) } - for i := range *es.orig { - newValue(&(*es.orig)[i]).CopyTo(newValue(&(*dest.orig)[i])) + for i := range *es.getOrig() { + newValue(&(*es.getOrig())[i]).CopyTo(newValue(&(*dest.getOrig())[i])) } } @@ -139,47 +161,48 @@ func (es Slice) CopyTo(dest Slice) { // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new Slice can be initialized: -// es := NewSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es Slice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]otlpcommon.AnyValue, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]otlpcommon.AnyValue, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty Value. // It returns the newly added Value. func (es Slice) AppendEmpty() Value { - *es.orig = append(*es.orig, otlpcommon.AnyValue{}) + *es.getOrig() = append(*es.getOrig(), otlpcommon.AnyValue{}) return es.At(es.Len() - 1) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es Slice) MoveAndAppendTo(dest Slice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es Slice) RemoveIf(f func(Value) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -188,9 +211,9 @@ func (es Slice) RemoveIf(f func(Value) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_common_alias.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_common_alias.go deleted file mode 100644 index fd1425dfd23..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_common_alias.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". - -package pcommon - -import "go.opentelemetry.io/collector/pdata/internal" - -// InstrumentationScope is a message representing the instrumentation scope information. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewInstrumentationScope function to create new instances. -// Important: zero-initialized instance is not valid for use. -type InstrumentationScope = internal.InstrumentationScope - -// NewInstrumentationScope is an alias for a function to create a new empty InstrumentationScope. -var NewInstrumentationScope = internal.NewInstrumentationScope - -// Slice logically represents a slice of Value. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type Slice = internal.Slice - -// NewSlice creates a Slice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewSlice = internal.NewSlice diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_immutable_slice_alias.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_immutable_slice_alias.go deleted file mode 100644 index 19e6975735f..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_immutable_slice_alias.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". - -package pcommon - -import "go.opentelemetry.io/collector/pdata/internal" - -// ImmutableByteSlice represents a []byte slice that cannot be mutated. -type ImmutableByteSlice = internal.ImmutableByteSlice - -// NewImmutableByteSlice creates a new ImmutableByteSlice by copying the provided []byte slice. -var NewImmutableByteSlice = internal.NewImmutableByteSlice - -// ImmutableFloat64Slice represents a []float64 slice that cannot be mutated. -type ImmutableFloat64Slice = internal.ImmutableFloat64Slice - -// NewImmutableFloat64Slice creates a new ImmutableFloat64Slice by copying the provided []float64 slice. -var NewImmutableFloat64Slice = internal.NewImmutableFloat64Slice - -// ImmutableUInt64Slice represents a []uint64 slice that cannot be mutated. -type ImmutableUInt64Slice = internal.ImmutableUInt64Slice - -// NewImmutableUInt64Slice creates a new ImmutableUInt64Slice by copying the provided []uint64 slice. -var NewImmutableUInt64Slice = internal.NewImmutableUInt64Slice diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_primitive_slice.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_primitive_slice.go new file mode 100644 index 00000000000..8289a7e3c20 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_primitive_slice.go @@ -0,0 +1,275 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". + +package pcommon + +import "go.opentelemetry.io/collector/pdata/internal" + +// ByteSlice represents a []byte slice. +// The instance of ByteSlice can be assigned to multiple objects since it's immutable. +// +// Must use NewByteSlice function to create new instances. +// Important: zero-initialized instance is not valid for use. +type ByteSlice internal.ByteSlice + +func (ms ByteSlice) getOrig() *[]byte { + return internal.GetOrigByteSlice(internal.ByteSlice(ms)) +} + +// NewByteSlice creates a new empty ByteSlice. +func NewByteSlice() ByteSlice { + orig := []byte(nil) + return ByteSlice(internal.NewByteSlice(&orig)) +} + +// AsRaw returns a copy of the []byte slice. +func (ms ByteSlice) AsRaw() []byte { + return copyByteSlice(nil, *ms.getOrig()) +} + +// FromRaw copies raw []byte into the slice ByteSlice. +func (ms ByteSlice) FromRaw(val []byte) { + *ms.getOrig() = copyByteSlice(*ms.getOrig(), val) +} + +// Len returns length of the []byte slice value. +// Equivalent of len(byteSlice). +func (ms ByteSlice) Len() int { + return len(*ms.getOrig()) +} + +// At returns an item from particular index. +// Equivalent of byteSlice[i]. +func (ms ByteSlice) At(i int) byte { + return (*ms.getOrig())[i] +} + +// SetAt sets byte item at particular index. +// Equivalent of byteSlice[i] = val +func (ms ByteSlice) SetAt(i int, val byte) { + (*ms.getOrig())[i] = val +} + +// EnsureCapacity ensures ByteSlice has at least the specified capacity. +// 1. If the newCap <= cap, then is no change in capacity. +// 2. If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of: +// buf := make([]byte, len(byteSlice), newCap) +// copy(buf, byteSlice) +// byteSlice = buf +func (ms ByteSlice) EnsureCapacity(newCap int) { + oldCap := cap(*ms.getOrig()) + if newCap <= oldCap { + return + } + + newOrig := make([]byte, len(*ms.getOrig()), newCap) + copy(newOrig, *ms.getOrig()) + *ms.getOrig() = newOrig +} + +// Append appends extra elements to ByteSlice. +// Equivalent of byteSlice = append(byteSlice, elms...) +func (ms ByteSlice) Append(elms ...byte) { + *ms.getOrig() = append(*ms.getOrig(), elms...) +} + +// MoveTo moves all elements from the current slice overriding the destination and +// resetting the current instance to its zero value. +func (ms ByteSlice) MoveTo(dest ByteSlice) { + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = nil +} + +// CopyTo copies all elements from the current slice overriding the destination. +func (ms ByteSlice) CopyTo(dest ByteSlice) { + *dest.getOrig() = copyByteSlice(*dest.getOrig(), *ms.getOrig()) +} + +func copyByteSlice(dst, src []byte) []byte { + dst = dst[:0] + return append(dst, src...) +} + +// Float64Slice represents a []float64 slice. +// The instance of Float64Slice can be assigned to multiple objects since it's immutable. +// +// Must use NewFloat64Slice function to create new instances. +// Important: zero-initialized instance is not valid for use. +type Float64Slice internal.Float64Slice + +func (ms Float64Slice) getOrig() *[]float64 { + return internal.GetOrigFloat64Slice(internal.Float64Slice(ms)) +} + +// NewFloat64Slice creates a new empty Float64Slice. +func NewFloat64Slice() Float64Slice { + orig := []float64(nil) + return Float64Slice(internal.NewFloat64Slice(&orig)) +} + +// AsRaw returns a copy of the []float64 slice. +func (ms Float64Slice) AsRaw() []float64 { + return copyFloat64Slice(nil, *ms.getOrig()) +} + +// FromRaw copies raw []float64 into the slice Float64Slice. +func (ms Float64Slice) FromRaw(val []float64) { + *ms.getOrig() = copyFloat64Slice(*ms.getOrig(), val) +} + +// Len returns length of the []float64 slice value. +// Equivalent of len(float64Slice). +func (ms Float64Slice) Len() int { + return len(*ms.getOrig()) +} + +// At returns an item from particular index. +// Equivalent of float64Slice[i]. +func (ms Float64Slice) At(i int) float64 { + return (*ms.getOrig())[i] +} + +// SetAt sets float64 item at particular index. +// Equivalent of float64Slice[i] = val +func (ms Float64Slice) SetAt(i int, val float64) { + (*ms.getOrig())[i] = val +} + +// EnsureCapacity ensures Float64Slice has at least the specified capacity. +// 1. If the newCap <= cap, then is no change in capacity. +// 2. If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of: +// buf := make([]float64, len(float64Slice), newCap) +// copy(buf, float64Slice) +// float64Slice = buf +func (ms Float64Slice) EnsureCapacity(newCap int) { + oldCap := cap(*ms.getOrig()) + if newCap <= oldCap { + return + } + + newOrig := make([]float64, len(*ms.getOrig()), newCap) + copy(newOrig, *ms.getOrig()) + *ms.getOrig() = newOrig +} + +// Append appends extra elements to Float64Slice. +// Equivalent of float64Slice = append(float64Slice, elms...) +func (ms Float64Slice) Append(elms ...float64) { + *ms.getOrig() = append(*ms.getOrig(), elms...) +} + +// MoveTo moves all elements from the current slice overriding the destination and +// resetting the current instance to its zero value. +func (ms Float64Slice) MoveTo(dest Float64Slice) { + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = nil +} + +// CopyTo copies all elements from the current slice overriding the destination. +func (ms Float64Slice) CopyTo(dest Float64Slice) { + *dest.getOrig() = copyFloat64Slice(*dest.getOrig(), *ms.getOrig()) +} + +func copyFloat64Slice(dst, src []float64) []float64 { + dst = dst[:0] + return append(dst, src...) +} + +// UInt64Slice represents a []uint64 slice. +// The instance of UInt64Slice can be assigned to multiple objects since it's immutable. +// +// Must use NewUInt64Slice function to create new instances. +// Important: zero-initialized instance is not valid for use. +type UInt64Slice internal.UInt64Slice + +func (ms UInt64Slice) getOrig() *[]uint64 { + return internal.GetOrigUInt64Slice(internal.UInt64Slice(ms)) +} + +// NewUInt64Slice creates a new empty UInt64Slice. +func NewUInt64Slice() UInt64Slice { + orig := []uint64(nil) + return UInt64Slice(internal.NewUInt64Slice(&orig)) +} + +// AsRaw returns a copy of the []uint64 slice. +func (ms UInt64Slice) AsRaw() []uint64 { + return copyUInt64Slice(nil, *ms.getOrig()) +} + +// FromRaw copies raw []uint64 into the slice UInt64Slice. +func (ms UInt64Slice) FromRaw(val []uint64) { + *ms.getOrig() = copyUInt64Slice(*ms.getOrig(), val) +} + +// Len returns length of the []uint64 slice value. +// Equivalent of len(uInt64Slice). +func (ms UInt64Slice) Len() int { + return len(*ms.getOrig()) +} + +// At returns an item from particular index. +// Equivalent of uInt64Slice[i]. +func (ms UInt64Slice) At(i int) uint64 { + return (*ms.getOrig())[i] +} + +// SetAt sets uint64 item at particular index. +// Equivalent of uInt64Slice[i] = val +func (ms UInt64Slice) SetAt(i int, val uint64) { + (*ms.getOrig())[i] = val +} + +// EnsureCapacity ensures UInt64Slice has at least the specified capacity. +// 1. If the newCap <= cap, then is no change in capacity. +// 2. If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of: +// buf := make([]uint64, len(uInt64Slice), newCap) +// copy(buf, uInt64Slice) +// uInt64Slice = buf +func (ms UInt64Slice) EnsureCapacity(newCap int) { + oldCap := cap(*ms.getOrig()) + if newCap <= oldCap { + return + } + + newOrig := make([]uint64, len(*ms.getOrig()), newCap) + copy(newOrig, *ms.getOrig()) + *ms.getOrig() = newOrig +} + +// Append appends extra elements to UInt64Slice. +// Equivalent of uInt64Slice = append(uInt64Slice, elms...) +func (ms UInt64Slice) Append(elms ...uint64) { + *ms.getOrig() = append(*ms.getOrig(), elms...) +} + +// MoveTo moves all elements from the current slice overriding the destination and +// resetting the current instance to its zero value. +func (ms UInt64Slice) MoveTo(dest UInt64Slice) { + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = nil +} + +// CopyTo copies all elements from the current slice overriding the destination. +func (ms UInt64Slice) CopyTo(dest UInt64Slice) { + *dest.getOrig() = copyUInt64Slice(*dest.getOrig(), *ms.getOrig()) +} + +func copyUInt64Slice(dst, src []uint64) []uint64 { + dst = dst[:0] + return append(dst, src...) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_resource.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_resource.go similarity index 77% rename from vendor/go.opentelemetry.io/collector/pdata/internal/generated_resource.go rename to vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_resource.go index cc4bb64f058..f98f10f53f6 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_resource.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_resource.go @@ -15,9 +15,10 @@ // Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". -package internal +package pcommon import ( + "go.opentelemetry.io/collector/pdata/internal" otlpresource "go.opentelemetry.io/collector/pdata/internal/data/protogen/resource/v1" ) @@ -28,12 +29,15 @@ import ( // // Must use NewResource function to create new instances. // Important: zero-initialized instance is not valid for use. -type Resource struct { - orig *otlpresource.Resource -} + +type Resource internal.Resource func newResource(orig *otlpresource.Resource) Resource { - return Resource{orig: orig} + return Resource(internal.NewResource(orig)) +} + +func (ms Resource) getOrig() *otlpresource.Resource { + return internal.GetOrigResource(internal.Resource(ms)) } // NewResource creates a new empty Resource. @@ -44,29 +48,29 @@ func NewResource() Resource { return newResource(&otlpresource.Resource{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms Resource) MoveTo(dest Resource) { - *dest.orig = *ms.orig - *ms.orig = otlpresource.Resource{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpresource.Resource{} } // Attributes returns the Attributes associated with this Resource. func (ms Resource) Attributes() Map { - return newMap(&(*ms.orig).Attributes) + return Map(internal.NewMap(&ms.getOrig().Attributes)) } // DroppedAttributesCount returns the droppedattributescount associated with this Resource. func (ms Resource) DroppedAttributesCount() uint32 { - return (*ms.orig).DroppedAttributesCount + return ms.getOrig().DroppedAttributesCount } // SetDroppedAttributesCount replaces the droppedattributescount associated with this Resource. func (ms Resource) SetDroppedAttributesCount(v uint32) { - (*ms.orig).DroppedAttributesCount = v + ms.getOrig().DroppedAttributesCount = v } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms Resource) CopyTo(dest Resource) { ms.Attributes().CopyTo(dest.Attributes()) dest.SetDroppedAttributesCount(ms.DroppedAttributesCount()) diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/spanid.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/spanid.go similarity index 52% rename from vendor/go.opentelemetry.io/collector/pdata/internal/spanid.go rename to vendor/go.opentelemetry.io/collector/pdata/pcommon/spanid.go index 2ac539e1129..6ad8e02ca1c 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/spanid.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/spanid.go @@ -12,38 +12,36 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal // import "go.opentelemetry.io/collector/pdata/internal" - +package pcommon // import "go.opentelemetry.io/collector/pdata/pcommon" import ( + "encoding/hex" + "go.opentelemetry.io/collector/pdata/internal/data" ) -// SpanID is span identifier. -type SpanID struct { - orig data.SpanID -} +var emptySpanID = SpanID([8]byte{}) -// InvalidSpanID returns an empty (all zero bytes) SpanID. -func InvalidSpanID() SpanID { - return SpanID{orig: data.NewSpanID([8]byte{})} -} - -// NewSpanID returns a new SpanID from the given byte array. -func NewSpanID(bytes [8]byte) SpanID { - return SpanID{orig: data.NewSpanID(bytes)} -} +// SpanID is span identifier. +type SpanID [8]byte -// Bytes returns the byte array representation of the SpanID. -func (t SpanID) Bytes() [8]byte { - return t.orig.Bytes() +// NewSpanIDEmpty returns a new empty (all zero bytes) SpanID. +func NewSpanIDEmpty() SpanID { + return emptySpanID } -// HexString returns hex representation of the SpanID. -func (t SpanID) HexString() string { - return t.orig.HexString() +// String returns string representation of the SpanID. +// +// Important: Don't rely on this method to get a string identifier of SpanID, +// Use hex.EncodeToString explicitly instead. +// This method meant to implement Stringer interface for display purposes only. +func (ms SpanID) String() string { + if ms.IsEmpty() { + return "" + } + return hex.EncodeToString(ms[:]) } // IsEmpty returns true if id doesn't contain at least one non-zero byte. -func (t SpanID) IsEmpty() bool { - return t.orig.IsEmpty() +func (ms SpanID) IsEmpty() bool { + return data.SpanID(ms).IsEmpty() } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/spanid_alias.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/spanid_alias.go deleted file mode 100644 index a37a7fd603a..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/spanid_alias.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -package pcommon // import "go.opentelemetry.io/collector/pdata/pcommon" - -import "go.opentelemetry.io/collector/pdata/internal" - -// SpanID is span identifier. -type SpanID = internal.SpanID - -// InvalidSpanID returns an empty (all zero bytes) SpanID. -var InvalidSpanID = internal.InvalidSpanID - -// NewSpanID returns a new SpanID from the given byte array. -var NewSpanID = internal.NewSpanID diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/timestamp.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/timestamp.go similarity index 94% rename from vendor/go.opentelemetry.io/collector/pdata/internal/timestamp.go rename to vendor/go.opentelemetry.io/collector/pdata/pcommon/timestamp.go index 01597c3649c..78eb54eca71 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/timestamp.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/timestamp.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal // import "go.opentelemetry.io/collector/pdata/internal" +package pcommon // import "go.opentelemetry.io/collector/pdata/pcommon" import ( "time" diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/timestamp_alias.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/timestamp_alias.go deleted file mode 100644 index 1d5e81ce89e..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/timestamp_alias.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -package pcommon // import "go.opentelemetry.io/collector/pdata/pcommon" - -import "go.opentelemetry.io/collector/pdata/internal" - -// Timestamp is a time specified as UNIX Epoch time in nanoseconds since -// 1970-01-01 00:00:00 +0000 UTC. -type Timestamp = internal.Timestamp - -// NewTimestampFromTime constructs a new Timestamp from the provided time.Time. -var NewTimestampFromTime = internal.NewTimestampFromTime diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/trace_state.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/trace_state.go new file mode 100644 index 00000000000..0b6d37ed375 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/trace_state.go @@ -0,0 +1,52 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package pcommon // import "go.opentelemetry.io/collector/pdata/pcommon" + +import ( + "go.opentelemetry.io/collector/pdata/internal" +) + +// TraceState represents the trace state from the w3c-trace-context. +type TraceState internal.TraceState + +func NewTraceState() TraceState { + return TraceState(internal.NewTraceState(new(string))) +} + +func (ms TraceState) getOrig() *string { + return internal.GetOrigTraceState(internal.TraceState(ms)) +} + +// AsRaw returns the string representation of the tracestate in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header +func (ms TraceState) AsRaw() string { + return *ms.getOrig() +} + +// FromRaw copies the string representation in w3c-trace-context format of the tracestate into this TraceState. +func (ms TraceState) FromRaw(v string) { + *ms.getOrig() = v +} + +// MoveTo moves the TraceState instance overriding the destination +// and resetting the current instance to its zero value. +func (ms TraceState) MoveTo(dest TraceState) { + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = "" +} + +// CopyTo copies the TraceState instance overriding the destination. +func (ms TraceState) CopyTo(dest TraceState) { + *dest.getOrig() = *ms.getOrig() +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/traceid.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/traceid.go similarity index 52% rename from vendor/go.opentelemetry.io/collector/pdata/internal/traceid.go rename to vendor/go.opentelemetry.io/collector/pdata/pcommon/traceid.go index 2d6365f2755..1ead8237376 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/traceid.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/traceid.go @@ -12,38 +12,37 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal // import "go.opentelemetry.io/collector/pdata/internal" +package pcommon // import "go.opentelemetry.io/collector/pdata/pcommon" import ( + "encoding/hex" + "go.opentelemetry.io/collector/pdata/internal/data" ) -// TraceID is a trace identifier. -type TraceID struct { - orig data.TraceID -} - -// InvalidTraceID returns an empty (all zero bytes) TraceID. -func InvalidTraceID() TraceID { - return TraceID{orig: data.NewTraceID([16]byte{})} -} +var emptyTraceID = TraceID([16]byte{}) -// NewTraceID returns a new TraceID from the given byte array. -func NewTraceID(bytes [16]byte) TraceID { - return TraceID{orig: data.NewTraceID(bytes)} -} +// TraceID is a trace identifier. +type TraceID [16]byte -// Bytes returns the byte array representation of the TraceID. -func (t TraceID) Bytes() [16]byte { - return t.orig.Bytes() +// NewTraceIDEmpty returns a new empty (all zero bytes) TraceID. +func NewTraceIDEmpty() TraceID { + return emptyTraceID } -// HexString returns hex representation of the TraceID. -func (t TraceID) HexString() string { - return t.orig.HexString() +// String returns string representation of the TraceID. +// +// Important: Don't rely on this method to get a string identifier of TraceID. +// Use hex.EncodeToString explicitly instead. +// This method meant to implement Stringer interface for display purposes only. +func (ms TraceID) String() string { + if ms.IsEmpty() { + return "" + } + return hex.EncodeToString(ms[:]) } // IsEmpty returns true if id doesn't contain at least one non-zero byte. -func (t TraceID) IsEmpty() bool { - return t.orig.IsEmpty() +func (ms TraceID) IsEmpty() bool { + return data.TraceID(ms).IsEmpty() } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/traceid_alias.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/traceid_alias.go deleted file mode 100644 index 99ffa62d251..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/pcommon/traceid_alias.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -package pcommon // import "go.opentelemetry.io/collector/pdata/pcommon" - -import "go.opentelemetry.io/collector/pdata/internal" - -// TraceID is a trace identifier. -type TraceID = internal.TraceID - -// InvalidTraceID returns an empty (all zero bytes) TraceID. -var InvalidTraceID = internal.InvalidTraceID - -// NewTraceID returns a new TraceID from the given byte array. -var NewTraceID = internal.NewTraceID diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/alias.go b/vendor/go.opentelemetry.io/collector/pdata/plog/alias.go deleted file mode 100644 index 7b989979e6f..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/plog/alias.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -package plog // import "go.opentelemetry.io/collector/pdata/plog" - -// This file contains aliases for logs data structures. - -import "go.opentelemetry.io/collector/pdata/internal" - -// Logs is the top-level struct that is propagated through the logs pipeline. -// Use NewLogs to create new instance, zero-initialized instance is not valid for use. -type Logs = internal.Logs - -// NewLogs creates a new Logs struct. -var NewLogs = internal.NewLogs - -// SeverityNumber represents severity number of a log record. -type SeverityNumber = internal.SeverityNumber - -const ( - SeverityNumberUNDEFINED = internal.SeverityNumberUNDEFINED - SeverityNumberTRACE = internal.SeverityNumberTRACE - SeverityNumberTRACE2 = internal.SeverityNumberTRACE2 - SeverityNumberTRACE3 = internal.SeverityNumberTRACE3 - SeverityNumberTRACE4 = internal.SeverityNumberTRACE4 - SeverityNumberDEBUG = internal.SeverityNumberDEBUG - SeverityNumberDEBUG2 = internal.SeverityNumberDEBUG2 - SeverityNumberDEBUG3 = internal.SeverityNumberDEBUG3 - SeverityNumberDEBUG4 = internal.SeverityNumberDEBUG4 - SeverityNumberINFO = internal.SeverityNumberINFO - SeverityNumberINFO2 = internal.SeverityNumberINFO2 - SeverityNumberINFO3 = internal.SeverityNumberINFO3 - SeverityNumberINFO4 = internal.SeverityNumberINFO4 - SeverityNumberWARN = internal.SeverityNumberWARN - SeverityNumberWARN2 = internal.SeverityNumberWARN2 - SeverityNumberWARN3 = internal.SeverityNumberWARN3 - SeverityNumberWARN4 = internal.SeverityNumberWARN4 - SeverityNumberERROR = internal.SeverityNumberERROR - SeverityNumberERROR2 = internal.SeverityNumberERROR2 - SeverityNumberERROR3 = internal.SeverityNumberERROR3 - SeverityNumberERROR4 = internal.SeverityNumberERROR4 - SeverityNumberFATAL = internal.SeverityNumberFATAL - SeverityNumberFATAL2 = internal.SeverityNumberFATAL2 - SeverityNumberFATAL3 = internal.SeverityNumberFATAL3 - SeverityNumberFATAL4 = internal.SeverityNumberFATAL4 -) diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/encoding.go b/vendor/go.opentelemetry.io/collector/pdata/plog/encoding.go index 4143190ed0b..a03660dd939 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/plog/encoding.go +++ b/vendor/go.opentelemetry.io/collector/pdata/plog/encoding.go @@ -14,6 +14,12 @@ package plog // import "go.opentelemetry.io/collector/pdata/plog" +// MarshalSizer is the interface that groups the basic Marshal and Size methods +type MarshalSizer interface { + Marshaler + Sizer +} + // Marshaler marshals pdata.Logs into bytes. type Marshaler interface { // MarshalLogs the given pdata.Logs into bytes. diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/generated_alias.go b/vendor/go.opentelemetry.io/collector/pdata/plog/generated_alias.go deleted file mode 100644 index aacb32d4343..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/plog/generated_alias.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". - -package plog - -import "go.opentelemetry.io/collector/pdata/internal" - -// ResourceLogsSlice logically represents a slice of ResourceLogs. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewResourceLogsSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ResourceLogsSlice = internal.ResourceLogsSlice - -// NewResourceLogsSlice creates a ResourceLogsSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewResourceLogsSlice = internal.NewResourceLogsSlice - -// ResourceLogs is a collection of logs from a Resource. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewResourceLogs function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ResourceLogs = internal.ResourceLogs - -// NewResourceLogs is an alias for a function to create a new empty ResourceLogs. -var NewResourceLogs = internal.NewResourceLogs - -// ScopeLogsSlice logically represents a slice of ScopeLogs. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewScopeLogsSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ScopeLogsSlice = internal.ScopeLogsSlice - -// NewScopeLogsSlice creates a ScopeLogsSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewScopeLogsSlice = internal.NewScopeLogsSlice - -// ScopeLogs is a collection of logs from a LibraryInstrumentation. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewScopeLogs function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ScopeLogs = internal.ScopeLogs - -// NewScopeLogs is an alias for a function to create a new empty ScopeLogs. -var NewScopeLogs = internal.NewScopeLogs - -// LogRecordSlice logically represents a slice of LogRecord. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewLogRecordSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type LogRecordSlice = internal.LogRecordSlice - -// NewLogRecordSlice creates a LogRecordSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewLogRecordSlice = internal.NewLogRecordSlice - -// LogRecord are experimental implementation of OpenTelemetry Log Data Model. - -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewLogRecord function to create new instances. -// Important: zero-initialized instance is not valid for use. -type LogRecord = internal.LogRecord - -// NewLogRecord is an alias for a function to create a new empty LogRecord. -var NewLogRecord = internal.NewLogRecord diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_plog.go b/vendor/go.opentelemetry.io/collector/pdata/plog/generated_logs.go similarity index 63% rename from vendor/go.opentelemetry.io/collector/pdata/internal/generated_plog.go rename to vendor/go.opentelemetry.io/collector/pdata/plog/generated_logs.go index 2fd319d6556..b9071256387 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_plog.go +++ b/vendor/go.opentelemetry.io/collector/pdata/plog/generated_logs.go @@ -15,12 +15,15 @@ // Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". -package internal +package plog import ( "sort" + "go.opentelemetry.io/collector/pdata/internal" + "go.opentelemetry.io/collector/pdata/internal/data" otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" + "go.opentelemetry.io/collector/pdata/pcommon" ) // ResourceLogsSlice logically represents a slice of ResourceLogs. @@ -30,59 +33,60 @@ import ( // // Must use NewResourceLogsSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type ResourceLogsSlice struct { - // orig points to the slice otlplogs.ResourceLogs field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]*otlplogs.ResourceLogs -} +type ResourceLogsSlice internal.ResourceLogsSlice func newResourceLogsSlice(orig *[]*otlplogs.ResourceLogs) ResourceLogsSlice { - return ResourceLogsSlice{orig} + return ResourceLogsSlice(internal.NewResourceLogsSlice(orig)) +} + +func (ms ResourceLogsSlice) getOrig() *[]*otlplogs.ResourceLogs { + return internal.GetOrigResourceLogsSlice(internal.ResourceLogsSlice(ms)) } // NewResourceLogsSlice creates a ResourceLogsSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewResourceLogsSlice() ResourceLogsSlice { orig := []*otlplogs.ResourceLogs(nil) - return ResourceLogsSlice{&orig} + return newResourceLogsSlice(&orig) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewResourceLogsSlice()". func (es ResourceLogsSlice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es ResourceLogsSlice) At(ix int) ResourceLogs { - return newResourceLogs((*es.orig)[ix]) + return newResourceLogs((*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es ResourceLogsSlice) CopyTo(dest ResourceLogsSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newResourceLogs((*es.orig)[i]).CopyTo(newResourceLogs((*dest.orig)[i])) + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] + for i := range *es.getOrig() { + newResourceLogs((*es.getOrig())[i]).CopyTo(newResourceLogs((*dest.getOrig())[i])) } return } origs := make([]otlplogs.ResourceLogs, srcLen) wrappers := make([]*otlplogs.ResourceLogs, srcLen) - for i := range *es.orig { + for i := range *es.getOrig() { wrappers[i] = &origs[i] - newResourceLogs((*es.orig)[i]).CopyTo(newResourceLogs(wrappers[i])) + newResourceLogs((*es.getOrig())[i]).CopyTo(newResourceLogs(wrappers[i])) } - *dest.orig = wrappers + *dest.getOrig() = wrappers } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. @@ -90,61 +94,55 @@ func (es ResourceLogsSlice) CopyTo(dest ResourceLogsSlice) { // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new ResourceLogsSlice can be initialized: -// es := NewResourceLogsSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewResourceLogsSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es ResourceLogsSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]*otlplogs.ResourceLogs, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]*otlplogs.ResourceLogs, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty ResourceLogs. // It returns the newly added ResourceLogs. func (es ResourceLogsSlice) AppendEmpty() ResourceLogs { - *es.orig = append(*es.orig, &otlplogs.ResourceLogs{}) + *es.getOrig() = append(*es.getOrig(), &otlplogs.ResourceLogs{}) return es.At(es.Len() - 1) } // Sort sorts the ResourceLogs elements within ResourceLogsSlice given the // provided less function so that two instances of ResourceLogsSlice // can be compared. -// -// Returns the same instance to allow nicer code like: -// lessFunc := func(a, b ResourceLogs) bool { -// return a.Name() < b.Name() // choose any comparison here -// } -// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) -func (es ResourceLogsSlice) Sort(less func(a, b ResourceLogs) bool) ResourceLogsSlice { - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) - return es +func (es ResourceLogsSlice) Sort(less func(a, b ResourceLogs) bool) { + sort.SliceStable(*es.getOrig(), func(i, j int) bool { return less(es.At(i), es.At(j)) }) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es ResourceLogsSlice) MoveAndAppendTo(dest ResourceLogsSlice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es ResourceLogsSlice) RemoveIf(f func(ResourceLogs) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -153,11 +151,11 @@ func (es ResourceLogsSlice) RemoveIf(f func(ResourceLogs) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } // ResourceLogs is a collection of logs from a Resource. @@ -167,12 +165,15 @@ func (es ResourceLogsSlice) RemoveIf(f func(ResourceLogs) bool) { // // Must use NewResourceLogs function to create new instances. // Important: zero-initialized instance is not valid for use. -type ResourceLogs struct { - orig *otlplogs.ResourceLogs -} + +type ResourceLogs internal.ResourceLogs func newResourceLogs(orig *otlplogs.ResourceLogs) ResourceLogs { - return ResourceLogs{orig: orig} + return ResourceLogs(internal.NewResourceLogs(orig)) +} + +func (ms ResourceLogs) getOrig() *otlplogs.ResourceLogs { + return internal.GetOrigResourceLogs(internal.ResourceLogs(ms)) } // NewResourceLogs creates a new empty ResourceLogs. @@ -183,34 +184,34 @@ func NewResourceLogs() ResourceLogs { return newResourceLogs(&otlplogs.ResourceLogs{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms ResourceLogs) MoveTo(dest ResourceLogs) { - *dest.orig = *ms.orig - *ms.orig = otlplogs.ResourceLogs{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlplogs.ResourceLogs{} } // Resource returns the resource associated with this ResourceLogs. -func (ms ResourceLogs) Resource() Resource { - return newResource(&(*ms.orig).Resource) +func (ms ResourceLogs) Resource() pcommon.Resource { + return pcommon.Resource(internal.NewResource(&ms.getOrig().Resource)) } // SchemaUrl returns the schemaurl associated with this ResourceLogs. func (ms ResourceLogs) SchemaUrl() string { - return (*ms.orig).SchemaUrl + return ms.getOrig().SchemaUrl } // SetSchemaUrl replaces the schemaurl associated with this ResourceLogs. func (ms ResourceLogs) SetSchemaUrl(v string) { - (*ms.orig).SchemaUrl = v + ms.getOrig().SchemaUrl = v } // ScopeLogs returns the ScopeLogs associated with this ResourceLogs. func (ms ResourceLogs) ScopeLogs() ScopeLogsSlice { - return newScopeLogsSlice(&(*ms.orig).ScopeLogs) + return ScopeLogsSlice(internal.NewScopeLogsSlice(&ms.getOrig().ScopeLogs)) } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms ResourceLogs) CopyTo(dest ResourceLogs) { ms.Resource().CopyTo(dest.Resource()) dest.SetSchemaUrl(ms.SchemaUrl()) @@ -224,59 +225,60 @@ func (ms ResourceLogs) CopyTo(dest ResourceLogs) { // // Must use NewScopeLogsSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type ScopeLogsSlice struct { - // orig points to the slice otlplogs.ScopeLogs field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]*otlplogs.ScopeLogs -} +type ScopeLogsSlice internal.ScopeLogsSlice func newScopeLogsSlice(orig *[]*otlplogs.ScopeLogs) ScopeLogsSlice { - return ScopeLogsSlice{orig} + return ScopeLogsSlice(internal.NewScopeLogsSlice(orig)) +} + +func (ms ScopeLogsSlice) getOrig() *[]*otlplogs.ScopeLogs { + return internal.GetOrigScopeLogsSlice(internal.ScopeLogsSlice(ms)) } // NewScopeLogsSlice creates a ScopeLogsSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewScopeLogsSlice() ScopeLogsSlice { orig := []*otlplogs.ScopeLogs(nil) - return ScopeLogsSlice{&orig} + return newScopeLogsSlice(&orig) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewScopeLogsSlice()". func (es ScopeLogsSlice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es ScopeLogsSlice) At(ix int) ScopeLogs { - return newScopeLogs((*es.orig)[ix]) + return newScopeLogs((*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es ScopeLogsSlice) CopyTo(dest ScopeLogsSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newScopeLogs((*es.orig)[i]).CopyTo(newScopeLogs((*dest.orig)[i])) + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] + for i := range *es.getOrig() { + newScopeLogs((*es.getOrig())[i]).CopyTo(newScopeLogs((*dest.getOrig())[i])) } return } origs := make([]otlplogs.ScopeLogs, srcLen) wrappers := make([]*otlplogs.ScopeLogs, srcLen) - for i := range *es.orig { + for i := range *es.getOrig() { wrappers[i] = &origs[i] - newScopeLogs((*es.orig)[i]).CopyTo(newScopeLogs(wrappers[i])) + newScopeLogs((*es.getOrig())[i]).CopyTo(newScopeLogs(wrappers[i])) } - *dest.orig = wrappers + *dest.getOrig() = wrappers } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. @@ -284,61 +286,55 @@ func (es ScopeLogsSlice) CopyTo(dest ScopeLogsSlice) { // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new ScopeLogsSlice can be initialized: -// es := NewScopeLogsSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewScopeLogsSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es ScopeLogsSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]*otlplogs.ScopeLogs, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]*otlplogs.ScopeLogs, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty ScopeLogs. // It returns the newly added ScopeLogs. func (es ScopeLogsSlice) AppendEmpty() ScopeLogs { - *es.orig = append(*es.orig, &otlplogs.ScopeLogs{}) + *es.getOrig() = append(*es.getOrig(), &otlplogs.ScopeLogs{}) return es.At(es.Len() - 1) } // Sort sorts the ScopeLogs elements within ScopeLogsSlice given the // provided less function so that two instances of ScopeLogsSlice // can be compared. -// -// Returns the same instance to allow nicer code like: -// lessFunc := func(a, b ScopeLogs) bool { -// return a.Name() < b.Name() // choose any comparison here -// } -// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) -func (es ScopeLogsSlice) Sort(less func(a, b ScopeLogs) bool) ScopeLogsSlice { - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) - return es +func (es ScopeLogsSlice) Sort(less func(a, b ScopeLogs) bool) { + sort.SliceStable(*es.getOrig(), func(i, j int) bool { return less(es.At(i), es.At(j)) }) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es ScopeLogsSlice) MoveAndAppendTo(dest ScopeLogsSlice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es ScopeLogsSlice) RemoveIf(f func(ScopeLogs) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -347,11 +343,11 @@ func (es ScopeLogsSlice) RemoveIf(f func(ScopeLogs) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } // ScopeLogs is a collection of logs from a LibraryInstrumentation. @@ -361,12 +357,15 @@ func (es ScopeLogsSlice) RemoveIf(f func(ScopeLogs) bool) { // // Must use NewScopeLogs function to create new instances. // Important: zero-initialized instance is not valid for use. -type ScopeLogs struct { - orig *otlplogs.ScopeLogs -} + +type ScopeLogs internal.ScopeLogs func newScopeLogs(orig *otlplogs.ScopeLogs) ScopeLogs { - return ScopeLogs{orig: orig} + return ScopeLogs(internal.NewScopeLogs(orig)) +} + +func (ms ScopeLogs) getOrig() *otlplogs.ScopeLogs { + return internal.GetOrigScopeLogs(internal.ScopeLogs(ms)) } // NewScopeLogs creates a new empty ScopeLogs. @@ -377,34 +376,34 @@ func NewScopeLogs() ScopeLogs { return newScopeLogs(&otlplogs.ScopeLogs{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms ScopeLogs) MoveTo(dest ScopeLogs) { - *dest.orig = *ms.orig - *ms.orig = otlplogs.ScopeLogs{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlplogs.ScopeLogs{} } // Scope returns the scope associated with this ScopeLogs. -func (ms ScopeLogs) Scope() InstrumentationScope { - return newInstrumentationScope(&(*ms.orig).Scope) +func (ms ScopeLogs) Scope() pcommon.InstrumentationScope { + return pcommon.InstrumentationScope(internal.NewInstrumentationScope(&ms.getOrig().Scope)) } // SchemaUrl returns the schemaurl associated with this ScopeLogs. func (ms ScopeLogs) SchemaUrl() string { - return (*ms.orig).SchemaUrl + return ms.getOrig().SchemaUrl } // SetSchemaUrl replaces the schemaurl associated with this ScopeLogs. func (ms ScopeLogs) SetSchemaUrl(v string) { - (*ms.orig).SchemaUrl = v + ms.getOrig().SchemaUrl = v } // LogRecords returns the LogRecords associated with this ScopeLogs. func (ms ScopeLogs) LogRecords() LogRecordSlice { - return newLogRecordSlice(&(*ms.orig).LogRecords) + return LogRecordSlice(internal.NewLogRecordSlice(&ms.getOrig().LogRecords)) } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms ScopeLogs) CopyTo(dest ScopeLogs) { ms.Scope().CopyTo(dest.Scope()) dest.SetSchemaUrl(ms.SchemaUrl()) @@ -418,59 +417,60 @@ func (ms ScopeLogs) CopyTo(dest ScopeLogs) { // // Must use NewLogRecordSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type LogRecordSlice struct { - // orig points to the slice otlplogs.LogRecord field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]*otlplogs.LogRecord -} +type LogRecordSlice internal.LogRecordSlice func newLogRecordSlice(orig *[]*otlplogs.LogRecord) LogRecordSlice { - return LogRecordSlice{orig} + return LogRecordSlice(internal.NewLogRecordSlice(orig)) +} + +func (ms LogRecordSlice) getOrig() *[]*otlplogs.LogRecord { + return internal.GetOrigLogRecordSlice(internal.LogRecordSlice(ms)) } // NewLogRecordSlice creates a LogRecordSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewLogRecordSlice() LogRecordSlice { orig := []*otlplogs.LogRecord(nil) - return LogRecordSlice{&orig} + return newLogRecordSlice(&orig) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewLogRecordSlice()". func (es LogRecordSlice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es LogRecordSlice) At(ix int) LogRecord { - return newLogRecord((*es.orig)[ix]) + return newLogRecord((*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es LogRecordSlice) CopyTo(dest LogRecordSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newLogRecord((*es.orig)[i]).CopyTo(newLogRecord((*dest.orig)[i])) + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] + for i := range *es.getOrig() { + newLogRecord((*es.getOrig())[i]).CopyTo(newLogRecord((*dest.getOrig())[i])) } return } origs := make([]otlplogs.LogRecord, srcLen) wrappers := make([]*otlplogs.LogRecord, srcLen) - for i := range *es.orig { + for i := range *es.getOrig() { wrappers[i] = &origs[i] - newLogRecord((*es.orig)[i]).CopyTo(newLogRecord(wrappers[i])) + newLogRecord((*es.getOrig())[i]).CopyTo(newLogRecord(wrappers[i])) } - *dest.orig = wrappers + *dest.getOrig() = wrappers } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. @@ -478,61 +478,55 @@ func (es LogRecordSlice) CopyTo(dest LogRecordSlice) { // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new LogRecordSlice can be initialized: -// es := NewLogRecordSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewLogRecordSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es LogRecordSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]*otlplogs.LogRecord, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]*otlplogs.LogRecord, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty LogRecord. // It returns the newly added LogRecord. func (es LogRecordSlice) AppendEmpty() LogRecord { - *es.orig = append(*es.orig, &otlplogs.LogRecord{}) + *es.getOrig() = append(*es.getOrig(), &otlplogs.LogRecord{}) return es.At(es.Len() - 1) } // Sort sorts the LogRecord elements within LogRecordSlice given the // provided less function so that two instances of LogRecordSlice // can be compared. -// -// Returns the same instance to allow nicer code like: -// lessFunc := func(a, b LogRecord) bool { -// return a.Name() < b.Name() // choose any comparison here -// } -// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) -func (es LogRecordSlice) Sort(less func(a, b LogRecord) bool) LogRecordSlice { - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) - return es +func (es LogRecordSlice) Sort(less func(a, b LogRecord) bool) { + sort.SliceStable(*es.getOrig(), func(i, j int) bool { return less(es.At(i), es.At(j)) }) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es LogRecordSlice) MoveAndAppendTo(dest LogRecordSlice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es LogRecordSlice) RemoveIf(f func(LogRecord) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -541,11 +535,11 @@ func (es LogRecordSlice) RemoveIf(f func(LogRecord) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } // LogRecord are experimental implementation of OpenTelemetry Log Data Model. @@ -556,12 +550,15 @@ func (es LogRecordSlice) RemoveIf(f func(LogRecord) bool) { // // Must use NewLogRecord function to create new instances. // Important: zero-initialized instance is not valid for use. -type LogRecord struct { - orig *otlplogs.LogRecord -} + +type LogRecord internal.LogRecord func newLogRecord(orig *otlplogs.LogRecord) LogRecord { - return LogRecord{orig: orig} + return LogRecord(internal.NewLogRecord(orig)) +} + +func (ms LogRecord) getOrig() *otlplogs.LogRecord { + return internal.GetOrigLogRecord(internal.LogRecord(ms)) } // NewLogRecord creates a new empty LogRecord. @@ -572,104 +569,104 @@ func NewLogRecord() LogRecord { return newLogRecord(&otlplogs.LogRecord{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms LogRecord) MoveTo(dest LogRecord) { - *dest.orig = *ms.orig - *ms.orig = otlplogs.LogRecord{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlplogs.LogRecord{} } // ObservedTimestamp returns the observedtimestamp associated with this LogRecord. -func (ms LogRecord) ObservedTimestamp() Timestamp { - return Timestamp((*ms.orig).ObservedTimeUnixNano) +func (ms LogRecord) ObservedTimestamp() pcommon.Timestamp { + return pcommon.Timestamp(ms.getOrig().ObservedTimeUnixNano) } // SetObservedTimestamp replaces the observedtimestamp associated with this LogRecord. -func (ms LogRecord) SetObservedTimestamp(v Timestamp) { - (*ms.orig).ObservedTimeUnixNano = uint64(v) +func (ms LogRecord) SetObservedTimestamp(v pcommon.Timestamp) { + ms.getOrig().ObservedTimeUnixNano = uint64(v) } // Timestamp returns the timestamp associated with this LogRecord. -func (ms LogRecord) Timestamp() Timestamp { - return Timestamp((*ms.orig).TimeUnixNano) +func (ms LogRecord) Timestamp() pcommon.Timestamp { + return pcommon.Timestamp(ms.getOrig().TimeUnixNano) } // SetTimestamp replaces the timestamp associated with this LogRecord. -func (ms LogRecord) SetTimestamp(v Timestamp) { - (*ms.orig).TimeUnixNano = uint64(v) +func (ms LogRecord) SetTimestamp(v pcommon.Timestamp) { + ms.getOrig().TimeUnixNano = uint64(v) } // TraceID returns the traceid associated with this LogRecord. -func (ms LogRecord) TraceID() TraceID { - return TraceID{orig: ((*ms.orig).TraceId)} +func (ms LogRecord) TraceID() pcommon.TraceID { + return pcommon.TraceID(ms.getOrig().TraceId) } // SetTraceID replaces the traceid associated with this LogRecord. -func (ms LogRecord) SetTraceID(v TraceID) { - (*ms.orig).TraceId = v.orig +func (ms LogRecord) SetTraceID(v pcommon.TraceID) { + ms.getOrig().TraceId = data.TraceID(v) } // SpanID returns the spanid associated with this LogRecord. -func (ms LogRecord) SpanID() SpanID { - return SpanID{orig: ((*ms.orig).SpanId)} +func (ms LogRecord) SpanID() pcommon.SpanID { + return pcommon.SpanID(ms.getOrig().SpanId) } // SetSpanID replaces the spanid associated with this LogRecord. -func (ms LogRecord) SetSpanID(v SpanID) { - (*ms.orig).SpanId = v.orig +func (ms LogRecord) SetSpanID(v pcommon.SpanID) { + ms.getOrig().SpanId = data.SpanID(v) } // Flags returns the flags associated with this LogRecord. -func (ms LogRecord) Flags() uint32 { - return uint32((*ms.orig).Flags) +func (ms LogRecord) Flags() LogRecordFlags { + return LogRecordFlags(ms.getOrig().Flags) } // SetFlags replaces the flags associated with this LogRecord. -func (ms LogRecord) SetFlags(v uint32) { - (*ms.orig).Flags = uint32(v) +func (ms LogRecord) SetFlags(v LogRecordFlags) { + ms.getOrig().Flags = uint32(v) } // SeverityText returns the severitytext associated with this LogRecord. func (ms LogRecord) SeverityText() string { - return (*ms.orig).SeverityText + return ms.getOrig().SeverityText } // SetSeverityText replaces the severitytext associated with this LogRecord. func (ms LogRecord) SetSeverityText(v string) { - (*ms.orig).SeverityText = v + ms.getOrig().SeverityText = v } // SeverityNumber returns the severitynumber associated with this LogRecord. func (ms LogRecord) SeverityNumber() SeverityNumber { - return SeverityNumber((*ms.orig).SeverityNumber) + return SeverityNumber(ms.getOrig().SeverityNumber) } // SetSeverityNumber replaces the severitynumber associated with this LogRecord. func (ms LogRecord) SetSeverityNumber(v SeverityNumber) { - (*ms.orig).SeverityNumber = otlplogs.SeverityNumber(v) + ms.getOrig().SeverityNumber = otlplogs.SeverityNumber(v) } // Body returns the body associated with this LogRecord. -func (ms LogRecord) Body() Value { - return newValue(&(*ms.orig).Body) +func (ms LogRecord) Body() pcommon.Value { + return pcommon.Value(internal.NewValue(&ms.getOrig().Body)) } // Attributes returns the Attributes associated with this LogRecord. -func (ms LogRecord) Attributes() Map { - return newMap(&(*ms.orig).Attributes) +func (ms LogRecord) Attributes() pcommon.Map { + return pcommon.Map(internal.NewMap(&ms.getOrig().Attributes)) } // DroppedAttributesCount returns the droppedattributescount associated with this LogRecord. func (ms LogRecord) DroppedAttributesCount() uint32 { - return (*ms.orig).DroppedAttributesCount + return ms.getOrig().DroppedAttributesCount } // SetDroppedAttributesCount replaces the droppedattributescount associated with this LogRecord. func (ms LogRecord) SetDroppedAttributesCount(v uint32) { - (*ms.orig).DroppedAttributesCount = v + ms.getOrig().DroppedAttributesCount = v } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms LogRecord) CopyTo(dest LogRecord) { dest.SetObservedTimestamp(ms.ObservedTimestamp()) dest.SetTimestamp(ms.Timestamp()) diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/internal/plogjson/json.go b/vendor/go.opentelemetry.io/collector/pdata/plog/internal/plogjson/json.go new file mode 100644 index 00000000000..7a6cfa4f8f9 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/plog/internal/plogjson/json.go @@ -0,0 +1,189 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package plogjson // import "go.opentelemetry.io/collector/pdata/plog/internal/plogjson" + +import ( + "fmt" + + "github.com/gogo/protobuf/jsonpb" + jsoniter "github.com/json-iterator/go" + + otlpcollectorlog "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1" + otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" + "go.opentelemetry.io/collector/pdata/internal/json" + "go.opentelemetry.io/collector/pdata/internal/otlp" +) + +var JSONMarshaler = &jsonpb.Marshaler{ + // https://github.com/open-telemetry/opentelemetry-specification/pull/2758 + EnumsAsInts: true, + // https://github.com/open-telemetry/opentelemetry-specification/pull/2829 + OrigName: false, +} + +func UnmarshalLogsData(buf []byte, dest *otlplogs.LogsData) error { + iter := jsoniter.ConfigFastest.BorrowIterator(buf) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "resource_logs", "resourceLogs": + iter.ReadArrayCB(func(iterator *jsoniter.Iterator) bool { + dest.ResourceLogs = append(dest.ResourceLogs, readResourceLogs(iter)) + return true + }) + default: + iter.Skip() + } + return true + }) + otlp.MigrateLogs(dest.ResourceLogs) + return iter.Error +} + +func UnmarshalExportLogsServiceRequest(buf []byte, dest *otlpcollectorlog.ExportLogsServiceRequest) error { + iter := jsoniter.ConfigFastest.BorrowIterator(buf) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "resource_logs", "resourceLogs": + iter.ReadArrayCB(func(iterator *jsoniter.Iterator) bool { + dest.ResourceLogs = append(dest.ResourceLogs, readResourceLogs(iter)) + return true + }) + default: + iter.Skip() + } + return true + }) + otlp.MigrateLogs(dest.ResourceLogs) + return iter.Error +} + +func UnmarshalExportLogsServiceResponse(buf []byte, dest *otlpcollectorlog.ExportLogsServiceResponse) error { + iter := jsoniter.ConfigFastest.BorrowIterator(buf) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "partial_success", "partialSuccess": + dest.PartialSuccess = readExportLogsPartialSuccess(iter) + default: + iter.Skip() + } + return true + }) + return iter.Error +} + +func readResourceLogs(iter *jsoniter.Iterator) *otlplogs.ResourceLogs { + rs := &otlplogs.ResourceLogs{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "resource": + json.ReadResource(iter, &rs.Resource) + case "scope_logs", "scopeLogs": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + rs.ScopeLogs = append(rs.ScopeLogs, + readScopeLogs(iter)) + return true + }) + case "schemaUrl", "schema_url": + rs.SchemaUrl = iter.ReadString() + default: + iter.Skip() + } + return true + }) + return rs +} + +func readScopeLogs(iter *jsoniter.Iterator) *otlplogs.ScopeLogs { + ils := &otlplogs.ScopeLogs{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "scope": + json.ReadScope(iter, &ils.Scope) + case "log_records", "logRecords": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + ils.LogRecords = append(ils.LogRecords, readLog(iter)) + return true + }) + case "schemaUrl", "schema_url": + ils.SchemaUrl = iter.ReadString() + default: + iter.Skip() + } + return true + }) + return ils +} + +func readLog(iter *jsoniter.Iterator) *otlplogs.LogRecord { + lr := &otlplogs.LogRecord{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "timeUnixNano", "time_unix_nano": + lr.TimeUnixNano = json.ReadUint64(iter) + case "observed_time_unix_nano", "observedTimeUnixNano": + lr.ObservedTimeUnixNano = json.ReadUint64(iter) + case "severity_number", "severityNumber": + lr.SeverityNumber = readSeverityNumber(iter) + case "severity_text", "severityText": + lr.SeverityText = iter.ReadString() + case "body": + json.ReadValue(iter, &lr.Body) + case "attributes": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + lr.Attributes = append(lr.Attributes, json.ReadAttribute(iter)) + return true + }) + case "droppedAttributesCount", "dropped_attributes_count": + lr.DroppedAttributesCount = json.ReadUint32(iter) + case "flags": + lr.Flags = json.ReadUint32(iter) + case "traceId", "trace_id": + if err := lr.TraceId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { + iter.ReportError("readLog.traceId", fmt.Sprintf("parse trace_id:%v", err)) + } + case "spanId", "span_id": + if err := lr.SpanId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { + iter.ReportError("readLog.spanId", fmt.Sprintf("parse span_id:%v", err)) + } + default: + iter.Skip() + } + return true + }) + return lr +} + +func readSeverityNumber(iter *jsoniter.Iterator) otlplogs.SeverityNumber { + return otlplogs.SeverityNumber(json.ReadEnumValue(iter, otlplogs.SeverityNumber_value)) +} + +func readExportLogsPartialSuccess(iter *jsoniter.Iterator) otlpcollectorlog.ExportLogsPartialSuccess { + lpr := otlpcollectorlog.ExportLogsPartialSuccess{} + iter.ReadObjectCB(func(iterator *jsoniter.Iterator, f string) bool { + switch f { + case "rejected_log_records", "rejectedLogRecords": + lpr.RejectedLogRecords = json.ReadInt64(iter) + case "error_message", "errorMessage": + lpr.ErrorMessage = iter.ReadString() + default: + iter.Skip() + } + return true + }) + return lpr +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/json.go b/vendor/go.opentelemetry.io/collector/pdata/plog/json.go index d66e31a7872..dbf63635491 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/plog/json.go +++ b/vendor/go.opentelemetry.io/collector/pdata/plog/json.go @@ -17,51 +17,32 @@ package plog // import "go.opentelemetry.io/collector/pdata/plog" import ( "bytes" - "github.com/gogo/protobuf/jsonpb" - "go.opentelemetry.io/collector/pdata/internal" otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" - "go.opentelemetry.io/collector/pdata/internal/otlp" + "go.opentelemetry.io/collector/pdata/plog/internal/plogjson" ) -// NewJSONMarshaler returns a Marshaler. Marshals to OTLP json bytes. -func NewJSONMarshaler() Marshaler { - return newJSONMarshaler() -} +var delegate = plogjson.JSONMarshaler -type jsonMarshaler struct { - delegate jsonpb.Marshaler -} +var _ Marshaler = (*JSONMarshaler)(nil) -func newJSONMarshaler() *jsonMarshaler { - return &jsonMarshaler{delegate: jsonpb.Marshaler{}} -} +type JSONMarshaler struct{} -func (e *jsonMarshaler) MarshalLogs(ld Logs) ([]byte, error) { +func (*JSONMarshaler) MarshalLogs(ld Logs) ([]byte, error) { buf := bytes.Buffer{} - pb := internal.LogsToProto(ld) - err := e.delegate.Marshal(&buf, &pb) + pb := internal.LogsToProto(internal.Logs(ld)) + err := delegate.Marshal(&buf, &pb) return buf.Bytes(), err } -type jsonUnmarshaler struct { - delegate jsonpb.Unmarshaler -} - -// NewJSONUnmarshaler returns a model.Unmarshaler. Unmarshals from OTLP json bytes. -func NewJSONUnmarshaler() Unmarshaler { - return newJSONUnmarshaler() -} +var _ Unmarshaler = (*JSONUnmarshaler)(nil) -func newJSONUnmarshaler() *jsonUnmarshaler { - return &jsonUnmarshaler{delegate: jsonpb.Unmarshaler{}} -} +type JSONUnmarshaler struct{} -func (d *jsonUnmarshaler) UnmarshalLogs(buf []byte) (Logs, error) { - ld := otlplogs.LogsData{} - if err := d.delegate.Unmarshal(bytes.NewReader(buf), &ld); err != nil { +func (*JSONUnmarshaler) UnmarshalLogs(buf []byte) (Logs, error) { + var ld otlplogs.LogsData + if err := plogjson.UnmarshalLogsData(buf, &ld); err != nil { return Logs{}, err } - otlp.InstrumentationLibraryLogsToScope(ld.ResourceLogs) - return internal.LogsFromProto(ld), nil + return Logs(internal.LogsFromProto(ld)), nil } diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/log_record_flags.go b/vendor/go.opentelemetry.io/collector/pdata/plog/log_record_flags.go new file mode 100644 index 00000000000..a3b179b29c4 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/plog/log_record_flags.go @@ -0,0 +1,39 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package plog // import "go.opentelemetry.io/collector/pdata/plog" + +const isSampledMask = uint32(1) + +var DefaultLogRecordFlags = LogRecordFlags(0) + +// LogRecordFlags defines flags for the LogRecord. The 8 least significant bits are the trace flags as +// defined in W3C Trace Context specification. 24 most significant bits are reserved and must be set to 0. +type LogRecordFlags uint32 + +// IsSampled returns true if the LogRecordFlags contains the IsSampled flag. +func (ms LogRecordFlags) IsSampled() bool { + return uint32(ms)&isSampledMask != 0 +} + +// WithIsSampled returns a new LogRecordFlags, with the IsSampled flag set to the given value. +func (ms LogRecordFlags) WithIsSampled(b bool) LogRecordFlags { + orig := uint32(ms) + if b { + orig |= isSampledMask + } else { + orig &^= isSampledMask + } + return LogRecordFlags(orig) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/logs.go b/vendor/go.opentelemetry.io/collector/pdata/plog/logs.go new file mode 100644 index 00000000000..7557ddd729c --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/plog/logs.go @@ -0,0 +1,158 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package plog // import "go.opentelemetry.io/collector/pdata/plog" + +import ( + "go.opentelemetry.io/collector/pdata/internal" + otlpcollectorlog "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1" + otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" +) + +// Logs is the top-level struct that is propagated through the logs pipeline. +// Use NewLogs to create new instance, zero-initialized instance is not valid for use. +type Logs internal.Logs + +func newLogs(orig *otlpcollectorlog.ExportLogsServiceRequest) Logs { + return Logs(internal.NewLogs(orig)) +} + +func (ms Logs) getOrig() *otlpcollectorlog.ExportLogsServiceRequest { + return internal.GetOrigLogs(internal.Logs(ms)) +} + +// NewLogs creates a new Logs struct. +func NewLogs() Logs { + return newLogs(&otlpcollectorlog.ExportLogsServiceRequest{}) +} + +// MoveTo moves the Logs instance overriding the destination and +// resetting the current instance to its zero value. +func (ms Logs) MoveTo(dest Logs) { + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpcollectorlog.ExportLogsServiceRequest{} +} + +// CopyTo copies the Logs instance overriding the destination. +func (ms Logs) CopyTo(dest Logs) { + ms.ResourceLogs().CopyTo(dest.ResourceLogs()) +} + +// LogRecordCount calculates the total number of log records. +func (ms Logs) LogRecordCount() int { + logCount := 0 + rss := ms.ResourceLogs() + for i := 0; i < rss.Len(); i++ { + rs := rss.At(i) + ill := rs.ScopeLogs() + for i := 0; i < ill.Len(); i++ { + logs := ill.At(i) + logCount += logs.LogRecords().Len() + } + } + return logCount +} + +// ResourceLogs returns the ResourceLogsSlice associated with this Logs. +func (ms Logs) ResourceLogs() ResourceLogsSlice { + return newResourceLogsSlice(&ms.getOrig().ResourceLogs) +} + +// SeverityNumber represents severity number of a log record. +type SeverityNumber int32 + +const ( + SeverityNumberUnspecified = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_UNSPECIFIED) + SeverityNumberTrace = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_TRACE) + SeverityNumberTrace2 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_TRACE2) + SeverityNumberTrace3 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_TRACE3) + SeverityNumberTrace4 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_TRACE4) + SeverityNumberDebug = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_DEBUG) + SeverityNumberDebug2 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_DEBUG2) + SeverityNumberDebug3 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_DEBUG3) + SeverityNumberDebug4 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_DEBUG4) + SeverityNumberInfo = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_INFO) + SeverityNumberInfo2 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_INFO2) + SeverityNumberInfo3 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_INFO3) + SeverityNumberInfo4 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_INFO4) + SeverityNumberWarn = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_WARN) + SeverityNumberWarn2 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_WARN2) + SeverityNumberWarn3 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_WARN3) + SeverityNumberWarn4 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_WARN4) + SeverityNumberError = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_ERROR) + SeverityNumberError2 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_ERROR2) + SeverityNumberError3 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_ERROR3) + SeverityNumberError4 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_ERROR4) + SeverityNumberFatal = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL) + SeverityNumberFatal2 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL2) + SeverityNumberFatal3 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL3) + SeverityNumberFatal4 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL4) +) + +// String returns the string representation of the SeverityNumber. +func (sn SeverityNumber) String() string { + switch sn { + case SeverityNumberUnspecified: + return "Unspecified" + case SeverityNumberTrace: + return "Trace" + case SeverityNumberTrace2: + return "Trace2" + case SeverityNumberTrace3: + return "Trace3" + case SeverityNumberTrace4: + return "Trace4" + case SeverityNumberDebug: + return "Debug" + case SeverityNumberDebug2: + return "Debug2" + case SeverityNumberDebug3: + return "Debug3" + case SeverityNumberDebug4: + return "Debug4" + case SeverityNumberInfo: + return "Info" + case SeverityNumberInfo2: + return "Info2" + case SeverityNumberInfo3: + return "Info3" + case SeverityNumberInfo4: + return "Info4" + case SeverityNumberWarn: + return "Warn" + case SeverityNumberWarn2: + return "Warn2" + case SeverityNumberWarn3: + return "Warn3" + case SeverityNumberWarn4: + return "Warn4" + case SeverityNumberError: + return "Error" + case SeverityNumberError2: + return "Error2" + case SeverityNumberError3: + return "Error3" + case SeverityNumberError4: + return "Error4" + case SeverityNumberFatal: + return "Fatal" + case SeverityNumberFatal2: + return "Fatal2" + case SeverityNumberFatal3: + return "Fatal3" + case SeverityNumberFatal4: + return "Fatal4" + } + return "" +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/plog/pb.go b/vendor/go.opentelemetry.io/collector/pdata/plog/pb.go index 8c14b0d0385..70b7ad6e094 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/plog/pb.go +++ b/vendor/go.opentelemetry.io/collector/pdata/plog/pb.go @@ -19,43 +19,26 @@ import ( otlplogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1" ) -// NewProtoMarshaler returns a Marshaler. Marshals to OTLP binary protobuf bytes. -func NewProtoMarshaler() Marshaler { - return newPbMarshaler() -} - -// TODO(#3842): Figure out how we want to represent/return *Sizers. -type pbMarshaler struct{} - -func newPbMarshaler() *pbMarshaler { - return &pbMarshaler{} -} +var _ MarshalSizer = (*ProtoMarshaler)(nil) -var _ Sizer = (*pbMarshaler)(nil) +type ProtoMarshaler struct{} -func (e *pbMarshaler) MarshalLogs(ld Logs) ([]byte, error) { - pb := internal.LogsToProto(ld) +func (e *ProtoMarshaler) MarshalLogs(ld Logs) ([]byte, error) { + pb := internal.LogsToProto(internal.Logs(ld)) return pb.Marshal() } -func (e *pbMarshaler) LogsSize(ld Logs) int { - pb := internal.LogsToProto(ld) +func (e *ProtoMarshaler) LogsSize(ld Logs) int { + pb := internal.LogsToProto(internal.Logs(ld)) return pb.Size() } -type pbUnmarshaler struct{} +var _ Unmarshaler = (*ProtoUnmarshaler)(nil) -// NewProtoUnmarshaler returns a model.Unmarshaler. Unmarshals from OTLP binary protobuf bytes. -func NewProtoUnmarshaler() Unmarshaler { - return newPbUnmarshaler() -} - -func newPbUnmarshaler() *pbUnmarshaler { - return &pbUnmarshaler{} -} +type ProtoUnmarshaler struct{} -func (d *pbUnmarshaler) UnmarshalLogs(buf []byte) (Logs, error) { +func (d *ProtoUnmarshaler) UnmarshalLogs(buf []byte) (Logs, error) { pb := otlplogs.LogsData{} err := pb.Unmarshal(buf) - return internal.LogsFromProto(pb), err + return Logs(internal.LogsFromProto(pb)), err } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/alias.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/alias.go deleted file mode 100644 index 3594ce139be..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/alias.go +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -package pmetric // import "go.opentelemetry.io/collector/pdata/pmetric" - -import "go.opentelemetry.io/collector/pdata/internal" // This file contains aliases for metric data structures. - -// Metrics is the top-level struct that is propagated through the metrics pipeline. -// Use NewMetrics to create new instance, zero-initialized instance is not valid for use. -type Metrics = internal.Metrics - -// NewMetrics creates a new Metrics struct. -var NewMetrics = internal.NewMetrics - -// MetricDataType specifies the type of data in a Metric. -type MetricDataType = internal.MetricDataType - -const ( - MetricDataTypeNone = internal.MetricDataTypeNone - MetricDataTypeGauge = internal.MetricDataTypeGauge - MetricDataTypeSum = internal.MetricDataTypeSum - MetricDataTypeHistogram = internal.MetricDataTypeHistogram - MetricDataTypeExponentialHistogram = internal.MetricDataTypeExponentialHistogram - MetricDataTypeSummary = internal.MetricDataTypeSummary -) - -// MetricAggregationTemporality defines how a metric aggregator reports aggregated values. -// It describes how those values relate to the time interval over which they are aggregated. -type MetricAggregationTemporality = internal.MetricAggregationTemporality - -const ( - // MetricAggregationTemporalityUnspecified is the default MetricAggregationTemporality, it MUST NOT be used. - MetricAggregationTemporalityUnspecified = internal.MetricAggregationTemporalityUnspecified - - // MetricAggregationTemporalityDelta is a MetricAggregationTemporality for a metric aggregator which reports changes since last report time. - MetricAggregationTemporalityDelta = internal.MetricAggregationTemporalityDelta - - // MetricAggregationTemporalityCumulative is a MetricAggregationTemporality for a metric aggregator which reports changes since a fixed start time. - MetricAggregationTemporalityCumulative = internal.MetricAggregationTemporalityCumulative -) - -// MetricDataPointFlagsStruct defines how a metric aggregator reports aggregated values. -// It describes how those values relate to the time interval over which they are aggregated. -type MetricDataPointFlagsStruct = internal.MetricDataPointFlagsStruct - -// NewMetricDataPointFlagsStruct returns a new empty MetricDataPointFlagsStruct. -var NewMetricDataPointFlagsStruct = internal.NewMetricDataPointFlagsStruct - -// MetricDataPointFlags defines how a metric aggregator reports aggregated values. -// It describes how those values relate to the time interval over which they are aggregated. -// Deprecated: [v0.57.0] Use MetricDataPointFlagsStruct instead. -type MetricDataPointFlags = internal.MetricDataPointFlags - -const ( - // MetricDataPointFlagsNone is the default MetricDataPointFlags. - // Deprecated: [v0.57.0] Use MetricDataPointFlagsStruct.NoRecordedValue instead. - MetricDataPointFlagsNone = internal.MetricDataPointFlagsNone -) - -// NewMetricDataPointFlags returns a new MetricDataPointFlags combining the flags passed -// in as parameters. -// Deprecated: [v0.57.0] Use NewMetricDataPointFlagsStruct and MetricDataPointFlagsStruct.SetNoRecordedValue instead. -var NewMetricDataPointFlags = internal.NewMetricDataPointFlags - -// MetricDataPointFlag allow users to configure DataPointFlags. This is achieved via NewMetricDataPointFlags. -// The separation between MetricDataPointFlags and MetricDataPointFlag exists to prevent users accidentally -// comparing the value of individual flags with MetricDataPointFlags. Instead, users must use the HasFlag method. -// Deprecated: [v0.57.0] Use MetricDataPointFlagsStruct instead. -type MetricDataPointFlag = internal.MetricDataPointFlag - -const ( - // MetricDataPointFlagNoRecordedValue is flag for a metric aggregator which reports changes since last report time. - // Deprecated: [v0.57.0] Use MetricDataPointFlagsStruct.NoRecordedValue instead. - MetricDataPointFlagNoRecordedValue = internal.MetricDataPointFlagNoRecordedValue -) - -// NumberDataPointValueType specifies the type of NumberDataPoint value. -type NumberDataPointValueType = internal.NumberDataPointValueType - -const ( - NumberDataPointValueTypeNone = internal.NumberDataPointValueTypeNone - NumberDataPointValueTypeInt = internal.NumberDataPointValueTypeInt - NumberDataPointValueTypeDouble = internal.NumberDataPointValueTypeDouble -) - -// ExemplarValueType specifies the type of Exemplar measurement value. -type ExemplarValueType = internal.ExemplarValueType - -const ( - ExemplarValueTypeNone = internal.ExemplarValueTypeNone - ExemplarValueTypeInt = internal.ExemplarValueTypeInt - ExemplarValueTypeDouble = internal.ExemplarValueTypeDouble -) diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/encoding.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/encoding.go index 5c9f9b31786..5b9e0327355 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/encoding.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/encoding.go @@ -14,6 +14,12 @@ package pmetric // import "go.opentelemetry.io/collector/pdata/pmetric" +// MarshalSizer is the interface that groups the basic Marshal and Size methods +type MarshalSizer interface { + Marshaler + Sizer +} + // Marshaler marshals pmetric.Metrics into bytes. type Marshaler interface { // MarshalMetrics the given pmetric.Metrics into bytes. diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_alias.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_alias.go deleted file mode 100644 index 86343ebe339..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_alias.go +++ /dev/null @@ -1,325 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". - -package pmetric - -import "go.opentelemetry.io/collector/pdata/internal" - -// ResourceMetricsSlice logically represents a slice of ResourceMetrics. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewResourceMetricsSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ResourceMetricsSlice = internal.ResourceMetricsSlice - -// NewResourceMetricsSlice creates a ResourceMetricsSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewResourceMetricsSlice = internal.NewResourceMetricsSlice - -// ResourceMetrics is a collection of metrics from a Resource. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewResourceMetrics function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ResourceMetrics = internal.ResourceMetrics - -// NewResourceMetrics is an alias for a function to create a new empty ResourceMetrics. -var NewResourceMetrics = internal.NewResourceMetrics - -// ScopeMetricsSlice logically represents a slice of ScopeMetrics. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewScopeMetricsSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ScopeMetricsSlice = internal.ScopeMetricsSlice - -// NewScopeMetricsSlice creates a ScopeMetricsSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewScopeMetricsSlice = internal.NewScopeMetricsSlice - -// ScopeMetrics is a collection of metrics from a LibraryInstrumentation. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewScopeMetrics function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ScopeMetrics = internal.ScopeMetrics - -// NewScopeMetrics is an alias for a function to create a new empty ScopeMetrics. -var NewScopeMetrics = internal.NewScopeMetrics - -// MetricSlice logically represents a slice of Metric. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewMetricSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type MetricSlice = internal.MetricSlice - -// NewMetricSlice creates a MetricSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewMetricSlice = internal.NewMetricSlice - -// Metric represents one metric as a collection of datapoints. -// See Metric definition in OTLP: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/metrics/v1/metrics.proto -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewMetric function to create new instances. -// Important: zero-initialized instance is not valid for use. -type Metric = internal.Metric - -// NewMetric is an alias for a function to create a new empty Metric. -var NewMetric = internal.NewMetric - -// Gauge represents the type of a numeric metric that always exports the "current value" for every data point. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewGauge function to create new instances. -// Important: zero-initialized instance is not valid for use. -type Gauge = internal.Gauge - -// NewGauge is an alias for a function to create a new empty Gauge. -var NewGauge = internal.NewGauge - -// Sum represents the type of a numeric metric that is calculated as a sum of all reported measurements over a time interval. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewSum function to create new instances. -// Important: zero-initialized instance is not valid for use. -type Sum = internal.Sum - -// NewSum is an alias for a function to create a new empty Sum. -var NewSum = internal.NewSum - -// Histogram represents the type of a metric that is calculated by aggregating as a Histogram of all reported measurements over a time interval. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewHistogram function to create new instances. -// Important: zero-initialized instance is not valid for use. -type Histogram = internal.Histogram - -// NewHistogram is an alias for a function to create a new empty Histogram. -var NewHistogram = internal.NewHistogram - -// ExponentialHistogram represents the type of a metric that is calculated by aggregating -// as a ExponentialHistogram of all reported double measurements over a time interval. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewExponentialHistogram function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ExponentialHistogram = internal.ExponentialHistogram - -// NewExponentialHistogram is an alias for a function to create a new empty ExponentialHistogram. -var NewExponentialHistogram = internal.NewExponentialHistogram - -// Summary represents the type of a metric that is calculated by aggregating as a Summary of all reported double measurements over a time interval. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewSummary function to create new instances. -// Important: zero-initialized instance is not valid for use. -type Summary = internal.Summary - -// NewSummary is an alias for a function to create a new empty Summary. -var NewSummary = internal.NewSummary - -// NumberDataPointSlice logically represents a slice of NumberDataPoint. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewNumberDataPointSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type NumberDataPointSlice = internal.NumberDataPointSlice - -// NewNumberDataPointSlice creates a NumberDataPointSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewNumberDataPointSlice = internal.NewNumberDataPointSlice - -// NumberDataPoint is a single data point in a timeseries that describes the time-varying value of a number metric. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewNumberDataPoint function to create new instances. -// Important: zero-initialized instance is not valid for use. -type NumberDataPoint = internal.NumberDataPoint - -// NewNumberDataPoint is an alias for a function to create a new empty NumberDataPoint. -var NewNumberDataPoint = internal.NewNumberDataPoint - -// HistogramDataPointSlice logically represents a slice of HistogramDataPoint. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewHistogramDataPointSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type HistogramDataPointSlice = internal.HistogramDataPointSlice - -// NewHistogramDataPointSlice creates a HistogramDataPointSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewHistogramDataPointSlice = internal.NewHistogramDataPointSlice - -// HistogramDataPoint is a single data point in a timeseries that describes the time-varying values of a Histogram of values. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewHistogramDataPoint function to create new instances. -// Important: zero-initialized instance is not valid for use. -type HistogramDataPoint = internal.HistogramDataPoint - -// NewHistogramDataPoint is an alias for a function to create a new empty HistogramDataPoint. -var NewHistogramDataPoint = internal.NewHistogramDataPoint - -// ExponentialHistogramDataPointSlice logically represents a slice of ExponentialHistogramDataPoint. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewExponentialHistogramDataPointSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ExponentialHistogramDataPointSlice = internal.ExponentialHistogramDataPointSlice - -// NewExponentialHistogramDataPointSlice creates a ExponentialHistogramDataPointSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewExponentialHistogramDataPointSlice = internal.NewExponentialHistogramDataPointSlice - -// ExponentialHistogramDataPoint is a single data point in a timeseries that describes the -// time-varying values of a ExponentialHistogram of double values. A ExponentialHistogram contains -// summary statistics for a population of values, it may optionally contain the -// distribution of those values across a set of buckets. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewExponentialHistogramDataPoint function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ExponentialHistogramDataPoint = internal.ExponentialHistogramDataPoint - -// NewExponentialHistogramDataPoint is an alias for a function to create a new empty ExponentialHistogramDataPoint. -var NewExponentialHistogramDataPoint = internal.NewExponentialHistogramDataPoint - -// Buckets are a set of bucket counts, encoded in a contiguous array of counts. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewBuckets function to create new instances. -// Important: zero-initialized instance is not valid for use. -type Buckets = internal.Buckets - -// NewBuckets is an alias for a function to create a new empty Buckets. -var NewBuckets = internal.NewBuckets - -// SummaryDataPointSlice logically represents a slice of SummaryDataPoint. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewSummaryDataPointSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type SummaryDataPointSlice = internal.SummaryDataPointSlice - -// NewSummaryDataPointSlice creates a SummaryDataPointSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewSummaryDataPointSlice = internal.NewSummaryDataPointSlice - -// SummaryDataPoint is a single data point in a timeseries that describes the time-varying values of a Summary of double values. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewSummaryDataPoint function to create new instances. -// Important: zero-initialized instance is not valid for use. -type SummaryDataPoint = internal.SummaryDataPoint - -// NewSummaryDataPoint is an alias for a function to create a new empty SummaryDataPoint. -var NewSummaryDataPoint = internal.NewSummaryDataPoint - -// ValueAtQuantileSlice logically represents a slice of ValueAtQuantile. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewValueAtQuantileSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ValueAtQuantileSlice = internal.ValueAtQuantileSlice - -// NewValueAtQuantileSlice creates a ValueAtQuantileSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewValueAtQuantileSlice = internal.NewValueAtQuantileSlice - -// ValueAtQuantile is a quantile value within a Summary data point. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewValueAtQuantile function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ValueAtQuantile = internal.ValueAtQuantile - -// NewValueAtQuantile is an alias for a function to create a new empty ValueAtQuantile. -var NewValueAtQuantile = internal.NewValueAtQuantile - -// ExemplarSlice logically represents a slice of Exemplar. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewExemplarSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ExemplarSlice = internal.ExemplarSlice - -// NewExemplarSlice creates a ExemplarSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewExemplarSlice = internal.NewExemplarSlice - -// Exemplar is a sample input double measurement. -// -// Exemplars also hold information about the environment when the measurement was recorded, -// for example the span and trace ID of the active span when the exemplar was recorded. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewExemplar function to create new instances. -// Important: zero-initialized instance is not valid for use. -type Exemplar = internal.Exemplar - -// NewExemplar is an alias for a function to create a new empty Exemplar. -var NewExemplar = internal.NewExemplar diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_pmetric.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_metrics.go similarity index 56% rename from vendor/go.opentelemetry.io/collector/pdata/internal/generated_pmetric.go rename to vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_metrics.go index b74f43bf4a6..2f97d3ccde1 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_pmetric.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/generated_metrics.go @@ -15,12 +15,15 @@ // Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". -package internal +package pmetric import ( "sort" + "go.opentelemetry.io/collector/pdata/internal" + "go.opentelemetry.io/collector/pdata/internal/data" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/pcommon" ) // ResourceMetricsSlice logically represents a slice of ResourceMetrics. @@ -30,59 +33,60 @@ import ( // // Must use NewResourceMetricsSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type ResourceMetricsSlice struct { - // orig points to the slice otlpmetrics.ResourceMetrics field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]*otlpmetrics.ResourceMetrics -} +type ResourceMetricsSlice internal.ResourceMetricsSlice func newResourceMetricsSlice(orig *[]*otlpmetrics.ResourceMetrics) ResourceMetricsSlice { - return ResourceMetricsSlice{orig} + return ResourceMetricsSlice(internal.NewResourceMetricsSlice(orig)) +} + +func (ms ResourceMetricsSlice) getOrig() *[]*otlpmetrics.ResourceMetrics { + return internal.GetOrigResourceMetricsSlice(internal.ResourceMetricsSlice(ms)) } // NewResourceMetricsSlice creates a ResourceMetricsSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewResourceMetricsSlice() ResourceMetricsSlice { orig := []*otlpmetrics.ResourceMetrics(nil) - return ResourceMetricsSlice{&orig} + return newResourceMetricsSlice(&orig) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewResourceMetricsSlice()". func (es ResourceMetricsSlice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es ResourceMetricsSlice) At(ix int) ResourceMetrics { - return newResourceMetrics((*es.orig)[ix]) + return newResourceMetrics((*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es ResourceMetricsSlice) CopyTo(dest ResourceMetricsSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newResourceMetrics((*es.orig)[i]).CopyTo(newResourceMetrics((*dest.orig)[i])) + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] + for i := range *es.getOrig() { + newResourceMetrics((*es.getOrig())[i]).CopyTo(newResourceMetrics((*dest.getOrig())[i])) } return } origs := make([]otlpmetrics.ResourceMetrics, srcLen) wrappers := make([]*otlpmetrics.ResourceMetrics, srcLen) - for i := range *es.orig { + for i := range *es.getOrig() { wrappers[i] = &origs[i] - newResourceMetrics((*es.orig)[i]).CopyTo(newResourceMetrics(wrappers[i])) + newResourceMetrics((*es.getOrig())[i]).CopyTo(newResourceMetrics(wrappers[i])) } - *dest.orig = wrappers + *dest.getOrig() = wrappers } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. @@ -90,61 +94,55 @@ func (es ResourceMetricsSlice) CopyTo(dest ResourceMetricsSlice) { // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new ResourceMetricsSlice can be initialized: -// es := NewResourceMetricsSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewResourceMetricsSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es ResourceMetricsSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]*otlpmetrics.ResourceMetrics, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]*otlpmetrics.ResourceMetrics, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty ResourceMetrics. // It returns the newly added ResourceMetrics. func (es ResourceMetricsSlice) AppendEmpty() ResourceMetrics { - *es.orig = append(*es.orig, &otlpmetrics.ResourceMetrics{}) + *es.getOrig() = append(*es.getOrig(), &otlpmetrics.ResourceMetrics{}) return es.At(es.Len() - 1) } // Sort sorts the ResourceMetrics elements within ResourceMetricsSlice given the // provided less function so that two instances of ResourceMetricsSlice // can be compared. -// -// Returns the same instance to allow nicer code like: -// lessFunc := func(a, b ResourceMetrics) bool { -// return a.Name() < b.Name() // choose any comparison here -// } -// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) -func (es ResourceMetricsSlice) Sort(less func(a, b ResourceMetrics) bool) ResourceMetricsSlice { - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) - return es +func (es ResourceMetricsSlice) Sort(less func(a, b ResourceMetrics) bool) { + sort.SliceStable(*es.getOrig(), func(i, j int) bool { return less(es.At(i), es.At(j)) }) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es ResourceMetricsSlice) MoveAndAppendTo(dest ResourceMetricsSlice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es ResourceMetricsSlice) RemoveIf(f func(ResourceMetrics) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -153,11 +151,11 @@ func (es ResourceMetricsSlice) RemoveIf(f func(ResourceMetrics) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } // ResourceMetrics is a collection of metrics from a Resource. @@ -167,12 +165,15 @@ func (es ResourceMetricsSlice) RemoveIf(f func(ResourceMetrics) bool) { // // Must use NewResourceMetrics function to create new instances. // Important: zero-initialized instance is not valid for use. -type ResourceMetrics struct { - orig *otlpmetrics.ResourceMetrics -} + +type ResourceMetrics internal.ResourceMetrics func newResourceMetrics(orig *otlpmetrics.ResourceMetrics) ResourceMetrics { - return ResourceMetrics{orig: orig} + return ResourceMetrics(internal.NewResourceMetrics(orig)) +} + +func (ms ResourceMetrics) getOrig() *otlpmetrics.ResourceMetrics { + return internal.GetOrigResourceMetrics(internal.ResourceMetrics(ms)) } // NewResourceMetrics creates a new empty ResourceMetrics. @@ -183,34 +184,34 @@ func NewResourceMetrics() ResourceMetrics { return newResourceMetrics(&otlpmetrics.ResourceMetrics{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms ResourceMetrics) MoveTo(dest ResourceMetrics) { - *dest.orig = *ms.orig - *ms.orig = otlpmetrics.ResourceMetrics{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpmetrics.ResourceMetrics{} } // Resource returns the resource associated with this ResourceMetrics. -func (ms ResourceMetrics) Resource() Resource { - return newResource(&(*ms.orig).Resource) +func (ms ResourceMetrics) Resource() pcommon.Resource { + return pcommon.Resource(internal.NewResource(&ms.getOrig().Resource)) } // SchemaUrl returns the schemaurl associated with this ResourceMetrics. func (ms ResourceMetrics) SchemaUrl() string { - return (*ms.orig).SchemaUrl + return ms.getOrig().SchemaUrl } // SetSchemaUrl replaces the schemaurl associated with this ResourceMetrics. func (ms ResourceMetrics) SetSchemaUrl(v string) { - (*ms.orig).SchemaUrl = v + ms.getOrig().SchemaUrl = v } // ScopeMetrics returns the ScopeMetrics associated with this ResourceMetrics. func (ms ResourceMetrics) ScopeMetrics() ScopeMetricsSlice { - return newScopeMetricsSlice(&(*ms.orig).ScopeMetrics) + return ScopeMetricsSlice(internal.NewScopeMetricsSlice(&ms.getOrig().ScopeMetrics)) } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms ResourceMetrics) CopyTo(dest ResourceMetrics) { ms.Resource().CopyTo(dest.Resource()) dest.SetSchemaUrl(ms.SchemaUrl()) @@ -224,59 +225,60 @@ func (ms ResourceMetrics) CopyTo(dest ResourceMetrics) { // // Must use NewScopeMetricsSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type ScopeMetricsSlice struct { - // orig points to the slice otlpmetrics.ScopeMetrics field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]*otlpmetrics.ScopeMetrics -} +type ScopeMetricsSlice internal.ScopeMetricsSlice func newScopeMetricsSlice(orig *[]*otlpmetrics.ScopeMetrics) ScopeMetricsSlice { - return ScopeMetricsSlice{orig} + return ScopeMetricsSlice(internal.NewScopeMetricsSlice(orig)) +} + +func (ms ScopeMetricsSlice) getOrig() *[]*otlpmetrics.ScopeMetrics { + return internal.GetOrigScopeMetricsSlice(internal.ScopeMetricsSlice(ms)) } // NewScopeMetricsSlice creates a ScopeMetricsSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewScopeMetricsSlice() ScopeMetricsSlice { orig := []*otlpmetrics.ScopeMetrics(nil) - return ScopeMetricsSlice{&orig} + return newScopeMetricsSlice(&orig) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewScopeMetricsSlice()". func (es ScopeMetricsSlice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es ScopeMetricsSlice) At(ix int) ScopeMetrics { - return newScopeMetrics((*es.orig)[ix]) + return newScopeMetrics((*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es ScopeMetricsSlice) CopyTo(dest ScopeMetricsSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newScopeMetrics((*es.orig)[i]).CopyTo(newScopeMetrics((*dest.orig)[i])) + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] + for i := range *es.getOrig() { + newScopeMetrics((*es.getOrig())[i]).CopyTo(newScopeMetrics((*dest.getOrig())[i])) } return } origs := make([]otlpmetrics.ScopeMetrics, srcLen) wrappers := make([]*otlpmetrics.ScopeMetrics, srcLen) - for i := range *es.orig { + for i := range *es.getOrig() { wrappers[i] = &origs[i] - newScopeMetrics((*es.orig)[i]).CopyTo(newScopeMetrics(wrappers[i])) + newScopeMetrics((*es.getOrig())[i]).CopyTo(newScopeMetrics(wrappers[i])) } - *dest.orig = wrappers + *dest.getOrig() = wrappers } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. @@ -284,61 +286,55 @@ func (es ScopeMetricsSlice) CopyTo(dest ScopeMetricsSlice) { // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new ScopeMetricsSlice can be initialized: -// es := NewScopeMetricsSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewScopeMetricsSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es ScopeMetricsSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]*otlpmetrics.ScopeMetrics, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]*otlpmetrics.ScopeMetrics, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty ScopeMetrics. // It returns the newly added ScopeMetrics. func (es ScopeMetricsSlice) AppendEmpty() ScopeMetrics { - *es.orig = append(*es.orig, &otlpmetrics.ScopeMetrics{}) + *es.getOrig() = append(*es.getOrig(), &otlpmetrics.ScopeMetrics{}) return es.At(es.Len() - 1) } // Sort sorts the ScopeMetrics elements within ScopeMetricsSlice given the // provided less function so that two instances of ScopeMetricsSlice // can be compared. -// -// Returns the same instance to allow nicer code like: -// lessFunc := func(a, b ScopeMetrics) bool { -// return a.Name() < b.Name() // choose any comparison here -// } -// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) -func (es ScopeMetricsSlice) Sort(less func(a, b ScopeMetrics) bool) ScopeMetricsSlice { - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) - return es +func (es ScopeMetricsSlice) Sort(less func(a, b ScopeMetrics) bool) { + sort.SliceStable(*es.getOrig(), func(i, j int) bool { return less(es.At(i), es.At(j)) }) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es ScopeMetricsSlice) MoveAndAppendTo(dest ScopeMetricsSlice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es ScopeMetricsSlice) RemoveIf(f func(ScopeMetrics) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -347,11 +343,11 @@ func (es ScopeMetricsSlice) RemoveIf(f func(ScopeMetrics) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } // ScopeMetrics is a collection of metrics from a LibraryInstrumentation. @@ -361,12 +357,15 @@ func (es ScopeMetricsSlice) RemoveIf(f func(ScopeMetrics) bool) { // // Must use NewScopeMetrics function to create new instances. // Important: zero-initialized instance is not valid for use. -type ScopeMetrics struct { - orig *otlpmetrics.ScopeMetrics -} + +type ScopeMetrics internal.ScopeMetrics func newScopeMetrics(orig *otlpmetrics.ScopeMetrics) ScopeMetrics { - return ScopeMetrics{orig: orig} + return ScopeMetrics(internal.NewScopeMetrics(orig)) +} + +func (ms ScopeMetrics) getOrig() *otlpmetrics.ScopeMetrics { + return internal.GetOrigScopeMetrics(internal.ScopeMetrics(ms)) } // NewScopeMetrics creates a new empty ScopeMetrics. @@ -377,34 +376,34 @@ func NewScopeMetrics() ScopeMetrics { return newScopeMetrics(&otlpmetrics.ScopeMetrics{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms ScopeMetrics) MoveTo(dest ScopeMetrics) { - *dest.orig = *ms.orig - *ms.orig = otlpmetrics.ScopeMetrics{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpmetrics.ScopeMetrics{} } // Scope returns the scope associated with this ScopeMetrics. -func (ms ScopeMetrics) Scope() InstrumentationScope { - return newInstrumentationScope(&(*ms.orig).Scope) +func (ms ScopeMetrics) Scope() pcommon.InstrumentationScope { + return pcommon.InstrumentationScope(internal.NewInstrumentationScope(&ms.getOrig().Scope)) } // SchemaUrl returns the schemaurl associated with this ScopeMetrics. func (ms ScopeMetrics) SchemaUrl() string { - return (*ms.orig).SchemaUrl + return ms.getOrig().SchemaUrl } // SetSchemaUrl replaces the schemaurl associated with this ScopeMetrics. func (ms ScopeMetrics) SetSchemaUrl(v string) { - (*ms.orig).SchemaUrl = v + ms.getOrig().SchemaUrl = v } // Metrics returns the Metrics associated with this ScopeMetrics. func (ms ScopeMetrics) Metrics() MetricSlice { - return newMetricSlice(&(*ms.orig).Metrics) + return MetricSlice(internal.NewMetricSlice(&ms.getOrig().Metrics)) } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms ScopeMetrics) CopyTo(dest ScopeMetrics) { ms.Scope().CopyTo(dest.Scope()) dest.SetSchemaUrl(ms.SchemaUrl()) @@ -418,59 +417,60 @@ func (ms ScopeMetrics) CopyTo(dest ScopeMetrics) { // // Must use NewMetricSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type MetricSlice struct { - // orig points to the slice otlpmetrics.Metric field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]*otlpmetrics.Metric -} +type MetricSlice internal.MetricSlice func newMetricSlice(orig *[]*otlpmetrics.Metric) MetricSlice { - return MetricSlice{orig} + return MetricSlice(internal.NewMetricSlice(orig)) +} + +func (ms MetricSlice) getOrig() *[]*otlpmetrics.Metric { + return internal.GetOrigMetricSlice(internal.MetricSlice(ms)) } // NewMetricSlice creates a MetricSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewMetricSlice() MetricSlice { orig := []*otlpmetrics.Metric(nil) - return MetricSlice{&orig} + return newMetricSlice(&orig) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewMetricSlice()". func (es MetricSlice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es MetricSlice) At(ix int) Metric { - return newMetric((*es.orig)[ix]) + return newMetric((*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es MetricSlice) CopyTo(dest MetricSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newMetric((*es.orig)[i]).CopyTo(newMetric((*dest.orig)[i])) + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] + for i := range *es.getOrig() { + newMetric((*es.getOrig())[i]).CopyTo(newMetric((*dest.getOrig())[i])) } return } origs := make([]otlpmetrics.Metric, srcLen) wrappers := make([]*otlpmetrics.Metric, srcLen) - for i := range *es.orig { + for i := range *es.getOrig() { wrappers[i] = &origs[i] - newMetric((*es.orig)[i]).CopyTo(newMetric(wrappers[i])) + newMetric((*es.getOrig())[i]).CopyTo(newMetric(wrappers[i])) } - *dest.orig = wrappers + *dest.getOrig() = wrappers } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. @@ -478,61 +478,55 @@ func (es MetricSlice) CopyTo(dest MetricSlice) { // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new MetricSlice can be initialized: -// es := NewMetricSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewMetricSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es MetricSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]*otlpmetrics.Metric, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]*otlpmetrics.Metric, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty Metric. // It returns the newly added Metric. func (es MetricSlice) AppendEmpty() Metric { - *es.orig = append(*es.orig, &otlpmetrics.Metric{}) + *es.getOrig() = append(*es.getOrig(), &otlpmetrics.Metric{}) return es.At(es.Len() - 1) } // Sort sorts the Metric elements within MetricSlice given the // provided less function so that two instances of MetricSlice // can be compared. -// -// Returns the same instance to allow nicer code like: -// lessFunc := func(a, b Metric) bool { -// return a.Name() < b.Name() // choose any comparison here -// } -// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) -func (es MetricSlice) Sort(less func(a, b Metric) bool) MetricSlice { - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) - return es +func (es MetricSlice) Sort(less func(a, b Metric) bool) { + sort.SliceStable(*es.getOrig(), func(i, j int) bool { return less(es.At(i), es.At(j)) }) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es MetricSlice) MoveAndAppendTo(dest MetricSlice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es MetricSlice) RemoveIf(f func(Metric) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -541,11 +535,11 @@ func (es MetricSlice) RemoveIf(f func(Metric) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } // Metric represents one metric as a collection of datapoints. @@ -556,12 +550,15 @@ func (es MetricSlice) RemoveIf(f func(Metric) bool) { // // Must use NewMetric function to create new instances. // Important: zero-initialized instance is not valid for use. -type Metric struct { - orig *otlpmetrics.Metric -} + +type Metric internal.Metric func newMetric(orig *otlpmetrics.Metric) Metric { - return Metric{orig: orig} + return Metric(internal.NewMetric(orig)) +} + +func (ms Metric) getOrig() *otlpmetrics.Metric { + return internal.GetOrigMetric(internal.Metric(ms)) } // NewMetric creates a new empty Metric. @@ -572,152 +569,202 @@ func NewMetric() Metric { return newMetric(&otlpmetrics.Metric{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms Metric) MoveTo(dest Metric) { - *dest.orig = *ms.orig - *ms.orig = otlpmetrics.Metric{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpmetrics.Metric{} } // Name returns the name associated with this Metric. func (ms Metric) Name() string { - return (*ms.orig).Name + return ms.getOrig().Name } // SetName replaces the name associated with this Metric. func (ms Metric) SetName(v string) { - (*ms.orig).Name = v + ms.getOrig().Name = v } // Description returns the description associated with this Metric. func (ms Metric) Description() string { - return (*ms.orig).Description + return ms.getOrig().Description } // SetDescription replaces the description associated with this Metric. func (ms Metric) SetDescription(v string) { - (*ms.orig).Description = v + ms.getOrig().Description = v } // Unit returns the unit associated with this Metric. func (ms Metric) Unit() string { - return (*ms.orig).Unit + return ms.getOrig().Unit } // SetUnit replaces the unit associated with this Metric. func (ms Metric) SetUnit(v string) { - (*ms.orig).Unit = v + ms.getOrig().Unit = v } -// DataType returns the type of the data for this Metric. +// Type returns the type of the data for this Metric. // Calling this function on zero-initialized Metric will cause a panic. -func (ms Metric) DataType() MetricDataType { - switch ms.orig.Data.(type) { +func (ms Metric) Type() MetricType { + switch ms.getOrig().Data.(type) { case *otlpmetrics.Metric_Gauge: - return MetricDataTypeGauge + return MetricTypeGauge case *otlpmetrics.Metric_Sum: - return MetricDataTypeSum + return MetricTypeSum case *otlpmetrics.Metric_Histogram: - return MetricDataTypeHistogram + return MetricTypeHistogram case *otlpmetrics.Metric_ExponentialHistogram: - return MetricDataTypeExponentialHistogram + return MetricTypeExponentialHistogram case *otlpmetrics.Metric_Summary: - return MetricDataTypeSummary + return MetricTypeSummary } - return MetricDataTypeNone + return MetricTypeEmpty } // Gauge returns the gauge associated with this Metric. // -// Calling this function when DataType() != MetricDataTypeGauge returns an invalid +// Calling this function when Type() != MetricTypeGauge returns an invalid // zero-initialized instance of Gauge. Note that using such Gauge instance can cause panic. // // Calling this function on zero-initialized Metric will cause a panic. func (ms Metric) Gauge() Gauge { - v, ok := ms.orig.GetData().(*otlpmetrics.Metric_Gauge) + v, ok := ms.getOrig().GetData().(*otlpmetrics.Metric_Gauge) if !ok { return Gauge{} } return newGauge(v.Gauge) } +// SetEmptyGauge sets an empty gauge to this Metric. +// +// After this, Type() function will return MetricTypeGauge". +// +// Calling this function on zero-initialized Metric will cause a panic. +func (ms Metric) SetEmptyGauge() Gauge { + val := &otlpmetrics.Gauge{} + ms.getOrig().Data = &otlpmetrics.Metric_Gauge{Gauge: val} + return newGauge(val) +} + // Sum returns the sum associated with this Metric. // -// Calling this function when DataType() != MetricDataTypeSum returns an invalid +// Calling this function when Type() != MetricTypeSum returns an invalid // zero-initialized instance of Sum. Note that using such Sum instance can cause panic. // // Calling this function on zero-initialized Metric will cause a panic. func (ms Metric) Sum() Sum { - v, ok := ms.orig.GetData().(*otlpmetrics.Metric_Sum) + v, ok := ms.getOrig().GetData().(*otlpmetrics.Metric_Sum) if !ok { return Sum{} } return newSum(v.Sum) } +// SetEmptySum sets an empty sum to this Metric. +// +// After this, Type() function will return MetricTypeSum". +// +// Calling this function on zero-initialized Metric will cause a panic. +func (ms Metric) SetEmptySum() Sum { + val := &otlpmetrics.Sum{} + ms.getOrig().Data = &otlpmetrics.Metric_Sum{Sum: val} + return newSum(val) +} + // Histogram returns the histogram associated with this Metric. // -// Calling this function when DataType() != MetricDataTypeHistogram returns an invalid +// Calling this function when Type() != MetricTypeHistogram returns an invalid // zero-initialized instance of Histogram. Note that using such Histogram instance can cause panic. // // Calling this function on zero-initialized Metric will cause a panic. func (ms Metric) Histogram() Histogram { - v, ok := ms.orig.GetData().(*otlpmetrics.Metric_Histogram) + v, ok := ms.getOrig().GetData().(*otlpmetrics.Metric_Histogram) if !ok { return Histogram{} } return newHistogram(v.Histogram) } +// SetEmptyHistogram sets an empty histogram to this Metric. +// +// After this, Type() function will return MetricTypeHistogram". +// +// Calling this function on zero-initialized Metric will cause a panic. +func (ms Metric) SetEmptyHistogram() Histogram { + val := &otlpmetrics.Histogram{} + ms.getOrig().Data = &otlpmetrics.Metric_Histogram{Histogram: val} + return newHistogram(val) +} + // ExponentialHistogram returns the exponentialhistogram associated with this Metric. // -// Calling this function when DataType() != MetricDataTypeExponentialHistogram returns an invalid +// Calling this function when Type() != MetricTypeExponentialHistogram returns an invalid // zero-initialized instance of ExponentialHistogram. Note that using such ExponentialHistogram instance can cause panic. // // Calling this function on zero-initialized Metric will cause a panic. func (ms Metric) ExponentialHistogram() ExponentialHistogram { - v, ok := ms.orig.GetData().(*otlpmetrics.Metric_ExponentialHistogram) + v, ok := ms.getOrig().GetData().(*otlpmetrics.Metric_ExponentialHistogram) if !ok { return ExponentialHistogram{} } return newExponentialHistogram(v.ExponentialHistogram) } +// SetEmptyExponentialHistogram sets an empty exponentialhistogram to this Metric. +// +// After this, Type() function will return MetricTypeExponentialHistogram". +// +// Calling this function on zero-initialized Metric will cause a panic. +func (ms Metric) SetEmptyExponentialHistogram() ExponentialHistogram { + val := &otlpmetrics.ExponentialHistogram{} + ms.getOrig().Data = &otlpmetrics.Metric_ExponentialHistogram{ExponentialHistogram: val} + return newExponentialHistogram(val) +} + // Summary returns the summary associated with this Metric. // -// Calling this function when DataType() != MetricDataTypeSummary returns an invalid +// Calling this function when Type() != MetricTypeSummary returns an invalid // zero-initialized instance of Summary. Note that using such Summary instance can cause panic. // // Calling this function on zero-initialized Metric will cause a panic. func (ms Metric) Summary() Summary { - v, ok := ms.orig.GetData().(*otlpmetrics.Metric_Summary) + v, ok := ms.getOrig().GetData().(*otlpmetrics.Metric_Summary) if !ok { return Summary{} } return newSummary(v.Summary) } -// CopyTo copies all properties from the current struct to the dest. +// SetEmptySummary sets an empty summary to this Metric. +// +// After this, Type() function will return MetricTypeSummary". +// +// Calling this function on zero-initialized Metric will cause a panic. +func (ms Metric) SetEmptySummary() Summary { + val := &otlpmetrics.Summary{} + ms.getOrig().Data = &otlpmetrics.Metric_Summary{Summary: val} + return newSummary(val) +} + +// CopyTo copies all properties from the current struct overriding the destination. func (ms Metric) CopyTo(dest Metric) { dest.SetName(ms.Name()) dest.SetDescription(ms.Description()) dest.SetUnit(ms.Unit()) - switch ms.DataType() { - case MetricDataTypeGauge: - dest.SetDataType(MetricDataTypeGauge) - ms.Gauge().CopyTo(dest.Gauge()) - case MetricDataTypeSum: - dest.SetDataType(MetricDataTypeSum) - ms.Sum().CopyTo(dest.Sum()) - case MetricDataTypeHistogram: - dest.SetDataType(MetricDataTypeHistogram) - ms.Histogram().CopyTo(dest.Histogram()) - case MetricDataTypeExponentialHistogram: - dest.SetDataType(MetricDataTypeExponentialHistogram) - ms.ExponentialHistogram().CopyTo(dest.ExponentialHistogram()) - case MetricDataTypeSummary: - dest.SetDataType(MetricDataTypeSummary) - ms.Summary().CopyTo(dest.Summary()) + switch ms.Type() { + case MetricTypeGauge: + ms.Gauge().CopyTo(dest.SetEmptyGauge()) + case MetricTypeSum: + ms.Sum().CopyTo(dest.SetEmptySum()) + case MetricTypeHistogram: + ms.Histogram().CopyTo(dest.SetEmptyHistogram()) + case MetricTypeExponentialHistogram: + ms.ExponentialHistogram().CopyTo(dest.SetEmptyExponentialHistogram()) + case MetricTypeSummary: + ms.Summary().CopyTo(dest.SetEmptySummary()) } } @@ -729,12 +776,15 @@ func (ms Metric) CopyTo(dest Metric) { // // Must use NewGauge function to create new instances. // Important: zero-initialized instance is not valid for use. -type Gauge struct { - orig *otlpmetrics.Gauge -} + +type Gauge internal.Gauge func newGauge(orig *otlpmetrics.Gauge) Gauge { - return Gauge{orig: orig} + return Gauge(internal.NewGauge(orig)) +} + +func (ms Gauge) getOrig() *otlpmetrics.Gauge { + return internal.GetOrigGauge(internal.Gauge(ms)) } // NewGauge creates a new empty Gauge. @@ -745,19 +795,19 @@ func NewGauge() Gauge { return newGauge(&otlpmetrics.Gauge{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms Gauge) MoveTo(dest Gauge) { - *dest.orig = *ms.orig - *ms.orig = otlpmetrics.Gauge{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpmetrics.Gauge{} } // DataPoints returns the DataPoints associated with this Gauge. func (ms Gauge) DataPoints() NumberDataPointSlice { - return newNumberDataPointSlice(&(*ms.orig).DataPoints) + return NumberDataPointSlice(internal.NewNumberDataPointSlice(&ms.getOrig().DataPoints)) } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms Gauge) CopyTo(dest Gauge) { ms.DataPoints().CopyTo(dest.DataPoints()) } @@ -769,12 +819,15 @@ func (ms Gauge) CopyTo(dest Gauge) { // // Must use NewSum function to create new instances. // Important: zero-initialized instance is not valid for use. -type Sum struct { - orig *otlpmetrics.Sum -} + +type Sum internal.Sum func newSum(orig *otlpmetrics.Sum) Sum { - return Sum{orig: orig} + return Sum(internal.NewSum(orig)) +} + +func (ms Sum) getOrig() *otlpmetrics.Sum { + return internal.GetOrigSum(internal.Sum(ms)) } // NewSum creates a new empty Sum. @@ -785,39 +838,39 @@ func NewSum() Sum { return newSum(&otlpmetrics.Sum{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms Sum) MoveTo(dest Sum) { - *dest.orig = *ms.orig - *ms.orig = otlpmetrics.Sum{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpmetrics.Sum{} } // AggregationTemporality returns the aggregationtemporality associated with this Sum. -func (ms Sum) AggregationTemporality() MetricAggregationTemporality { - return MetricAggregationTemporality((*ms.orig).AggregationTemporality) +func (ms Sum) AggregationTemporality() AggregationTemporality { + return AggregationTemporality(ms.getOrig().AggregationTemporality) } // SetAggregationTemporality replaces the aggregationtemporality associated with this Sum. -func (ms Sum) SetAggregationTemporality(v MetricAggregationTemporality) { - (*ms.orig).AggregationTemporality = otlpmetrics.AggregationTemporality(v) +func (ms Sum) SetAggregationTemporality(v AggregationTemporality) { + ms.getOrig().AggregationTemporality = otlpmetrics.AggregationTemporality(v) } // IsMonotonic returns the ismonotonic associated with this Sum. func (ms Sum) IsMonotonic() bool { - return (*ms.orig).IsMonotonic + return ms.getOrig().IsMonotonic } // SetIsMonotonic replaces the ismonotonic associated with this Sum. func (ms Sum) SetIsMonotonic(v bool) { - (*ms.orig).IsMonotonic = v + ms.getOrig().IsMonotonic = v } // DataPoints returns the DataPoints associated with this Sum. func (ms Sum) DataPoints() NumberDataPointSlice { - return newNumberDataPointSlice(&(*ms.orig).DataPoints) + return NumberDataPointSlice(internal.NewNumberDataPointSlice(&ms.getOrig().DataPoints)) } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms Sum) CopyTo(dest Sum) { dest.SetAggregationTemporality(ms.AggregationTemporality()) dest.SetIsMonotonic(ms.IsMonotonic()) @@ -831,12 +884,15 @@ func (ms Sum) CopyTo(dest Sum) { // // Must use NewHistogram function to create new instances. // Important: zero-initialized instance is not valid for use. -type Histogram struct { - orig *otlpmetrics.Histogram -} + +type Histogram internal.Histogram func newHistogram(orig *otlpmetrics.Histogram) Histogram { - return Histogram{orig: orig} + return Histogram(internal.NewHistogram(orig)) +} + +func (ms Histogram) getOrig() *otlpmetrics.Histogram { + return internal.GetOrigHistogram(internal.Histogram(ms)) } // NewHistogram creates a new empty Histogram. @@ -847,29 +903,29 @@ func NewHistogram() Histogram { return newHistogram(&otlpmetrics.Histogram{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms Histogram) MoveTo(dest Histogram) { - *dest.orig = *ms.orig - *ms.orig = otlpmetrics.Histogram{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpmetrics.Histogram{} } // AggregationTemporality returns the aggregationtemporality associated with this Histogram. -func (ms Histogram) AggregationTemporality() MetricAggregationTemporality { - return MetricAggregationTemporality((*ms.orig).AggregationTemporality) +func (ms Histogram) AggregationTemporality() AggregationTemporality { + return AggregationTemporality(ms.getOrig().AggregationTemporality) } // SetAggregationTemporality replaces the aggregationtemporality associated with this Histogram. -func (ms Histogram) SetAggregationTemporality(v MetricAggregationTemporality) { - (*ms.orig).AggregationTemporality = otlpmetrics.AggregationTemporality(v) +func (ms Histogram) SetAggregationTemporality(v AggregationTemporality) { + ms.getOrig().AggregationTemporality = otlpmetrics.AggregationTemporality(v) } // DataPoints returns the DataPoints associated with this Histogram. func (ms Histogram) DataPoints() HistogramDataPointSlice { - return newHistogramDataPointSlice(&(*ms.orig).DataPoints) + return HistogramDataPointSlice(internal.NewHistogramDataPointSlice(&ms.getOrig().DataPoints)) } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms Histogram) CopyTo(dest Histogram) { dest.SetAggregationTemporality(ms.AggregationTemporality()) ms.DataPoints().CopyTo(dest.DataPoints()) @@ -883,12 +939,15 @@ func (ms Histogram) CopyTo(dest Histogram) { // // Must use NewExponentialHistogram function to create new instances. // Important: zero-initialized instance is not valid for use. -type ExponentialHistogram struct { - orig *otlpmetrics.ExponentialHistogram -} + +type ExponentialHistogram internal.ExponentialHistogram func newExponentialHistogram(orig *otlpmetrics.ExponentialHistogram) ExponentialHistogram { - return ExponentialHistogram{orig: orig} + return ExponentialHistogram(internal.NewExponentialHistogram(orig)) +} + +func (ms ExponentialHistogram) getOrig() *otlpmetrics.ExponentialHistogram { + return internal.GetOrigExponentialHistogram(internal.ExponentialHistogram(ms)) } // NewExponentialHistogram creates a new empty ExponentialHistogram. @@ -899,29 +958,29 @@ func NewExponentialHistogram() ExponentialHistogram { return newExponentialHistogram(&otlpmetrics.ExponentialHistogram{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms ExponentialHistogram) MoveTo(dest ExponentialHistogram) { - *dest.orig = *ms.orig - *ms.orig = otlpmetrics.ExponentialHistogram{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpmetrics.ExponentialHistogram{} } // AggregationTemporality returns the aggregationtemporality associated with this ExponentialHistogram. -func (ms ExponentialHistogram) AggregationTemporality() MetricAggregationTemporality { - return MetricAggregationTemporality((*ms.orig).AggregationTemporality) +func (ms ExponentialHistogram) AggregationTemporality() AggregationTemporality { + return AggregationTemporality(ms.getOrig().AggregationTemporality) } // SetAggregationTemporality replaces the aggregationtemporality associated with this ExponentialHistogram. -func (ms ExponentialHistogram) SetAggregationTemporality(v MetricAggregationTemporality) { - (*ms.orig).AggregationTemporality = otlpmetrics.AggregationTemporality(v) +func (ms ExponentialHistogram) SetAggregationTemporality(v AggregationTemporality) { + ms.getOrig().AggregationTemporality = otlpmetrics.AggregationTemporality(v) } // DataPoints returns the DataPoints associated with this ExponentialHistogram. func (ms ExponentialHistogram) DataPoints() ExponentialHistogramDataPointSlice { - return newExponentialHistogramDataPointSlice(&(*ms.orig).DataPoints) + return ExponentialHistogramDataPointSlice(internal.NewExponentialHistogramDataPointSlice(&ms.getOrig().DataPoints)) } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms ExponentialHistogram) CopyTo(dest ExponentialHistogram) { dest.SetAggregationTemporality(ms.AggregationTemporality()) ms.DataPoints().CopyTo(dest.DataPoints()) @@ -934,12 +993,15 @@ func (ms ExponentialHistogram) CopyTo(dest ExponentialHistogram) { // // Must use NewSummary function to create new instances. // Important: zero-initialized instance is not valid for use. -type Summary struct { - orig *otlpmetrics.Summary -} + +type Summary internal.Summary func newSummary(orig *otlpmetrics.Summary) Summary { - return Summary{orig: orig} + return Summary(internal.NewSummary(orig)) +} + +func (ms Summary) getOrig() *otlpmetrics.Summary { + return internal.GetOrigSummary(internal.Summary(ms)) } // NewSummary creates a new empty Summary. @@ -950,19 +1012,19 @@ func NewSummary() Summary { return newSummary(&otlpmetrics.Summary{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms Summary) MoveTo(dest Summary) { - *dest.orig = *ms.orig - *ms.orig = otlpmetrics.Summary{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpmetrics.Summary{} } // DataPoints returns the DataPoints associated with this Summary. func (ms Summary) DataPoints() SummaryDataPointSlice { - return newSummaryDataPointSlice(&(*ms.orig).DataPoints) + return SummaryDataPointSlice(internal.NewSummaryDataPointSlice(&ms.getOrig().DataPoints)) } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms Summary) CopyTo(dest Summary) { ms.DataPoints().CopyTo(dest.DataPoints()) } @@ -974,59 +1036,60 @@ func (ms Summary) CopyTo(dest Summary) { // // Must use NewNumberDataPointSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type NumberDataPointSlice struct { - // orig points to the slice otlpmetrics.NumberDataPoint field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]*otlpmetrics.NumberDataPoint -} +type NumberDataPointSlice internal.NumberDataPointSlice func newNumberDataPointSlice(orig *[]*otlpmetrics.NumberDataPoint) NumberDataPointSlice { - return NumberDataPointSlice{orig} + return NumberDataPointSlice(internal.NewNumberDataPointSlice(orig)) +} + +func (ms NumberDataPointSlice) getOrig() *[]*otlpmetrics.NumberDataPoint { + return internal.GetOrigNumberDataPointSlice(internal.NumberDataPointSlice(ms)) } // NewNumberDataPointSlice creates a NumberDataPointSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewNumberDataPointSlice() NumberDataPointSlice { orig := []*otlpmetrics.NumberDataPoint(nil) - return NumberDataPointSlice{&orig} + return newNumberDataPointSlice(&orig) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewNumberDataPointSlice()". func (es NumberDataPointSlice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es NumberDataPointSlice) At(ix int) NumberDataPoint { - return newNumberDataPoint((*es.orig)[ix]) + return newNumberDataPoint((*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es NumberDataPointSlice) CopyTo(dest NumberDataPointSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newNumberDataPoint((*es.orig)[i]).CopyTo(newNumberDataPoint((*dest.orig)[i])) + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] + for i := range *es.getOrig() { + newNumberDataPoint((*es.getOrig())[i]).CopyTo(newNumberDataPoint((*dest.getOrig())[i])) } return } origs := make([]otlpmetrics.NumberDataPoint, srcLen) wrappers := make([]*otlpmetrics.NumberDataPoint, srcLen) - for i := range *es.orig { + for i := range *es.getOrig() { wrappers[i] = &origs[i] - newNumberDataPoint((*es.orig)[i]).CopyTo(newNumberDataPoint(wrappers[i])) + newNumberDataPoint((*es.getOrig())[i]).CopyTo(newNumberDataPoint(wrappers[i])) } - *dest.orig = wrappers + *dest.getOrig() = wrappers } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. @@ -1034,61 +1097,55 @@ func (es NumberDataPointSlice) CopyTo(dest NumberDataPointSlice) { // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new NumberDataPointSlice can be initialized: -// es := NewNumberDataPointSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewNumberDataPointSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es NumberDataPointSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]*otlpmetrics.NumberDataPoint, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]*otlpmetrics.NumberDataPoint, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty NumberDataPoint. // It returns the newly added NumberDataPoint. func (es NumberDataPointSlice) AppendEmpty() NumberDataPoint { - *es.orig = append(*es.orig, &otlpmetrics.NumberDataPoint{}) + *es.getOrig() = append(*es.getOrig(), &otlpmetrics.NumberDataPoint{}) return es.At(es.Len() - 1) } // Sort sorts the NumberDataPoint elements within NumberDataPointSlice given the // provided less function so that two instances of NumberDataPointSlice // can be compared. -// -// Returns the same instance to allow nicer code like: -// lessFunc := func(a, b NumberDataPoint) bool { -// return a.Name() < b.Name() // choose any comparison here -// } -// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) -func (es NumberDataPointSlice) Sort(less func(a, b NumberDataPoint) bool) NumberDataPointSlice { - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) - return es +func (es NumberDataPointSlice) Sort(less func(a, b NumberDataPoint) bool) { + sort.SliceStable(*es.getOrig(), func(i, j int) bool { return less(es.At(i), es.At(j)) }) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es NumberDataPointSlice) MoveAndAppendTo(dest NumberDataPointSlice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es NumberDataPointSlice) RemoveIf(f func(NumberDataPoint) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -1097,11 +1154,11 @@ func (es NumberDataPointSlice) RemoveIf(f func(NumberDataPoint) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } // NumberDataPoint is a single data point in a timeseries that describes the time-varying value of a number metric. @@ -1111,12 +1168,15 @@ func (es NumberDataPointSlice) RemoveIf(f func(NumberDataPoint) bool) { // // Must use NewNumberDataPoint function to create new instances. // Important: zero-initialized instance is not valid for use. -type NumberDataPoint struct { - orig *otlpmetrics.NumberDataPoint -} + +type NumberDataPoint internal.NumberDataPoint func newNumberDataPoint(orig *otlpmetrics.NumberDataPoint) NumberDataPoint { - return NumberDataPoint{orig: orig} + return NumberDataPoint(internal.NewNumberDataPoint(orig)) +} + +func (ms NumberDataPoint) getOrig() *otlpmetrics.NumberDataPoint { + return internal.GetOrigNumberDataPoint(internal.NumberDataPoint(ms)) } // NewNumberDataPoint creates a new empty NumberDataPoint. @@ -1127,98 +1187,103 @@ func NewNumberDataPoint() NumberDataPoint { return newNumberDataPoint(&otlpmetrics.NumberDataPoint{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms NumberDataPoint) MoveTo(dest NumberDataPoint) { - *dest.orig = *ms.orig - *ms.orig = otlpmetrics.NumberDataPoint{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpmetrics.NumberDataPoint{} } // Attributes returns the Attributes associated with this NumberDataPoint. -func (ms NumberDataPoint) Attributes() Map { - return newMap(&(*ms.orig).Attributes) +func (ms NumberDataPoint) Attributes() pcommon.Map { + return pcommon.Map(internal.NewMap(&ms.getOrig().Attributes)) } // StartTimestamp returns the starttimestamp associated with this NumberDataPoint. -func (ms NumberDataPoint) StartTimestamp() Timestamp { - return Timestamp((*ms.orig).StartTimeUnixNano) +func (ms NumberDataPoint) StartTimestamp() pcommon.Timestamp { + return pcommon.Timestamp(ms.getOrig().StartTimeUnixNano) } // SetStartTimestamp replaces the starttimestamp associated with this NumberDataPoint. -func (ms NumberDataPoint) SetStartTimestamp(v Timestamp) { - (*ms.orig).StartTimeUnixNano = uint64(v) +func (ms NumberDataPoint) SetStartTimestamp(v pcommon.Timestamp) { + ms.getOrig().StartTimeUnixNano = uint64(v) } // Timestamp returns the timestamp associated with this NumberDataPoint. -func (ms NumberDataPoint) Timestamp() Timestamp { - return Timestamp((*ms.orig).TimeUnixNano) +func (ms NumberDataPoint) Timestamp() pcommon.Timestamp { + return pcommon.Timestamp(ms.getOrig().TimeUnixNano) } // SetTimestamp replaces the timestamp associated with this NumberDataPoint. -func (ms NumberDataPoint) SetTimestamp(v Timestamp) { - (*ms.orig).TimeUnixNano = uint64(v) +func (ms NumberDataPoint) SetTimestamp(v pcommon.Timestamp) { + ms.getOrig().TimeUnixNano = uint64(v) } // ValueType returns the type of the value for this NumberDataPoint. // Calling this function on zero-initialized NumberDataPoint will cause a panic. func (ms NumberDataPoint) ValueType() NumberDataPointValueType { - switch ms.orig.Value.(type) { + switch ms.getOrig().Value.(type) { case *otlpmetrics.NumberDataPoint_AsDouble: return NumberDataPointValueTypeDouble case *otlpmetrics.NumberDataPoint_AsInt: return NumberDataPointValueTypeInt } - return NumberDataPointValueTypeNone + return NumberDataPointValueTypeEmpty } -// DoubleVal returns the doubleval associated with this NumberDataPoint. -func (ms NumberDataPoint) DoubleVal() float64 { - return (*ms.orig).GetAsDouble() +// DoubleValue returns the double associated with this NumberDataPoint. +func (ms NumberDataPoint) DoubleValue() float64 { + return ms.getOrig().GetAsDouble() } -// SetDoubleVal replaces the doubleval associated with this NumberDataPoint. -func (ms NumberDataPoint) SetDoubleVal(v float64) { - (*ms.orig).Value = &otlpmetrics.NumberDataPoint_AsDouble{ +// SetDoubleValue replaces the double associated with this NumberDataPoint. +func (ms NumberDataPoint) SetDoubleValue(v float64) { + ms.getOrig().Value = &otlpmetrics.NumberDataPoint_AsDouble{ AsDouble: v, } } -// IntVal returns the intval associated with this NumberDataPoint. -func (ms NumberDataPoint) IntVal() int64 { - return (*ms.orig).GetAsInt() +// IntValue returns the int associated with this NumberDataPoint. +func (ms NumberDataPoint) IntValue() int64 { + return ms.getOrig().GetAsInt() } -// SetIntVal replaces the intval associated with this NumberDataPoint. -func (ms NumberDataPoint) SetIntVal(v int64) { - (*ms.orig).Value = &otlpmetrics.NumberDataPoint_AsInt{ +// SetIntValue replaces the int associated with this NumberDataPoint. +func (ms NumberDataPoint) SetIntValue(v int64) { + ms.getOrig().Value = &otlpmetrics.NumberDataPoint_AsInt{ AsInt: v, } } // Exemplars returns the Exemplars associated with this NumberDataPoint. func (ms NumberDataPoint) Exemplars() ExemplarSlice { - return newExemplarSlice(&(*ms.orig).Exemplars) + return ExemplarSlice(internal.NewExemplarSlice(&ms.getOrig().Exemplars)) +} + +// Flags returns the flags associated with this NumberDataPoint. +func (ms NumberDataPoint) Flags() DataPointFlags { + return DataPointFlags(ms.getOrig().Flags) } -// FlagsStruct returns the flagsstruct associated with this NumberDataPoint. -func (ms NumberDataPoint) FlagsStruct() MetricDataPointFlagsStruct { - return newMetricDataPointFlagsStruct(&(*ms.orig).Flags) +// SetFlags replaces the flags associated with this NumberDataPoint. +func (ms NumberDataPoint) SetFlags(v DataPointFlags) { + ms.getOrig().Flags = uint32(v) } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms NumberDataPoint) CopyTo(dest NumberDataPoint) { ms.Attributes().CopyTo(dest.Attributes()) dest.SetStartTimestamp(ms.StartTimestamp()) dest.SetTimestamp(ms.Timestamp()) switch ms.ValueType() { case NumberDataPointValueTypeDouble: - dest.SetDoubleVal(ms.DoubleVal()) + dest.SetDoubleValue(ms.DoubleValue()) case NumberDataPointValueTypeInt: - dest.SetIntVal(ms.IntVal()) + dest.SetIntValue(ms.IntValue()) } ms.Exemplars().CopyTo(dest.Exemplars()) - ms.FlagsStruct().CopyTo(dest.FlagsStruct()) + dest.SetFlags(ms.Flags()) } // HistogramDataPointSlice logically represents a slice of HistogramDataPoint. @@ -1228,59 +1293,60 @@ func (ms NumberDataPoint) CopyTo(dest NumberDataPoint) { // // Must use NewHistogramDataPointSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type HistogramDataPointSlice struct { - // orig points to the slice otlpmetrics.HistogramDataPoint field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]*otlpmetrics.HistogramDataPoint -} +type HistogramDataPointSlice internal.HistogramDataPointSlice func newHistogramDataPointSlice(orig *[]*otlpmetrics.HistogramDataPoint) HistogramDataPointSlice { - return HistogramDataPointSlice{orig} + return HistogramDataPointSlice(internal.NewHistogramDataPointSlice(orig)) +} + +func (ms HistogramDataPointSlice) getOrig() *[]*otlpmetrics.HistogramDataPoint { + return internal.GetOrigHistogramDataPointSlice(internal.HistogramDataPointSlice(ms)) } // NewHistogramDataPointSlice creates a HistogramDataPointSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewHistogramDataPointSlice() HistogramDataPointSlice { orig := []*otlpmetrics.HistogramDataPoint(nil) - return HistogramDataPointSlice{&orig} + return newHistogramDataPointSlice(&orig) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewHistogramDataPointSlice()". func (es HistogramDataPointSlice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es HistogramDataPointSlice) At(ix int) HistogramDataPoint { - return newHistogramDataPoint((*es.orig)[ix]) + return newHistogramDataPoint((*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es HistogramDataPointSlice) CopyTo(dest HistogramDataPointSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newHistogramDataPoint((*es.orig)[i]).CopyTo(newHistogramDataPoint((*dest.orig)[i])) + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] + for i := range *es.getOrig() { + newHistogramDataPoint((*es.getOrig())[i]).CopyTo(newHistogramDataPoint((*dest.getOrig())[i])) } return } origs := make([]otlpmetrics.HistogramDataPoint, srcLen) wrappers := make([]*otlpmetrics.HistogramDataPoint, srcLen) - for i := range *es.orig { + for i := range *es.getOrig() { wrappers[i] = &origs[i] - newHistogramDataPoint((*es.orig)[i]).CopyTo(newHistogramDataPoint(wrappers[i])) + newHistogramDataPoint((*es.getOrig())[i]).CopyTo(newHistogramDataPoint(wrappers[i])) } - *dest.orig = wrappers + *dest.getOrig() = wrappers } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. @@ -1288,61 +1354,55 @@ func (es HistogramDataPointSlice) CopyTo(dest HistogramDataPointSlice) { // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new HistogramDataPointSlice can be initialized: -// es := NewHistogramDataPointSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewHistogramDataPointSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es HistogramDataPointSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]*otlpmetrics.HistogramDataPoint, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]*otlpmetrics.HistogramDataPoint, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty HistogramDataPoint. // It returns the newly added HistogramDataPoint. func (es HistogramDataPointSlice) AppendEmpty() HistogramDataPoint { - *es.orig = append(*es.orig, &otlpmetrics.HistogramDataPoint{}) + *es.getOrig() = append(*es.getOrig(), &otlpmetrics.HistogramDataPoint{}) return es.At(es.Len() - 1) } // Sort sorts the HistogramDataPoint elements within HistogramDataPointSlice given the // provided less function so that two instances of HistogramDataPointSlice // can be compared. -// -// Returns the same instance to allow nicer code like: -// lessFunc := func(a, b HistogramDataPoint) bool { -// return a.Name() < b.Name() // choose any comparison here -// } -// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) -func (es HistogramDataPointSlice) Sort(less func(a, b HistogramDataPoint) bool) HistogramDataPointSlice { - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) - return es +func (es HistogramDataPointSlice) Sort(less func(a, b HistogramDataPoint) bool) { + sort.SliceStable(*es.getOrig(), func(i, j int) bool { return less(es.At(i), es.At(j)) }) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es HistogramDataPointSlice) MoveAndAppendTo(dest HistogramDataPointSlice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es HistogramDataPointSlice) RemoveIf(f func(HistogramDataPoint) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -1351,11 +1411,11 @@ func (es HistogramDataPointSlice) RemoveIf(f func(HistogramDataPoint) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } // HistogramDataPoint is a single data point in a timeseries that describes the time-varying values of a Histogram of values. @@ -1365,12 +1425,15 @@ func (es HistogramDataPointSlice) RemoveIf(f func(HistogramDataPoint) bool) { // // Must use NewHistogramDataPoint function to create new instances. // Important: zero-initialized instance is not valid for use. -type HistogramDataPoint struct { - orig *otlpmetrics.HistogramDataPoint -} + +type HistogramDataPoint internal.HistogramDataPoint func newHistogramDataPoint(orig *otlpmetrics.HistogramDataPoint) HistogramDataPoint { - return HistogramDataPoint{orig: orig} + return HistogramDataPoint(internal.NewHistogramDataPoint(orig)) +} + +func (ms HistogramDataPoint) getOrig() *otlpmetrics.HistogramDataPoint { + return internal.GetOrigHistogramDataPoint(internal.HistogramDataPoint(ms)) } // NewHistogramDataPoint creates a new empty HistogramDataPoint. @@ -1381,127 +1444,137 @@ func NewHistogramDataPoint() HistogramDataPoint { return newHistogramDataPoint(&otlpmetrics.HistogramDataPoint{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms HistogramDataPoint) MoveTo(dest HistogramDataPoint) { - *dest.orig = *ms.orig - *ms.orig = otlpmetrics.HistogramDataPoint{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpmetrics.HistogramDataPoint{} } // Attributes returns the Attributes associated with this HistogramDataPoint. -func (ms HistogramDataPoint) Attributes() Map { - return newMap(&(*ms.orig).Attributes) +func (ms HistogramDataPoint) Attributes() pcommon.Map { + return pcommon.Map(internal.NewMap(&ms.getOrig().Attributes)) } // StartTimestamp returns the starttimestamp associated with this HistogramDataPoint. -func (ms HistogramDataPoint) StartTimestamp() Timestamp { - return Timestamp((*ms.orig).StartTimeUnixNano) +func (ms HistogramDataPoint) StartTimestamp() pcommon.Timestamp { + return pcommon.Timestamp(ms.getOrig().StartTimeUnixNano) } // SetStartTimestamp replaces the starttimestamp associated with this HistogramDataPoint. -func (ms HistogramDataPoint) SetStartTimestamp(v Timestamp) { - (*ms.orig).StartTimeUnixNano = uint64(v) +func (ms HistogramDataPoint) SetStartTimestamp(v pcommon.Timestamp) { + ms.getOrig().StartTimeUnixNano = uint64(v) } // Timestamp returns the timestamp associated with this HistogramDataPoint. -func (ms HistogramDataPoint) Timestamp() Timestamp { - return Timestamp((*ms.orig).TimeUnixNano) +func (ms HistogramDataPoint) Timestamp() pcommon.Timestamp { + return pcommon.Timestamp(ms.getOrig().TimeUnixNano) } // SetTimestamp replaces the timestamp associated with this HistogramDataPoint. -func (ms HistogramDataPoint) SetTimestamp(v Timestamp) { - (*ms.orig).TimeUnixNano = uint64(v) +func (ms HistogramDataPoint) SetTimestamp(v pcommon.Timestamp) { + ms.getOrig().TimeUnixNano = uint64(v) } // Count returns the count associated with this HistogramDataPoint. func (ms HistogramDataPoint) Count() uint64 { - return (*ms.orig).Count + return ms.getOrig().Count } // SetCount replaces the count associated with this HistogramDataPoint. func (ms HistogramDataPoint) SetCount(v uint64) { - (*ms.orig).Count = v + ms.getOrig().Count = v } // Sum returns the sum associated with this HistogramDataPoint. func (ms HistogramDataPoint) Sum() float64 { - return (*ms.orig).GetSum() + return ms.getOrig().GetSum() } // HasSum returns true if the HistogramDataPoint contains a // Sum value, false otherwise. func (ms HistogramDataPoint) HasSum() bool { - return ms.orig.Sum_ != nil + return ms.getOrig().Sum_ != nil } // SetSum replaces the sum associated with this HistogramDataPoint. func (ms HistogramDataPoint) SetSum(v float64) { - (*ms.orig).Sum_ = &otlpmetrics.HistogramDataPoint_Sum{Sum: v} + ms.getOrig().Sum_ = &otlpmetrics.HistogramDataPoint_Sum{Sum: v} } -// BucketCounts returns the bucketcounts associated with this HistogramDataPoint. -func (ms HistogramDataPoint) BucketCounts() ImmutableUInt64Slice { - return ImmutableUInt64Slice{value: (*ms.orig).BucketCounts} +// RemoveSum removes the sum associated with this HistogramDataPoint. +func (ms HistogramDataPoint) RemoveSum() { + ms.getOrig().Sum_ = nil } -// SetBucketCounts replaces the bucketcounts associated with this HistogramDataPoint. -func (ms HistogramDataPoint) SetBucketCounts(v ImmutableUInt64Slice) { - (*ms.orig).BucketCounts = v.value +// BucketCounts returns the bucketcounts associated with this HistogramDataPoint. +func (ms HistogramDataPoint) BucketCounts() pcommon.UInt64Slice { + return pcommon.UInt64Slice(internal.NewUInt64Slice(&ms.getOrig().BucketCounts)) } // ExplicitBounds returns the explicitbounds associated with this HistogramDataPoint. -func (ms HistogramDataPoint) ExplicitBounds() ImmutableFloat64Slice { - return ImmutableFloat64Slice{value: (*ms.orig).ExplicitBounds} -} - -// SetExplicitBounds replaces the explicitbounds associated with this HistogramDataPoint. -func (ms HistogramDataPoint) SetExplicitBounds(v ImmutableFloat64Slice) { - (*ms.orig).ExplicitBounds = v.value +func (ms HistogramDataPoint) ExplicitBounds() pcommon.Float64Slice { + return pcommon.Float64Slice(internal.NewFloat64Slice(&ms.getOrig().ExplicitBounds)) } // Exemplars returns the Exemplars associated with this HistogramDataPoint. func (ms HistogramDataPoint) Exemplars() ExemplarSlice { - return newExemplarSlice(&(*ms.orig).Exemplars) + return ExemplarSlice(internal.NewExemplarSlice(&ms.getOrig().Exemplars)) } -// FlagsStruct returns the flagsstruct associated with this HistogramDataPoint. -func (ms HistogramDataPoint) FlagsStruct() MetricDataPointFlagsStruct { - return newMetricDataPointFlagsStruct(&(*ms.orig).Flags) +// Flags returns the flags associated with this HistogramDataPoint. +func (ms HistogramDataPoint) Flags() DataPointFlags { + return DataPointFlags(ms.getOrig().Flags) +} + +// SetFlags replaces the flags associated with this HistogramDataPoint. +func (ms HistogramDataPoint) SetFlags(v DataPointFlags) { + ms.getOrig().Flags = uint32(v) } // Min returns the min associated with this HistogramDataPoint. func (ms HistogramDataPoint) Min() float64 { - return (*ms.orig).GetMin() + return ms.getOrig().GetMin() } // HasMin returns true if the HistogramDataPoint contains a // Min value, false otherwise. func (ms HistogramDataPoint) HasMin() bool { - return ms.orig.Min_ != nil + return ms.getOrig().Min_ != nil } // SetMin replaces the min associated with this HistogramDataPoint. func (ms HistogramDataPoint) SetMin(v float64) { - (*ms.orig).Min_ = &otlpmetrics.HistogramDataPoint_Min{Min: v} + ms.getOrig().Min_ = &otlpmetrics.HistogramDataPoint_Min{Min: v} +} + +// RemoveMin removes the min associated with this HistogramDataPoint. +func (ms HistogramDataPoint) RemoveMin() { + ms.getOrig().Min_ = nil } // Max returns the max associated with this HistogramDataPoint. func (ms HistogramDataPoint) Max() float64 { - return (*ms.orig).GetMax() + return ms.getOrig().GetMax() } // HasMax returns true if the HistogramDataPoint contains a // Max value, false otherwise. func (ms HistogramDataPoint) HasMax() bool { - return ms.orig.Max_ != nil + return ms.getOrig().Max_ != nil } // SetMax replaces the max associated with this HistogramDataPoint. func (ms HistogramDataPoint) SetMax(v float64) { - (*ms.orig).Max_ = &otlpmetrics.HistogramDataPoint_Max{Max: v} + ms.getOrig().Max_ = &otlpmetrics.HistogramDataPoint_Max{Max: v} +} + +// RemoveMax removes the max associated with this HistogramDataPoint. +func (ms HistogramDataPoint) RemoveMax() { + ms.getOrig().Max_ = nil } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms HistogramDataPoint) CopyTo(dest HistogramDataPoint) { ms.Attributes().CopyTo(dest.Attributes()) dest.SetStartTimestamp(ms.StartTimestamp()) @@ -1511,22 +1584,10 @@ func (ms HistogramDataPoint) CopyTo(dest HistogramDataPoint) { dest.SetSum(ms.Sum()) } - if len(ms.orig.BucketCounts) == 0 { - dest.orig.BucketCounts = nil - } else { - dest.orig.BucketCounts = make([]uint64, len(ms.orig.BucketCounts)) - copy(dest.orig.BucketCounts, ms.orig.BucketCounts) - } - - if len(ms.orig.ExplicitBounds) == 0 { - dest.orig.ExplicitBounds = nil - } else { - dest.orig.ExplicitBounds = make([]float64, len(ms.orig.ExplicitBounds)) - copy(dest.orig.ExplicitBounds, ms.orig.ExplicitBounds) - } - + ms.BucketCounts().CopyTo(dest.BucketCounts()) + ms.ExplicitBounds().CopyTo(dest.ExplicitBounds()) ms.Exemplars().CopyTo(dest.Exemplars()) - ms.FlagsStruct().CopyTo(dest.FlagsStruct()) + dest.SetFlags(ms.Flags()) if ms.HasMin() { dest.SetMin(ms.Min()) } @@ -1544,59 +1605,60 @@ func (ms HistogramDataPoint) CopyTo(dest HistogramDataPoint) { // // Must use NewExponentialHistogramDataPointSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type ExponentialHistogramDataPointSlice struct { - // orig points to the slice otlpmetrics.ExponentialHistogramDataPoint field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]*otlpmetrics.ExponentialHistogramDataPoint -} +type ExponentialHistogramDataPointSlice internal.ExponentialHistogramDataPointSlice func newExponentialHistogramDataPointSlice(orig *[]*otlpmetrics.ExponentialHistogramDataPoint) ExponentialHistogramDataPointSlice { - return ExponentialHistogramDataPointSlice{orig} + return ExponentialHistogramDataPointSlice(internal.NewExponentialHistogramDataPointSlice(orig)) +} + +func (ms ExponentialHistogramDataPointSlice) getOrig() *[]*otlpmetrics.ExponentialHistogramDataPoint { + return internal.GetOrigExponentialHistogramDataPointSlice(internal.ExponentialHistogramDataPointSlice(ms)) } // NewExponentialHistogramDataPointSlice creates a ExponentialHistogramDataPointSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewExponentialHistogramDataPointSlice() ExponentialHistogramDataPointSlice { orig := []*otlpmetrics.ExponentialHistogramDataPoint(nil) - return ExponentialHistogramDataPointSlice{&orig} + return newExponentialHistogramDataPointSlice(&orig) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewExponentialHistogramDataPointSlice()". func (es ExponentialHistogramDataPointSlice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es ExponentialHistogramDataPointSlice) At(ix int) ExponentialHistogramDataPoint { - return newExponentialHistogramDataPoint((*es.orig)[ix]) + return newExponentialHistogramDataPoint((*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es ExponentialHistogramDataPointSlice) CopyTo(dest ExponentialHistogramDataPointSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newExponentialHistogramDataPoint((*es.orig)[i]).CopyTo(newExponentialHistogramDataPoint((*dest.orig)[i])) + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] + for i := range *es.getOrig() { + newExponentialHistogramDataPoint((*es.getOrig())[i]).CopyTo(newExponentialHistogramDataPoint((*dest.getOrig())[i])) } return } origs := make([]otlpmetrics.ExponentialHistogramDataPoint, srcLen) wrappers := make([]*otlpmetrics.ExponentialHistogramDataPoint, srcLen) - for i := range *es.orig { + for i := range *es.getOrig() { wrappers[i] = &origs[i] - newExponentialHistogramDataPoint((*es.orig)[i]).CopyTo(newExponentialHistogramDataPoint(wrappers[i])) + newExponentialHistogramDataPoint((*es.getOrig())[i]).CopyTo(newExponentialHistogramDataPoint(wrappers[i])) } - *dest.orig = wrappers + *dest.getOrig() = wrappers } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. @@ -1604,61 +1666,55 @@ func (es ExponentialHistogramDataPointSlice) CopyTo(dest ExponentialHistogramDat // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new ExponentialHistogramDataPointSlice can be initialized: -// es := NewExponentialHistogramDataPointSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewExponentialHistogramDataPointSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es ExponentialHistogramDataPointSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]*otlpmetrics.ExponentialHistogramDataPoint, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]*otlpmetrics.ExponentialHistogramDataPoint, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty ExponentialHistogramDataPoint. // It returns the newly added ExponentialHistogramDataPoint. func (es ExponentialHistogramDataPointSlice) AppendEmpty() ExponentialHistogramDataPoint { - *es.orig = append(*es.orig, &otlpmetrics.ExponentialHistogramDataPoint{}) + *es.getOrig() = append(*es.getOrig(), &otlpmetrics.ExponentialHistogramDataPoint{}) return es.At(es.Len() - 1) } // Sort sorts the ExponentialHistogramDataPoint elements within ExponentialHistogramDataPointSlice given the // provided less function so that two instances of ExponentialHistogramDataPointSlice // can be compared. -// -// Returns the same instance to allow nicer code like: -// lessFunc := func(a, b ExponentialHistogramDataPoint) bool { -// return a.Name() < b.Name() // choose any comparison here -// } -// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) -func (es ExponentialHistogramDataPointSlice) Sort(less func(a, b ExponentialHistogramDataPoint) bool) ExponentialHistogramDataPointSlice { - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) - return es +func (es ExponentialHistogramDataPointSlice) Sort(less func(a, b ExponentialHistogramDataPoint) bool) { + sort.SliceStable(*es.getOrig(), func(i, j int) bool { return less(es.At(i), es.At(j)) }) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es ExponentialHistogramDataPointSlice) MoveAndAppendTo(dest ExponentialHistogramDataPointSlice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es ExponentialHistogramDataPointSlice) RemoveIf(f func(ExponentialHistogramDataPoint) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -1667,11 +1723,11 @@ func (es ExponentialHistogramDataPointSlice) RemoveIf(f func(ExponentialHistogra newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } // ExponentialHistogramDataPoint is a single data point in a timeseries that describes the @@ -1684,12 +1740,15 @@ func (es ExponentialHistogramDataPointSlice) RemoveIf(f func(ExponentialHistogra // // Must use NewExponentialHistogramDataPoint function to create new instances. // Important: zero-initialized instance is not valid for use. -type ExponentialHistogramDataPoint struct { - orig *otlpmetrics.ExponentialHistogramDataPoint -} + +type ExponentialHistogramDataPoint internal.ExponentialHistogramDataPoint func newExponentialHistogramDataPoint(orig *otlpmetrics.ExponentialHistogramDataPoint) ExponentialHistogramDataPoint { - return ExponentialHistogramDataPoint{orig: orig} + return ExponentialHistogramDataPoint(internal.NewExponentialHistogramDataPoint(orig)) +} + +func (ms ExponentialHistogramDataPoint) getOrig() *otlpmetrics.ExponentialHistogramDataPoint { + return internal.GetOrigExponentialHistogramDataPoint(internal.ExponentialHistogramDataPoint(ms)) } // NewExponentialHistogramDataPoint creates a new empty ExponentialHistogramDataPoint. @@ -1700,137 +1759,157 @@ func NewExponentialHistogramDataPoint() ExponentialHistogramDataPoint { return newExponentialHistogramDataPoint(&otlpmetrics.ExponentialHistogramDataPoint{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms ExponentialHistogramDataPoint) MoveTo(dest ExponentialHistogramDataPoint) { - *dest.orig = *ms.orig - *ms.orig = otlpmetrics.ExponentialHistogramDataPoint{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpmetrics.ExponentialHistogramDataPoint{} } // Attributes returns the Attributes associated with this ExponentialHistogramDataPoint. -func (ms ExponentialHistogramDataPoint) Attributes() Map { - return newMap(&(*ms.orig).Attributes) +func (ms ExponentialHistogramDataPoint) Attributes() pcommon.Map { + return pcommon.Map(internal.NewMap(&ms.getOrig().Attributes)) } // StartTimestamp returns the starttimestamp associated with this ExponentialHistogramDataPoint. -func (ms ExponentialHistogramDataPoint) StartTimestamp() Timestamp { - return Timestamp((*ms.orig).StartTimeUnixNano) +func (ms ExponentialHistogramDataPoint) StartTimestamp() pcommon.Timestamp { + return pcommon.Timestamp(ms.getOrig().StartTimeUnixNano) } // SetStartTimestamp replaces the starttimestamp associated with this ExponentialHistogramDataPoint. -func (ms ExponentialHistogramDataPoint) SetStartTimestamp(v Timestamp) { - (*ms.orig).StartTimeUnixNano = uint64(v) +func (ms ExponentialHistogramDataPoint) SetStartTimestamp(v pcommon.Timestamp) { + ms.getOrig().StartTimeUnixNano = uint64(v) } // Timestamp returns the timestamp associated with this ExponentialHistogramDataPoint. -func (ms ExponentialHistogramDataPoint) Timestamp() Timestamp { - return Timestamp((*ms.orig).TimeUnixNano) +func (ms ExponentialHistogramDataPoint) Timestamp() pcommon.Timestamp { + return pcommon.Timestamp(ms.getOrig().TimeUnixNano) } // SetTimestamp replaces the timestamp associated with this ExponentialHistogramDataPoint. -func (ms ExponentialHistogramDataPoint) SetTimestamp(v Timestamp) { - (*ms.orig).TimeUnixNano = uint64(v) +func (ms ExponentialHistogramDataPoint) SetTimestamp(v pcommon.Timestamp) { + ms.getOrig().TimeUnixNano = uint64(v) } // Count returns the count associated with this ExponentialHistogramDataPoint. func (ms ExponentialHistogramDataPoint) Count() uint64 { - return (*ms.orig).Count + return ms.getOrig().Count } // SetCount replaces the count associated with this ExponentialHistogramDataPoint. func (ms ExponentialHistogramDataPoint) SetCount(v uint64) { - (*ms.orig).Count = v + ms.getOrig().Count = v } // Sum returns the sum associated with this ExponentialHistogramDataPoint. func (ms ExponentialHistogramDataPoint) Sum() float64 { - return (*ms.orig).GetSum() + return ms.getOrig().GetSum() } // HasSum returns true if the ExponentialHistogramDataPoint contains a // Sum value, false otherwise. func (ms ExponentialHistogramDataPoint) HasSum() bool { - return ms.orig.Sum_ != nil + return ms.getOrig().Sum_ != nil } // SetSum replaces the sum associated with this ExponentialHistogramDataPoint. func (ms ExponentialHistogramDataPoint) SetSum(v float64) { - (*ms.orig).Sum_ = &otlpmetrics.ExponentialHistogramDataPoint_Sum{Sum: v} + ms.getOrig().Sum_ = &otlpmetrics.ExponentialHistogramDataPoint_Sum{Sum: v} +} + +// RemoveSum removes the sum associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) RemoveSum() { + ms.getOrig().Sum_ = nil } // Scale returns the scale associated with this ExponentialHistogramDataPoint. func (ms ExponentialHistogramDataPoint) Scale() int32 { - return int32((*ms.orig).Scale) + return ms.getOrig().Scale } // SetScale replaces the scale associated with this ExponentialHistogramDataPoint. func (ms ExponentialHistogramDataPoint) SetScale(v int32) { - (*ms.orig).Scale = int32(v) + ms.getOrig().Scale = v } // ZeroCount returns the zerocount associated with this ExponentialHistogramDataPoint. func (ms ExponentialHistogramDataPoint) ZeroCount() uint64 { - return uint64((*ms.orig).ZeroCount) + return ms.getOrig().ZeroCount } // SetZeroCount replaces the zerocount associated with this ExponentialHistogramDataPoint. func (ms ExponentialHistogramDataPoint) SetZeroCount(v uint64) { - (*ms.orig).ZeroCount = uint64(v) + ms.getOrig().ZeroCount = v } // Positive returns the positive associated with this ExponentialHistogramDataPoint. -func (ms ExponentialHistogramDataPoint) Positive() Buckets { - return newBuckets(&(*ms.orig).Positive) +func (ms ExponentialHistogramDataPoint) Positive() ExponentialHistogramDataPointBuckets { + return ExponentialHistogramDataPointBuckets(internal.NewExponentialHistogramDataPointBuckets(&ms.getOrig().Positive)) } // Negative returns the negative associated with this ExponentialHistogramDataPoint. -func (ms ExponentialHistogramDataPoint) Negative() Buckets { - return newBuckets(&(*ms.orig).Negative) +func (ms ExponentialHistogramDataPoint) Negative() ExponentialHistogramDataPointBuckets { + return ExponentialHistogramDataPointBuckets(internal.NewExponentialHistogramDataPointBuckets(&ms.getOrig().Negative)) } // Exemplars returns the Exemplars associated with this ExponentialHistogramDataPoint. func (ms ExponentialHistogramDataPoint) Exemplars() ExemplarSlice { - return newExemplarSlice(&(*ms.orig).Exemplars) + return ExemplarSlice(internal.NewExemplarSlice(&ms.getOrig().Exemplars)) +} + +// Flags returns the flags associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) Flags() DataPointFlags { + return DataPointFlags(ms.getOrig().Flags) } -// FlagsStruct returns the flagsstruct associated with this ExponentialHistogramDataPoint. -func (ms ExponentialHistogramDataPoint) FlagsStruct() MetricDataPointFlagsStruct { - return newMetricDataPointFlagsStruct(&(*ms.orig).Flags) +// SetFlags replaces the flags associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) SetFlags(v DataPointFlags) { + ms.getOrig().Flags = uint32(v) } // Min returns the min associated with this ExponentialHistogramDataPoint. func (ms ExponentialHistogramDataPoint) Min() float64 { - return (*ms.orig).GetMin() + return ms.getOrig().GetMin() } // HasMin returns true if the ExponentialHistogramDataPoint contains a // Min value, false otherwise. func (ms ExponentialHistogramDataPoint) HasMin() bool { - return ms.orig.Min_ != nil + return ms.getOrig().Min_ != nil } // SetMin replaces the min associated with this ExponentialHistogramDataPoint. func (ms ExponentialHistogramDataPoint) SetMin(v float64) { - (*ms.orig).Min_ = &otlpmetrics.ExponentialHistogramDataPoint_Min{Min: v} + ms.getOrig().Min_ = &otlpmetrics.ExponentialHistogramDataPoint_Min{Min: v} +} + +// RemoveMin removes the min associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) RemoveMin() { + ms.getOrig().Min_ = nil } // Max returns the max associated with this ExponentialHistogramDataPoint. func (ms ExponentialHistogramDataPoint) Max() float64 { - return (*ms.orig).GetMax() + return ms.getOrig().GetMax() } // HasMax returns true if the ExponentialHistogramDataPoint contains a // Max value, false otherwise. func (ms ExponentialHistogramDataPoint) HasMax() bool { - return ms.orig.Max_ != nil + return ms.getOrig().Max_ != nil } // SetMax replaces the max associated with this ExponentialHistogramDataPoint. func (ms ExponentialHistogramDataPoint) SetMax(v float64) { - (*ms.orig).Max_ = &otlpmetrics.ExponentialHistogramDataPoint_Max{Max: v} + ms.getOrig().Max_ = &otlpmetrics.ExponentialHistogramDataPoint_Max{Max: v} } -// CopyTo copies all properties from the current struct to the dest. +// RemoveMax removes the max associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) RemoveMax() { + ms.getOrig().Max_ = nil +} + +// CopyTo copies all properties from the current struct overriding the destination. func (ms ExponentialHistogramDataPoint) CopyTo(dest ExponentialHistogramDataPoint) { ms.Attributes().CopyTo(dest.Attributes()) dest.SetStartTimestamp(ms.StartTimestamp()) @@ -1845,7 +1924,7 @@ func (ms ExponentialHistogramDataPoint) CopyTo(dest ExponentialHistogramDataPoin ms.Positive().CopyTo(dest.Positive()) ms.Negative().CopyTo(dest.Negative()) ms.Exemplars().CopyTo(dest.Exemplars()) - ms.FlagsStruct().CopyTo(dest.FlagsStruct()) + dest.SetFlags(ms.Flags()) if ms.HasMin() { dest.SetMin(ms.Min()) } @@ -1856,66 +1935,58 @@ func (ms ExponentialHistogramDataPoint) CopyTo(dest ExponentialHistogramDataPoin } -// Buckets are a set of bucket counts, encoded in a contiguous array of counts. +// ExponentialHistogramDataPointBuckets are a set of bucket counts, encoded in a contiguous array of counts. // // This is a reference type, if passed by value and callee modifies it the // caller will see the modification. // -// Must use NewBuckets function to create new instances. +// Must use NewExponentialHistogramDataPointBuckets function to create new instances. // Important: zero-initialized instance is not valid for use. -type Buckets struct { - orig *otlpmetrics.ExponentialHistogramDataPoint_Buckets + +type ExponentialHistogramDataPointBuckets internal.ExponentialHistogramDataPointBuckets + +func newExponentialHistogramDataPointBuckets(orig *otlpmetrics.ExponentialHistogramDataPoint_Buckets) ExponentialHistogramDataPointBuckets { + return ExponentialHistogramDataPointBuckets(internal.NewExponentialHistogramDataPointBuckets(orig)) } -func newBuckets(orig *otlpmetrics.ExponentialHistogramDataPoint_Buckets) Buckets { - return Buckets{orig: orig} +func (ms ExponentialHistogramDataPointBuckets) getOrig() *otlpmetrics.ExponentialHistogramDataPoint_Buckets { + return internal.GetOrigExponentialHistogramDataPointBuckets(internal.ExponentialHistogramDataPointBuckets(ms)) } -// NewBuckets creates a new empty Buckets. +// NewExponentialHistogramDataPointBuckets creates a new empty ExponentialHistogramDataPointBuckets. // // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. -func NewBuckets() Buckets { - return newBuckets(&otlpmetrics.ExponentialHistogramDataPoint_Buckets{}) +func NewExponentialHistogramDataPointBuckets() ExponentialHistogramDataPointBuckets { + return newExponentialHistogramDataPointBuckets(&otlpmetrics.ExponentialHistogramDataPoint_Buckets{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value -func (ms Buckets) MoveTo(dest Buckets) { - *dest.orig = *ms.orig - *ms.orig = otlpmetrics.ExponentialHistogramDataPoint_Buckets{} -} - -// Offset returns the offset associated with this Buckets. -func (ms Buckets) Offset() int32 { - return int32((*ms.orig).Offset) +func (ms ExponentialHistogramDataPointBuckets) MoveTo(dest ExponentialHistogramDataPointBuckets) { + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpmetrics.ExponentialHistogramDataPoint_Buckets{} } -// SetOffset replaces the offset associated with this Buckets. -func (ms Buckets) SetOffset(v int32) { - (*ms.orig).Offset = int32(v) +// Offset returns the offset associated with this ExponentialHistogramDataPointBuckets. +func (ms ExponentialHistogramDataPointBuckets) Offset() int32 { + return ms.getOrig().Offset } -// BucketCounts returns the bucketcounts associated with this Buckets. -func (ms Buckets) BucketCounts() ImmutableUInt64Slice { - return ImmutableUInt64Slice{value: (*ms.orig).BucketCounts} +// SetOffset replaces the offset associated with this ExponentialHistogramDataPointBuckets. +func (ms ExponentialHistogramDataPointBuckets) SetOffset(v int32) { + ms.getOrig().Offset = v } -// SetBucketCounts replaces the bucketcounts associated with this Buckets. -func (ms Buckets) SetBucketCounts(v ImmutableUInt64Slice) { - (*ms.orig).BucketCounts = v.value +// BucketCounts returns the bucketcounts associated with this ExponentialHistogramDataPointBuckets. +func (ms ExponentialHistogramDataPointBuckets) BucketCounts() pcommon.UInt64Slice { + return pcommon.UInt64Slice(internal.NewUInt64Slice(&ms.getOrig().BucketCounts)) } -// CopyTo copies all properties from the current struct to the dest. -func (ms Buckets) CopyTo(dest Buckets) { +// CopyTo copies all properties from the current struct overriding the destination. +func (ms ExponentialHistogramDataPointBuckets) CopyTo(dest ExponentialHistogramDataPointBuckets) { dest.SetOffset(ms.Offset()) - if len(ms.orig.BucketCounts) == 0 { - dest.orig.BucketCounts = nil - } else { - dest.orig.BucketCounts = make([]uint64, len(ms.orig.BucketCounts)) - copy(dest.orig.BucketCounts, ms.orig.BucketCounts) - } - + ms.BucketCounts().CopyTo(dest.BucketCounts()) } // SummaryDataPointSlice logically represents a slice of SummaryDataPoint. @@ -1925,59 +1996,60 @@ func (ms Buckets) CopyTo(dest Buckets) { // // Must use NewSummaryDataPointSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type SummaryDataPointSlice struct { - // orig points to the slice otlpmetrics.SummaryDataPoint field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]*otlpmetrics.SummaryDataPoint -} +type SummaryDataPointSlice internal.SummaryDataPointSlice func newSummaryDataPointSlice(orig *[]*otlpmetrics.SummaryDataPoint) SummaryDataPointSlice { - return SummaryDataPointSlice{orig} + return SummaryDataPointSlice(internal.NewSummaryDataPointSlice(orig)) +} + +func (ms SummaryDataPointSlice) getOrig() *[]*otlpmetrics.SummaryDataPoint { + return internal.GetOrigSummaryDataPointSlice(internal.SummaryDataPointSlice(ms)) } // NewSummaryDataPointSlice creates a SummaryDataPointSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewSummaryDataPointSlice() SummaryDataPointSlice { orig := []*otlpmetrics.SummaryDataPoint(nil) - return SummaryDataPointSlice{&orig} + return newSummaryDataPointSlice(&orig) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewSummaryDataPointSlice()". func (es SummaryDataPointSlice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es SummaryDataPointSlice) At(ix int) SummaryDataPoint { - return newSummaryDataPoint((*es.orig)[ix]) + return newSummaryDataPoint((*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es SummaryDataPointSlice) CopyTo(dest SummaryDataPointSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newSummaryDataPoint((*es.orig)[i]).CopyTo(newSummaryDataPoint((*dest.orig)[i])) + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] + for i := range *es.getOrig() { + newSummaryDataPoint((*es.getOrig())[i]).CopyTo(newSummaryDataPoint((*dest.getOrig())[i])) } return } origs := make([]otlpmetrics.SummaryDataPoint, srcLen) wrappers := make([]*otlpmetrics.SummaryDataPoint, srcLen) - for i := range *es.orig { + for i := range *es.getOrig() { wrappers[i] = &origs[i] - newSummaryDataPoint((*es.orig)[i]).CopyTo(newSummaryDataPoint(wrappers[i])) + newSummaryDataPoint((*es.getOrig())[i]).CopyTo(newSummaryDataPoint(wrappers[i])) } - *dest.orig = wrappers + *dest.getOrig() = wrappers } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. @@ -1985,61 +2057,55 @@ func (es SummaryDataPointSlice) CopyTo(dest SummaryDataPointSlice) { // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new SummaryDataPointSlice can be initialized: -// es := NewSummaryDataPointSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewSummaryDataPointSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es SummaryDataPointSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]*otlpmetrics.SummaryDataPoint, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]*otlpmetrics.SummaryDataPoint, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty SummaryDataPoint. // It returns the newly added SummaryDataPoint. func (es SummaryDataPointSlice) AppendEmpty() SummaryDataPoint { - *es.orig = append(*es.orig, &otlpmetrics.SummaryDataPoint{}) + *es.getOrig() = append(*es.getOrig(), &otlpmetrics.SummaryDataPoint{}) return es.At(es.Len() - 1) } // Sort sorts the SummaryDataPoint elements within SummaryDataPointSlice given the // provided less function so that two instances of SummaryDataPointSlice // can be compared. -// -// Returns the same instance to allow nicer code like: -// lessFunc := func(a, b SummaryDataPoint) bool { -// return a.Name() < b.Name() // choose any comparison here -// } -// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) -func (es SummaryDataPointSlice) Sort(less func(a, b SummaryDataPoint) bool) SummaryDataPointSlice { - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) - return es +func (es SummaryDataPointSlice) Sort(less func(a, b SummaryDataPoint) bool) { + sort.SliceStable(*es.getOrig(), func(i, j int) bool { return less(es.At(i), es.At(j)) }) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es SummaryDataPointSlice) MoveAndAppendTo(dest SummaryDataPointSlice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es SummaryDataPointSlice) RemoveIf(f func(SummaryDataPoint) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -2048,11 +2114,11 @@ func (es SummaryDataPointSlice) RemoveIf(f func(SummaryDataPoint) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } // SummaryDataPoint is a single data point in a timeseries that describes the time-varying values of a Summary of double values. @@ -2062,12 +2128,15 @@ func (es SummaryDataPointSlice) RemoveIf(f func(SummaryDataPoint) bool) { // // Must use NewSummaryDataPoint function to create new instances. // Important: zero-initialized instance is not valid for use. -type SummaryDataPoint struct { - orig *otlpmetrics.SummaryDataPoint -} + +type SummaryDataPoint internal.SummaryDataPoint func newSummaryDataPoint(orig *otlpmetrics.SummaryDataPoint) SummaryDataPoint { - return SummaryDataPoint{orig: orig} + return SummaryDataPoint(internal.NewSummaryDataPoint(orig)) +} + +func (ms SummaryDataPoint) getOrig() *otlpmetrics.SummaryDataPoint { + return internal.GetOrigSummaryDataPoint(internal.SummaryDataPoint(ms)) } // NewSummaryDataPoint creates a new empty SummaryDataPoint. @@ -2078,69 +2147,74 @@ func NewSummaryDataPoint() SummaryDataPoint { return newSummaryDataPoint(&otlpmetrics.SummaryDataPoint{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms SummaryDataPoint) MoveTo(dest SummaryDataPoint) { - *dest.orig = *ms.orig - *ms.orig = otlpmetrics.SummaryDataPoint{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpmetrics.SummaryDataPoint{} } // Attributes returns the Attributes associated with this SummaryDataPoint. -func (ms SummaryDataPoint) Attributes() Map { - return newMap(&(*ms.orig).Attributes) +func (ms SummaryDataPoint) Attributes() pcommon.Map { + return pcommon.Map(internal.NewMap(&ms.getOrig().Attributes)) } // StartTimestamp returns the starttimestamp associated with this SummaryDataPoint. -func (ms SummaryDataPoint) StartTimestamp() Timestamp { - return Timestamp((*ms.orig).StartTimeUnixNano) +func (ms SummaryDataPoint) StartTimestamp() pcommon.Timestamp { + return pcommon.Timestamp(ms.getOrig().StartTimeUnixNano) } // SetStartTimestamp replaces the starttimestamp associated with this SummaryDataPoint. -func (ms SummaryDataPoint) SetStartTimestamp(v Timestamp) { - (*ms.orig).StartTimeUnixNano = uint64(v) +func (ms SummaryDataPoint) SetStartTimestamp(v pcommon.Timestamp) { + ms.getOrig().StartTimeUnixNano = uint64(v) } // Timestamp returns the timestamp associated with this SummaryDataPoint. -func (ms SummaryDataPoint) Timestamp() Timestamp { - return Timestamp((*ms.orig).TimeUnixNano) +func (ms SummaryDataPoint) Timestamp() pcommon.Timestamp { + return pcommon.Timestamp(ms.getOrig().TimeUnixNano) } // SetTimestamp replaces the timestamp associated with this SummaryDataPoint. -func (ms SummaryDataPoint) SetTimestamp(v Timestamp) { - (*ms.orig).TimeUnixNano = uint64(v) +func (ms SummaryDataPoint) SetTimestamp(v pcommon.Timestamp) { + ms.getOrig().TimeUnixNano = uint64(v) } // Count returns the count associated with this SummaryDataPoint. func (ms SummaryDataPoint) Count() uint64 { - return (*ms.orig).Count + return ms.getOrig().Count } // SetCount replaces the count associated with this SummaryDataPoint. func (ms SummaryDataPoint) SetCount(v uint64) { - (*ms.orig).Count = v + ms.getOrig().Count = v } // Sum returns the sum associated with this SummaryDataPoint. func (ms SummaryDataPoint) Sum() float64 { - return (*ms.orig).Sum + return ms.getOrig().Sum } // SetSum replaces the sum associated with this SummaryDataPoint. func (ms SummaryDataPoint) SetSum(v float64) { - (*ms.orig).Sum = v + ms.getOrig().Sum = v } // QuantileValues returns the QuantileValues associated with this SummaryDataPoint. -func (ms SummaryDataPoint) QuantileValues() ValueAtQuantileSlice { - return newValueAtQuantileSlice(&(*ms.orig).QuantileValues) +func (ms SummaryDataPoint) QuantileValues() SummaryDataPointValueAtQuantileSlice { + return SummaryDataPointValueAtQuantileSlice(internal.NewSummaryDataPointValueAtQuantileSlice(&ms.getOrig().QuantileValues)) +} + +// Flags returns the flags associated with this SummaryDataPoint. +func (ms SummaryDataPoint) Flags() DataPointFlags { + return DataPointFlags(ms.getOrig().Flags) } -// FlagsStruct returns the flagsstruct associated with this SummaryDataPoint. -func (ms SummaryDataPoint) FlagsStruct() MetricDataPointFlagsStruct { - return newMetricDataPointFlagsStruct(&(*ms.orig).Flags) +// SetFlags replaces the flags associated with this SummaryDataPoint. +func (ms SummaryDataPoint) SetFlags(v DataPointFlags) { + ms.getOrig().Flags = uint32(v) } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms SummaryDataPoint) CopyTo(dest SummaryDataPoint) { ms.Attributes().CopyTo(dest.Attributes()) dest.SetStartTimestamp(ms.StartTimestamp()) @@ -2148,131 +2222,126 @@ func (ms SummaryDataPoint) CopyTo(dest SummaryDataPoint) { dest.SetCount(ms.Count()) dest.SetSum(ms.Sum()) ms.QuantileValues().CopyTo(dest.QuantileValues()) - ms.FlagsStruct().CopyTo(dest.FlagsStruct()) + dest.SetFlags(ms.Flags()) } -// ValueAtQuantileSlice logically represents a slice of ValueAtQuantile. +// SummaryDataPointValueAtQuantileSlice logically represents a slice of SummaryDataPointValueAtQuantile. // // This is a reference type. If passed by value and callee modifies it, the // caller will see the modification. // -// Must use NewValueAtQuantileSlice function to create new instances. +// Must use NewSummaryDataPointValueAtQuantileSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type ValueAtQuantileSlice struct { - // orig points to the slice otlpmetrics.SummaryDataPoint_ValueAtQuantile field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]*otlpmetrics.SummaryDataPoint_ValueAtQuantile +type SummaryDataPointValueAtQuantileSlice internal.SummaryDataPointValueAtQuantileSlice + +func newSummaryDataPointValueAtQuantileSlice(orig *[]*otlpmetrics.SummaryDataPoint_ValueAtQuantile) SummaryDataPointValueAtQuantileSlice { + return SummaryDataPointValueAtQuantileSlice(internal.NewSummaryDataPointValueAtQuantileSlice(orig)) } -func newValueAtQuantileSlice(orig *[]*otlpmetrics.SummaryDataPoint_ValueAtQuantile) ValueAtQuantileSlice { - return ValueAtQuantileSlice{orig} +func (ms SummaryDataPointValueAtQuantileSlice) getOrig() *[]*otlpmetrics.SummaryDataPoint_ValueAtQuantile { + return internal.GetOrigSummaryDataPointValueAtQuantileSlice(internal.SummaryDataPointValueAtQuantileSlice(ms)) } -// NewValueAtQuantileSlice creates a ValueAtQuantileSlice with 0 elements. +// NewSummaryDataPointValueAtQuantileSlice creates a SummaryDataPointValueAtQuantileSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. -func NewValueAtQuantileSlice() ValueAtQuantileSlice { +func NewSummaryDataPointValueAtQuantileSlice() SummaryDataPointValueAtQuantileSlice { orig := []*otlpmetrics.SummaryDataPoint_ValueAtQuantile(nil) - return ValueAtQuantileSlice{&orig} + return newSummaryDataPointValueAtQuantileSlice(&orig) } // Len returns the number of elements in the slice. // -// Returns "0" for a newly instance created with "NewValueAtQuantileSlice()". -func (es ValueAtQuantileSlice) Len() int { - return len(*es.orig) +// Returns "0" for a newly instance created with "NewSummaryDataPointValueAtQuantileSlice()". +func (es SummaryDataPointValueAtQuantileSlice) Len() int { + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } -func (es ValueAtQuantileSlice) At(ix int) ValueAtQuantile { - return newValueAtQuantile((*es.orig)[ix]) +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } +func (es SummaryDataPointValueAtQuantileSlice) At(ix int) SummaryDataPointValueAtQuantile { + return newSummaryDataPointValueAtQuantile((*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. -func (es ValueAtQuantileSlice) CopyTo(dest ValueAtQuantileSlice) { +// CopyTo copies all elements from the current slice overriding the destination. +func (es SummaryDataPointValueAtQuantileSlice) CopyTo(dest SummaryDataPointValueAtQuantileSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newValueAtQuantile((*es.orig)[i]).CopyTo(newValueAtQuantile((*dest.orig)[i])) + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] + for i := range *es.getOrig() { + newSummaryDataPointValueAtQuantile((*es.getOrig())[i]).CopyTo(newSummaryDataPointValueAtQuantile((*dest.getOrig())[i])) } return } origs := make([]otlpmetrics.SummaryDataPoint_ValueAtQuantile, srcLen) wrappers := make([]*otlpmetrics.SummaryDataPoint_ValueAtQuantile, srcLen) - for i := range *es.orig { + for i := range *es.getOrig() { wrappers[i] = &origs[i] - newValueAtQuantile((*es.orig)[i]).CopyTo(newValueAtQuantile(wrappers[i])) + newSummaryDataPointValueAtQuantile((*es.getOrig())[i]).CopyTo(newSummaryDataPointValueAtQuantile(wrappers[i])) } - *dest.orig = wrappers + *dest.getOrig() = wrappers } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. // 1. If the newCap <= cap then no change in capacity. // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // -// Here is how a new ValueAtQuantileSlice can be initialized: -// es := NewValueAtQuantileSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } -func (es ValueAtQuantileSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) +// Here is how a new SummaryDataPointValueAtQuantileSlice can be initialized: +// +// es := NewSummaryDataPointValueAtQuantileSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } +func (es SummaryDataPointValueAtQuantileSlice) EnsureCapacity(newCap int) { + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]*otlpmetrics.SummaryDataPoint_ValueAtQuantile, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]*otlpmetrics.SummaryDataPoint_ValueAtQuantile, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } -// AppendEmpty will append to the end of the slice an empty ValueAtQuantile. -// It returns the newly added ValueAtQuantile. -func (es ValueAtQuantileSlice) AppendEmpty() ValueAtQuantile { - *es.orig = append(*es.orig, &otlpmetrics.SummaryDataPoint_ValueAtQuantile{}) +// AppendEmpty will append to the end of the slice an empty SummaryDataPointValueAtQuantile. +// It returns the newly added SummaryDataPointValueAtQuantile. +func (es SummaryDataPointValueAtQuantileSlice) AppendEmpty() SummaryDataPointValueAtQuantile { + *es.getOrig() = append(*es.getOrig(), &otlpmetrics.SummaryDataPoint_ValueAtQuantile{}) return es.At(es.Len() - 1) } -// Sort sorts the ValueAtQuantile elements within ValueAtQuantileSlice given the -// provided less function so that two instances of ValueAtQuantileSlice +// Sort sorts the SummaryDataPointValueAtQuantile elements within SummaryDataPointValueAtQuantileSlice given the +// provided less function so that two instances of SummaryDataPointValueAtQuantileSlice // can be compared. -// -// Returns the same instance to allow nicer code like: -// lessFunc := func(a, b ValueAtQuantile) bool { -// return a.Name() < b.Name() // choose any comparison here -// } -// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) -func (es ValueAtQuantileSlice) Sort(less func(a, b ValueAtQuantile) bool) ValueAtQuantileSlice { - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) - return es +func (es SummaryDataPointValueAtQuantileSlice) Sort(less func(a, b SummaryDataPointValueAtQuantile) bool) { + sort.SliceStable(*es.getOrig(), func(i, j int) bool { return less(es.At(i), es.At(j)) }) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. -func (es ValueAtQuantileSlice) MoveAndAppendTo(dest ValueAtQuantileSlice) { - if *dest.orig == nil { +func (es SummaryDataPointValueAtQuantileSlice) MoveAndAppendTo(dest SummaryDataPointValueAtQuantileSlice) { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. -func (es ValueAtQuantileSlice) RemoveIf(f func(ValueAtQuantile) bool) { +func (es SummaryDataPointValueAtQuantileSlice) RemoveIf(f func(SummaryDataPointValueAtQuantile) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -2281,65 +2350,68 @@ func (es ValueAtQuantileSlice) RemoveIf(f func(ValueAtQuantile) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } -// ValueAtQuantile is a quantile value within a Summary data point. +// SummaryDataPointValueAtQuantile is a quantile value within a Summary data point. // // This is a reference type, if passed by value and callee modifies it the // caller will see the modification. // -// Must use NewValueAtQuantile function to create new instances. +// Must use NewSummaryDataPointValueAtQuantile function to create new instances. // Important: zero-initialized instance is not valid for use. -type ValueAtQuantile struct { - orig *otlpmetrics.SummaryDataPoint_ValueAtQuantile + +type SummaryDataPointValueAtQuantile internal.SummaryDataPointValueAtQuantile + +func newSummaryDataPointValueAtQuantile(orig *otlpmetrics.SummaryDataPoint_ValueAtQuantile) SummaryDataPointValueAtQuantile { + return SummaryDataPointValueAtQuantile(internal.NewSummaryDataPointValueAtQuantile(orig)) } -func newValueAtQuantile(orig *otlpmetrics.SummaryDataPoint_ValueAtQuantile) ValueAtQuantile { - return ValueAtQuantile{orig: orig} +func (ms SummaryDataPointValueAtQuantile) getOrig() *otlpmetrics.SummaryDataPoint_ValueAtQuantile { + return internal.GetOrigSummaryDataPointValueAtQuantile(internal.SummaryDataPointValueAtQuantile(ms)) } -// NewValueAtQuantile creates a new empty ValueAtQuantile. +// NewSummaryDataPointValueAtQuantile creates a new empty SummaryDataPointValueAtQuantile. // // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. -func NewValueAtQuantile() ValueAtQuantile { - return newValueAtQuantile(&otlpmetrics.SummaryDataPoint_ValueAtQuantile{}) +func NewSummaryDataPointValueAtQuantile() SummaryDataPointValueAtQuantile { + return newSummaryDataPointValueAtQuantile(&otlpmetrics.SummaryDataPoint_ValueAtQuantile{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value -func (ms ValueAtQuantile) MoveTo(dest ValueAtQuantile) { - *dest.orig = *ms.orig - *ms.orig = otlpmetrics.SummaryDataPoint_ValueAtQuantile{} +func (ms SummaryDataPointValueAtQuantile) MoveTo(dest SummaryDataPointValueAtQuantile) { + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpmetrics.SummaryDataPoint_ValueAtQuantile{} } -// Quantile returns the quantile associated with this ValueAtQuantile. -func (ms ValueAtQuantile) Quantile() float64 { - return (*ms.orig).Quantile +// Quantile returns the quantile associated with this SummaryDataPointValueAtQuantile. +func (ms SummaryDataPointValueAtQuantile) Quantile() float64 { + return ms.getOrig().Quantile } -// SetQuantile replaces the quantile associated with this ValueAtQuantile. -func (ms ValueAtQuantile) SetQuantile(v float64) { - (*ms.orig).Quantile = v +// SetQuantile replaces the quantile associated with this SummaryDataPointValueAtQuantile. +func (ms SummaryDataPointValueAtQuantile) SetQuantile(v float64) { + ms.getOrig().Quantile = v } -// Value returns the value associated with this ValueAtQuantile. -func (ms ValueAtQuantile) Value() float64 { - return (*ms.orig).Value +// Value returns the value associated with this SummaryDataPointValueAtQuantile. +func (ms SummaryDataPointValueAtQuantile) Value() float64 { + return ms.getOrig().Value } -// SetValue replaces the value associated with this ValueAtQuantile. -func (ms ValueAtQuantile) SetValue(v float64) { - (*ms.orig).Value = v +// SetValue replaces the value associated with this SummaryDataPointValueAtQuantile. +func (ms SummaryDataPointValueAtQuantile) SetValue(v float64) { + ms.getOrig().Value = v } -// CopyTo copies all properties from the current struct to the dest. -func (ms ValueAtQuantile) CopyTo(dest ValueAtQuantile) { +// CopyTo copies all properties from the current struct overriding the destination. +func (ms SummaryDataPointValueAtQuantile) CopyTo(dest SummaryDataPointValueAtQuantile) { dest.SetQuantile(ms.Quantile()) dest.SetValue(ms.Value()) } @@ -2351,53 +2423,54 @@ func (ms ValueAtQuantile) CopyTo(dest ValueAtQuantile) { // // Must use NewExemplarSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type ExemplarSlice struct { - // orig points to the slice otlpmetrics.Exemplar field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]otlpmetrics.Exemplar -} +type ExemplarSlice internal.ExemplarSlice func newExemplarSlice(orig *[]otlpmetrics.Exemplar) ExemplarSlice { - return ExemplarSlice{orig} + return ExemplarSlice(internal.NewExemplarSlice(orig)) +} + +func (ms ExemplarSlice) getOrig() *[]otlpmetrics.Exemplar { + return internal.GetOrigExemplarSlice(internal.ExemplarSlice(ms)) } // NewExemplarSlice creates a ExemplarSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewExemplarSlice() ExemplarSlice { orig := []otlpmetrics.Exemplar(nil) - return ExemplarSlice{&orig} + return ExemplarSlice(internal.NewExemplarSlice(&orig)) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewExemplarSlice()". func (es ExemplarSlice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es ExemplarSlice) At(ix int) Exemplar { - return newExemplar(&(*es.orig)[ix]) + return newExemplar(&(*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es ExemplarSlice) CopyTo(dest ExemplarSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] } else { - (*dest.orig) = make([]otlpmetrics.Exemplar, srcLen) + (*dest.getOrig()) = make([]otlpmetrics.Exemplar, srcLen) } - for i := range *es.orig { - newExemplar(&(*es.orig)[i]).CopyTo(newExemplar(&(*dest.orig)[i])) + for i := range *es.getOrig() { + newExemplar(&(*es.getOrig())[i]).CopyTo(newExemplar(&(*dest.getOrig())[i])) } } @@ -2406,47 +2479,48 @@ func (es ExemplarSlice) CopyTo(dest ExemplarSlice) { // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new ExemplarSlice can be initialized: -// es := NewExemplarSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewExemplarSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es ExemplarSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]otlpmetrics.Exemplar, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]otlpmetrics.Exemplar, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty Exemplar. // It returns the newly added Exemplar. func (es ExemplarSlice) AppendEmpty() Exemplar { - *es.orig = append(*es.orig, otlpmetrics.Exemplar{}) + *es.getOrig() = append(*es.getOrig(), otlpmetrics.Exemplar{}) return es.At(es.Len() - 1) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es ExemplarSlice) MoveAndAppendTo(dest ExemplarSlice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es ExemplarSlice) RemoveIf(f func(Exemplar) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -2455,11 +2529,11 @@ func (es ExemplarSlice) RemoveIf(f func(Exemplar) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } // Exemplar is a sample input double measurement. @@ -2472,12 +2546,15 @@ func (es ExemplarSlice) RemoveIf(f func(Exemplar) bool) { // // Must use NewExemplar function to create new instances. // Important: zero-initialized instance is not valid for use. -type Exemplar struct { - orig *otlpmetrics.Exemplar -} + +type Exemplar internal.Exemplar func newExemplar(orig *otlpmetrics.Exemplar) Exemplar { - return Exemplar{orig: orig} + return Exemplar(internal.NewExemplar(orig)) +} + +func (ms Exemplar) getOrig() *otlpmetrics.Exemplar { + return internal.GetOrigExemplar(internal.Exemplar(ms)) } // NewExemplar creates a new empty Exemplar. @@ -2488,92 +2565,92 @@ func NewExemplar() Exemplar { return newExemplar(&otlpmetrics.Exemplar{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms Exemplar) MoveTo(dest Exemplar) { - *dest.orig = *ms.orig - *ms.orig = otlpmetrics.Exemplar{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpmetrics.Exemplar{} } // Timestamp returns the timestamp associated with this Exemplar. -func (ms Exemplar) Timestamp() Timestamp { - return Timestamp((*ms.orig).TimeUnixNano) +func (ms Exemplar) Timestamp() pcommon.Timestamp { + return pcommon.Timestamp(ms.getOrig().TimeUnixNano) } // SetTimestamp replaces the timestamp associated with this Exemplar. -func (ms Exemplar) SetTimestamp(v Timestamp) { - (*ms.orig).TimeUnixNano = uint64(v) +func (ms Exemplar) SetTimestamp(v pcommon.Timestamp) { + ms.getOrig().TimeUnixNano = uint64(v) } // ValueType returns the type of the value for this Exemplar. // Calling this function on zero-initialized Exemplar will cause a panic. func (ms Exemplar) ValueType() ExemplarValueType { - switch ms.orig.Value.(type) { + switch ms.getOrig().Value.(type) { case *otlpmetrics.Exemplar_AsDouble: return ExemplarValueTypeDouble case *otlpmetrics.Exemplar_AsInt: return ExemplarValueTypeInt } - return ExemplarValueTypeNone + return ExemplarValueTypeEmpty } -// DoubleVal returns the doubleval associated with this Exemplar. -func (ms Exemplar) DoubleVal() float64 { - return (*ms.orig).GetAsDouble() +// DoubleValue returns the double associated with this Exemplar. +func (ms Exemplar) DoubleValue() float64 { + return ms.getOrig().GetAsDouble() } -// SetDoubleVal replaces the doubleval associated with this Exemplar. -func (ms Exemplar) SetDoubleVal(v float64) { - (*ms.orig).Value = &otlpmetrics.Exemplar_AsDouble{ +// SetDoubleValue replaces the double associated with this Exemplar. +func (ms Exemplar) SetDoubleValue(v float64) { + ms.getOrig().Value = &otlpmetrics.Exemplar_AsDouble{ AsDouble: v, } } -// IntVal returns the intval associated with this Exemplar. -func (ms Exemplar) IntVal() int64 { - return (*ms.orig).GetAsInt() +// IntValue returns the int associated with this Exemplar. +func (ms Exemplar) IntValue() int64 { + return ms.getOrig().GetAsInt() } -// SetIntVal replaces the intval associated with this Exemplar. -func (ms Exemplar) SetIntVal(v int64) { - (*ms.orig).Value = &otlpmetrics.Exemplar_AsInt{ +// SetIntValue replaces the int associated with this Exemplar. +func (ms Exemplar) SetIntValue(v int64) { + ms.getOrig().Value = &otlpmetrics.Exemplar_AsInt{ AsInt: v, } } // FilteredAttributes returns the FilteredAttributes associated with this Exemplar. -func (ms Exemplar) FilteredAttributes() Map { - return newMap(&(*ms.orig).FilteredAttributes) +func (ms Exemplar) FilteredAttributes() pcommon.Map { + return pcommon.Map(internal.NewMap(&ms.getOrig().FilteredAttributes)) } // TraceID returns the traceid associated with this Exemplar. -func (ms Exemplar) TraceID() TraceID { - return TraceID{orig: ((*ms.orig).TraceId)} +func (ms Exemplar) TraceID() pcommon.TraceID { + return pcommon.TraceID(ms.getOrig().TraceId) } // SetTraceID replaces the traceid associated with this Exemplar. -func (ms Exemplar) SetTraceID(v TraceID) { - (*ms.orig).TraceId = v.orig +func (ms Exemplar) SetTraceID(v pcommon.TraceID) { + ms.getOrig().TraceId = data.TraceID(v) } // SpanID returns the spanid associated with this Exemplar. -func (ms Exemplar) SpanID() SpanID { - return SpanID{orig: ((*ms.orig).SpanId)} +func (ms Exemplar) SpanID() pcommon.SpanID { + return pcommon.SpanID(ms.getOrig().SpanId) } // SetSpanID replaces the spanid associated with this Exemplar. -func (ms Exemplar) SetSpanID(v SpanID) { - (*ms.orig).SpanId = v.orig +func (ms Exemplar) SetSpanID(v pcommon.SpanID) { + ms.getOrig().SpanId = data.SpanID(v) } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms Exemplar) CopyTo(dest Exemplar) { dest.SetTimestamp(ms.Timestamp()) switch ms.ValueType() { case ExemplarValueTypeDouble: - dest.SetDoubleVal(ms.DoubleVal()) + dest.SetDoubleValue(ms.DoubleValue()) case ExemplarValueTypeInt: - dest.SetIntVal(ms.IntVal()) + dest.SetIntValue(ms.IntValue()) } ms.FilteredAttributes().CopyTo(dest.FilteredAttributes()) diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/internal/pmetricjson/json.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/internal/pmetricjson/json.go new file mode 100644 index 00000000000..92415fe4372 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/internal/pmetricjson/json.go @@ -0,0 +1,527 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package pmetricjson // import "go.opentelemetry.io/collector/pdata/pmetric/internal/pmetricjson" + +import ( + "fmt" + + "github.com/gogo/protobuf/jsonpb" + jsoniter "github.com/json-iterator/go" + + otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1" + otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/json" + "go.opentelemetry.io/collector/pdata/internal/otlp" +) + +var JSONMarshaler = &jsonpb.Marshaler{ + // https://github.com/open-telemetry/opentelemetry-specification/pull/2758 + EnumsAsInts: true, + // https://github.com/open-telemetry/opentelemetry-specification/pull/2829 + OrigName: false, +} + +func UnmarshalMetricsData(buf []byte, dest *otlpmetrics.MetricsData) error { + iter := jsoniter.ConfigFastest.BorrowIterator(buf) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "resource_metrics", "resourceMetrics": + iter.ReadArrayCB(func(iterator *jsoniter.Iterator) bool { + dest.ResourceMetrics = append(dest.ResourceMetrics, readResourceMetrics(iter)) + return true + }) + default: + iter.Skip() + } + return true + }) + otlp.MigrateMetrics(dest.ResourceMetrics) + return iter.Error +} + +func UnmarshalExportMetricsServiceRequest(buf []byte, dest *otlpcollectormetrics.ExportMetricsServiceRequest) error { + iter := jsoniter.ConfigFastest.BorrowIterator(buf) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "resource_metrics", "resourceMetrics": + iter.ReadArrayCB(func(iterator *jsoniter.Iterator) bool { + dest.ResourceMetrics = append(dest.ResourceMetrics, readResourceMetrics(iter)) + return true + }) + default: + iter.Skip() + } + return true + }) + otlp.MigrateMetrics(dest.ResourceMetrics) + return iter.Error +} + +func UnmarshalExportMetricsServiceResponse(buf []byte, dest *otlpcollectormetrics.ExportMetricsServiceResponse) error { + iter := jsoniter.ConfigFastest.BorrowIterator(buf) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "partial_success", "partialSuccess": + dest.PartialSuccess = readExportMetricsPartialSuccess(iter) + default: + iter.Skip() + } + return true + }) + return iter.Error +} + +func readResourceMetrics(iter *jsoniter.Iterator) *otlpmetrics.ResourceMetrics { + rs := &otlpmetrics.ResourceMetrics{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "resource": + json.ReadResource(iter, &rs.Resource) + case "scopeMetrics", "scope_metrics": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + rs.ScopeMetrics = append(rs.ScopeMetrics, + readScopeMetrics(iter)) + return true + }) + case "schemaUrl", "schema_url": + rs.SchemaUrl = iter.ReadString() + default: + iter.Skip() + } + return true + }) + return rs +} + +func readScopeMetrics(iter *jsoniter.Iterator) *otlpmetrics.ScopeMetrics { + ils := &otlpmetrics.ScopeMetrics{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "scope": + json.ReadScope(iter, &ils.Scope) + case "metrics": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + ils.Metrics = append(ils.Metrics, readMetric(iter)) + return true + }) + case "schemaUrl", "schema_url": + ils.SchemaUrl = iter.ReadString() + default: + iter.Skip() + } + return true + }) + return ils +} + +func readMetric(iter *jsoniter.Iterator) *otlpmetrics.Metric { + sp := &otlpmetrics.Metric{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "name": + sp.Name = iter.ReadString() + case "description": + sp.Description = iter.ReadString() + case "unit": + sp.Unit = iter.ReadString() + case "sum": + sp.Data = readSumMetric(iter) + case "gauge": + sp.Data = readGaugeMetric(iter) + case "histogram": + sp.Data = readHistogramMetric(iter) + case "exponential_histogram", "exponentialHistogram": + sp.Data = readExponentialHistogramMetric(iter) + case "summary": + sp.Data = readSummaryMetric(iter) + default: + iter.Skip() + } + return true + }) + return sp +} + +func readSumMetric(iter *jsoniter.Iterator) *otlpmetrics.Metric_Sum { + data := &otlpmetrics.Metric_Sum{ + Sum: &otlpmetrics.Sum{}, + } + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "aggregation_temporality", "aggregationTemporality": + data.Sum.AggregationTemporality = readAggregationTemporality(iter) + case "is_monotonic", "isMonotonic": + data.Sum.IsMonotonic = iter.ReadBool() + case "data_points", "dataPoints": + var dataPoints []*otlpmetrics.NumberDataPoint + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + dataPoints = append(dataPoints, readNumberDataPoint(iter)) + return true + }) + data.Sum.DataPoints = dataPoints + default: + iter.Skip() + } + return true + }) + return data +} + +func readGaugeMetric(iter *jsoniter.Iterator) *otlpmetrics.Metric_Gauge { + data := &otlpmetrics.Metric_Gauge{ + Gauge: &otlpmetrics.Gauge{}, + } + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "data_points", "dataPoints": + var dataPoints []*otlpmetrics.NumberDataPoint + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + dataPoints = append(dataPoints, readNumberDataPoint(iter)) + return true + }) + data.Gauge.DataPoints = dataPoints + default: + iter.Skip() + } + return true + }) + return data +} + +func readHistogramMetric(iter *jsoniter.Iterator) *otlpmetrics.Metric_Histogram { + data := &otlpmetrics.Metric_Histogram{ + Histogram: &otlpmetrics.Histogram{}, + } + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "data_points", "dataPoints": + var dataPoints []*otlpmetrics.HistogramDataPoint + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + dataPoints = append(dataPoints, readHistogramDataPoint(iter)) + return true + }) + data.Histogram.DataPoints = dataPoints + case "aggregation_temporality", "aggregationTemporality": + data.Histogram.AggregationTemporality = readAggregationTemporality(iter) + default: + iter.Skip() + } + return true + }) + return data +} + +func readExponentialHistogramMetric(iter *jsoniter.Iterator) *otlpmetrics.Metric_ExponentialHistogram { + data := &otlpmetrics.Metric_ExponentialHistogram{ + ExponentialHistogram: &otlpmetrics.ExponentialHistogram{}, + } + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "data_points", "dataPoints": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + data.ExponentialHistogram.DataPoints = append(data.ExponentialHistogram.DataPoints, + readExponentialHistogramDataPoint(iter)) + return true + }) + case "aggregation_temporality", "aggregationTemporality": + data.ExponentialHistogram.AggregationTemporality = readAggregationTemporality(iter) + default: + iter.Skip() + } + return true + }) + return data +} + +func readSummaryMetric(iter *jsoniter.Iterator) *otlpmetrics.Metric_Summary { + data := &otlpmetrics.Metric_Summary{ + Summary: &otlpmetrics.Summary{}, + } + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "data_points", "dataPoints": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + data.Summary.DataPoints = append(data.Summary.DataPoints, + readSummaryDataPoint(iter)) + return true + }) + default: + iter.Skip() + } + return true + }) + return data +} + +func readExemplar(iter *jsoniter.Iterator) otlpmetrics.Exemplar { + exemplar := otlpmetrics.Exemplar{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "filtered_attributes", "filteredAttributes": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + exemplar.FilteredAttributes = append(exemplar.FilteredAttributes, json.ReadAttribute(iter)) + return true + }) + case "timeUnixNano", "time_unix_nano": + exemplar.TimeUnixNano = json.ReadUint64(iter) + case "as_int", "asInt": + exemplar.Value = &otlpmetrics.Exemplar_AsInt{ + AsInt: json.ReadInt64(iter), + } + case "as_double", "asDouble": + exemplar.Value = &otlpmetrics.Exemplar_AsDouble{ + AsDouble: json.ReadFloat64(iter), + } + case "traceId", "trace_id": + if err := exemplar.TraceId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { + iter.ReportError("exemplar.traceId", fmt.Sprintf("parse trace_id:%v", err)) + } + case "spanId", "span_id": + if err := exemplar.SpanId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { + iter.ReportError("exemplar.spanId", fmt.Sprintf("parse span_id:%v", err)) + } + default: + iter.Skip() + } + return true + }) + return exemplar +} + +func readNumberDataPoint(iter *jsoniter.Iterator) *otlpmetrics.NumberDataPoint { + point := &otlpmetrics.NumberDataPoint{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "timeUnixNano", "time_unix_nano": + point.TimeUnixNano = json.ReadUint64(iter) + case "start_time_unix_nano", "startTimeUnixNano": + point.StartTimeUnixNano = json.ReadUint64(iter) + case "as_int", "asInt": + point.Value = &otlpmetrics.NumberDataPoint_AsInt{ + AsInt: json.ReadInt64(iter), + } + case "as_double", "asDouble": + point.Value = &otlpmetrics.NumberDataPoint_AsDouble{ + AsDouble: json.ReadFloat64(iter), + } + case "attributes": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + point.Attributes = append(point.Attributes, json.ReadAttribute(iter)) + return true + }) + case "exemplars": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + point.Exemplars = append(point.Exemplars, readExemplar(iter)) + return true + }) + case "flags": + point.Flags = json.ReadUint32(iter) + default: + iter.Skip() + } + return true + }) + return point +} + +func readHistogramDataPoint(iter *jsoniter.Iterator) *otlpmetrics.HistogramDataPoint { + point := &otlpmetrics.HistogramDataPoint{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "timeUnixNano", "time_unix_nano": + point.TimeUnixNano = json.ReadUint64(iter) + case "start_time_unix_nano", "startTimeUnixNano": + point.StartTimeUnixNano = json.ReadUint64(iter) + case "attributes": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + point.Attributes = append(point.Attributes, json.ReadAttribute(iter)) + return true + }) + case "count": + point.Count = json.ReadUint64(iter) + case "sum": + point.Sum_ = &otlpmetrics.HistogramDataPoint_Sum{Sum: json.ReadFloat64(iter)} + case "bucket_counts", "bucketCounts": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + point.BucketCounts = append(point.BucketCounts, json.ReadUint64(iter)) + return true + }) + case "explicit_bounds", "explicitBounds": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + point.ExplicitBounds = append(point.ExplicitBounds, json.ReadFloat64(iter)) + return true + }) + case "exemplars": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + point.Exemplars = append(point.Exemplars, readExemplar(iter)) + return true + }) + case "flags": + point.Flags = json.ReadUint32(iter) + case "max": + point.Max_ = &otlpmetrics.HistogramDataPoint_Max{ + Max: json.ReadFloat64(iter), + } + case "min": + point.Min_ = &otlpmetrics.HistogramDataPoint_Min{ + Min: json.ReadFloat64(iter), + } + default: + iter.Skip() + } + return true + }) + return point +} + +func readExponentialHistogramDataPoint(iter *jsoniter.Iterator) *otlpmetrics.ExponentialHistogramDataPoint { + point := &otlpmetrics.ExponentialHistogramDataPoint{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "timeUnixNano", "time_unix_nano": + point.TimeUnixNano = json.ReadUint64(iter) + case "start_time_unix_nano", "startTimeUnixNano": + point.StartTimeUnixNano = json.ReadUint64(iter) + case "attributes": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + point.Attributes = append(point.Attributes, json.ReadAttribute(iter)) + return true + }) + case "count": + point.Count = json.ReadUint64(iter) + case "sum": + point.Sum_ = &otlpmetrics.ExponentialHistogramDataPoint_Sum{ + Sum: json.ReadFloat64(iter), + } + case "scale": + point.Scale = iter.ReadInt32() + case "zero_count", "zeroCount": + point.ZeroCount = json.ReadUint64(iter) + case "positive": + point.Positive = readExponentialHistogramBuckets(iter) + case "negative": + point.Negative = readExponentialHistogramBuckets(iter) + case "exemplars": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + point.Exemplars = append(point.Exemplars, readExemplar(iter)) + return true + }) + case "flags": + point.Flags = json.ReadUint32(iter) + case "max": + point.Max_ = &otlpmetrics.ExponentialHistogramDataPoint_Max{ + Max: json.ReadFloat64(iter), + } + case "min": + point.Min_ = &otlpmetrics.ExponentialHistogramDataPoint_Min{ + Min: json.ReadFloat64(iter), + } + default: + iter.Skip() + } + return true + }) + return point +} + +func readSummaryDataPoint(iter *jsoniter.Iterator) *otlpmetrics.SummaryDataPoint { + point := &otlpmetrics.SummaryDataPoint{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "timeUnixNano", "time_unix_nano": + point.TimeUnixNano = json.ReadUint64(iter) + case "start_time_unix_nano", "startTimeUnixNano": + point.StartTimeUnixNano = json.ReadUint64(iter) + case "attributes": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + point.Attributes = append(point.Attributes, json.ReadAttribute(iter)) + return true + }) + case "count": + point.Count = json.ReadUint64(iter) + case "sum": + point.Sum = json.ReadFloat64(iter) + case "quantile_values", "quantileValues": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + point.QuantileValues = append(point.QuantileValues, readQuantileValue(iter)) + return true + }) + case "flags": + point.Flags = json.ReadUint32(iter) + default: + iter.Skip() + } + return true + }) + return point +} + +func readExponentialHistogramBuckets(iter *jsoniter.Iterator) otlpmetrics.ExponentialHistogramDataPoint_Buckets { + buckets := otlpmetrics.ExponentialHistogramDataPoint_Buckets{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "bucket_counts", "bucketCounts": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + buckets.BucketCounts = append(buckets.BucketCounts, json.ReadUint64(iter)) + return true + }) + case "offset": + buckets.Offset = iter.ReadInt32() + default: + iter.Skip() + } + return true + }) + return buckets +} + +func readQuantileValue(iter *jsoniter.Iterator) *otlpmetrics.SummaryDataPoint_ValueAtQuantile { + point := &otlpmetrics.SummaryDataPoint_ValueAtQuantile{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "quantile": + point.Quantile = json.ReadFloat64(iter) + case "value": + point.Value = json.ReadFloat64(iter) + default: + iter.Skip() + } + return true + }) + return point +} + +func readAggregationTemporality(iter *jsoniter.Iterator) otlpmetrics.AggregationTemporality { + return otlpmetrics.AggregationTemporality(json.ReadEnumValue(iter, otlpmetrics.AggregationTemporality_value)) +} + +func readExportMetricsPartialSuccess(iter *jsoniter.Iterator) otlpcollectormetrics.ExportMetricsPartialSuccess { + lpr := otlpcollectormetrics.ExportMetricsPartialSuccess{} + iter.ReadObjectCB(func(iterator *jsoniter.Iterator, f string) bool { + switch f { + case "rejected_data_points", "rejectedDataPoints": + lpr.RejectedDataPoints = json.ReadInt64(iter) + case "error_message", "errorMessage": + lpr.ErrorMessage = iter.ReadString() + default: + iter.Skip() + } + return true + }) + return lpr +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/json.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/json.go index c570eb163d5..2a17232e0d1 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/json.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/json.go @@ -17,50 +17,30 @@ package pmetric // import "go.opentelemetry.io/collector/pdata/pmetric" import ( "bytes" - "github.com/gogo/protobuf/jsonpb" - "go.opentelemetry.io/collector/pdata/internal" otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" - "go.opentelemetry.io/collector/pdata/internal/otlp" + "go.opentelemetry.io/collector/pdata/pmetric/internal/pmetricjson" ) -// NewJSONMarshaler returns a model.Marshaler. Marshals to OTLP json bytes. -func NewJSONMarshaler() Marshaler { - return newJSONMarshaler() -} +var delegate = pmetricjson.JSONMarshaler -type jsonMarshaler struct { - delegate jsonpb.Marshaler -} +var _ Marshaler = (*JSONMarshaler)(nil) -func newJSONMarshaler() *jsonMarshaler { - return &jsonMarshaler{delegate: jsonpb.Marshaler{}} -} +type JSONMarshaler struct{} -func (e *jsonMarshaler) MarshalMetrics(md Metrics) ([]byte, error) { +func (*JSONMarshaler) MarshalMetrics(md Metrics) ([]byte, error) { buf := bytes.Buffer{} - err := e.delegate.Marshal(&buf, internal.MetricsToOtlp(md)) + pb := internal.MetricsToProto(internal.Metrics(md)) + err := delegate.Marshal(&buf, &pb) return buf.Bytes(), err } -type jsonUnmarshaler struct { - delegate jsonpb.Unmarshaler -} - -// NewJSONUnmarshaler returns a model.Unmarshaler. Unmarshals from OTLP json bytes. -func NewJSONUnmarshaler() Unmarshaler { - return newJSONUnmarshaler() -} - -func newJSONUnmarshaler() *jsonUnmarshaler { - return &jsonUnmarshaler{delegate: jsonpb.Unmarshaler{}} -} +type JSONUnmarshaler struct{} -func (d *jsonUnmarshaler) UnmarshalMetrics(buf []byte) (Metrics, error) { - md := otlpmetrics.MetricsData{} - if err := d.delegate.Unmarshal(bytes.NewReader(buf), &md); err != nil { +func (*JSONUnmarshaler) UnmarshalMetrics(buf []byte) (Metrics, error) { + var md otlpmetrics.MetricsData + if err := pmetricjson.UnmarshalMetricsData(buf, &md); err != nil { return Metrics{}, err } - otlp.InstrumentationLibraryMetricsToScope(md.ResourceMetrics) - return internal.MetricsFromProto(md), nil + return Metrics(internal.MetricsFromProto(md)), nil } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/metric_data_point_flags.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/metric_data_point_flags.go new file mode 100644 index 00000000000..6338b9b7d67 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/metric_data_point_flags.go @@ -0,0 +1,39 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package pmetric // import "go.opentelemetry.io/collector/pdata/pmetric" + +const noRecordValueMask = uint32(1) + +var DefaultDataPointFlags = DataPointFlags(0) + +// DataPointFlags defines how a metric aggregator reports aggregated values. +// It describes how those values relate to the time interval over which they are aggregated. +type DataPointFlags uint32 + +// NoRecordedValue returns true if the DataPointFlags contains the NoRecordedValue flag. +func (ms DataPointFlags) NoRecordedValue() bool { + return uint32(ms)&noRecordValueMask != 0 +} + +// WithNoRecordedValue returns a new DataPointFlags, with the NoRecordedValue flag set to the given value. +func (ms DataPointFlags) WithNoRecordedValue(b bool) DataPointFlags { + orig := uint32(ms) + if b { + orig |= noRecordValueMask + } else { + orig &^= noRecordValueMask + } + return DataPointFlags(orig) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/metrics.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/metrics.go new file mode 100644 index 00000000000..f1739630f69 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/metrics.go @@ -0,0 +1,203 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package pmetric // import "go.opentelemetry.io/collector/pdata/pmetric" + +import ( + "go.opentelemetry.io/collector/pdata/internal" + otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1" + otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" +) + +// Metrics is the top-level struct that is propagated through the metrics pipeline. +// Use NewMetrics to create new instance, zero-initialized instance is not valid for use. +type Metrics internal.Metrics + +func newMetrics(orig *otlpcollectormetrics.ExportMetricsServiceRequest) Metrics { + return Metrics(internal.NewMetrics(orig)) +} + +func (ms Metrics) getOrig() *otlpcollectormetrics.ExportMetricsServiceRequest { + return internal.GetOrigMetrics(internal.Metrics(ms)) +} + +// NewMetrics creates a new Metrics struct. +func NewMetrics() Metrics { + return newMetrics(&otlpcollectormetrics.ExportMetricsServiceRequest{}) +} + +// CopyTo copies the Metrics instance overriding the destination. +func (ms Metrics) CopyTo(dest Metrics) { + ms.ResourceMetrics().CopyTo(dest.ResourceMetrics()) +} + +// MoveTo moves the Metrics instance overriding the destination and +// resetting the current instance to its zero value. +func (ms Metrics) MoveTo(dest Metrics) { + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpcollectormetrics.ExportMetricsServiceRequest{} +} + +// ResourceMetrics returns the ResourceMetricsSlice associated with this Metrics. +func (ms Metrics) ResourceMetrics() ResourceMetricsSlice { + return newResourceMetricsSlice(&ms.getOrig().ResourceMetrics) +} + +// MetricCount calculates the total number of metrics. +func (ms Metrics) MetricCount() int { + metricCount := 0 + rms := ms.ResourceMetrics() + for i := 0; i < rms.Len(); i++ { + rm := rms.At(i) + ilms := rm.ScopeMetrics() + for j := 0; j < ilms.Len(); j++ { + ilm := ilms.At(j) + metricCount += ilm.Metrics().Len() + } + } + return metricCount +} + +// DataPointCount calculates the total number of data points. +func (ms Metrics) DataPointCount() (dataPointCount int) { + rms := ms.ResourceMetrics() + for i := 0; i < rms.Len(); i++ { + rm := rms.At(i) + ilms := rm.ScopeMetrics() + for j := 0; j < ilms.Len(); j++ { + ilm := ilms.At(j) + ms := ilm.Metrics() + for k := 0; k < ms.Len(); k++ { + m := ms.At(k) + switch m.Type() { + case MetricTypeGauge: + dataPointCount += m.Gauge().DataPoints().Len() + case MetricTypeSum: + dataPointCount += m.Sum().DataPoints().Len() + case MetricTypeHistogram: + dataPointCount += m.Histogram().DataPoints().Len() + case MetricTypeExponentialHistogram: + dataPointCount += m.ExponentialHistogram().DataPoints().Len() + case MetricTypeSummary: + dataPointCount += m.Summary().DataPoints().Len() + } + } + } + } + return +} + +// MetricType specifies the type of data in a Metric. +type MetricType int32 + +const ( + // MetricTypeEmpty means that metric type is unset. + MetricTypeEmpty MetricType = iota + MetricTypeGauge + MetricTypeSum + MetricTypeHistogram + MetricTypeExponentialHistogram + MetricTypeSummary +) + +// String returns the string representation of the MetricType. +func (mdt MetricType) String() string { + switch mdt { + case MetricTypeEmpty: + return "Empty" + case MetricTypeGauge: + return "Gauge" + case MetricTypeSum: + return "Sum" + case MetricTypeHistogram: + return "Histogram" + case MetricTypeExponentialHistogram: + return "ExponentialHistogram" + case MetricTypeSummary: + return "Summary" + } + return "" +} + +// AggregationTemporality defines how a metric aggregator reports aggregated values. +// It describes how those values relate to the time interval over which they are aggregated. +type AggregationTemporality int32 + +const ( + // AggregationTemporalityUnspecified is the default AggregationTemporality, it MUST NOT be used. + AggregationTemporalityUnspecified = AggregationTemporality(otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED) + // AggregationTemporalityDelta is a AggregationTemporality for a metric aggregator which reports changes since last report time. + AggregationTemporalityDelta = AggregationTemporality(otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_DELTA) + // AggregationTemporalityCumulative is a AggregationTemporality for a metric aggregator which reports changes since a fixed start time. + AggregationTemporalityCumulative = AggregationTemporality(otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE) +) + +// String returns the string representation of the AggregationTemporality. +func (at AggregationTemporality) String() string { + switch at { + case AggregationTemporalityUnspecified: + return "Unspecified" + case AggregationTemporalityDelta: + return "Delta" + case AggregationTemporalityCumulative: + return "Cumulative" + } + return "" +} + +// NumberDataPointValueType specifies the type of NumberDataPoint value. +type NumberDataPointValueType int32 + +const ( + // NumberDataPointValueTypeEmpty means that data point value is unset. + NumberDataPointValueTypeEmpty NumberDataPointValueType = iota + NumberDataPointValueTypeInt + NumberDataPointValueTypeDouble +) + +// String returns the string representation of the NumberDataPointValueType. +func (nt NumberDataPointValueType) String() string { + switch nt { + case NumberDataPointValueTypeEmpty: + return "Empty" + case NumberDataPointValueTypeInt: + return "Int" + case NumberDataPointValueTypeDouble: + return "Double" + } + return "" +} + +// ExemplarValueType specifies the type of Exemplar measurement value. +type ExemplarValueType int32 + +const ( + // ExemplarValueTypeEmpty means that exemplar value is unset. + ExemplarValueTypeEmpty ExemplarValueType = iota + ExemplarValueTypeInt + ExemplarValueTypeDouble +) + +// String returns the string representation of the ExemplarValueType. +func (nt ExemplarValueType) String() string { + switch nt { + case ExemplarValueTypeEmpty: + return "Empty" + case ExemplarValueTypeInt: + return "Int" + case ExemplarValueTypeDouble: + return "Double" + } + return "" +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/pb.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pb.go index 40fe605080c..35778d9d01c 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/pb.go +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pb.go @@ -19,43 +19,24 @@ import ( otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" ) -// NewProtoMarshaler returns a Marshaler. Marshals to OTLP binary protobuf bytes. -func NewProtoMarshaler() Marshaler { - return newPbMarshaler() -} - -// TODO(#3842): Figure out how we want to represent/return *Sizers. -type pbMarshaler struct{} - -func newPbMarshaler() *pbMarshaler { - return &pbMarshaler{} -} +var _ MarshalSizer = (*ProtoMarshaler)(nil) -var _ Sizer = (*pbMarshaler)(nil) +type ProtoMarshaler struct{} -func (e *pbMarshaler) MarshalMetrics(md Metrics) ([]byte, error) { - pb := internal.MetricsToProto(md) +func (e *ProtoMarshaler) MarshalMetrics(md Metrics) ([]byte, error) { + pb := internal.MetricsToProto(internal.Metrics(md)) return pb.Marshal() } -func (e *pbMarshaler) MetricsSize(md Metrics) int { - pb := internal.MetricsToProto(md) +func (e *ProtoMarshaler) MetricsSize(md Metrics) int { + pb := internal.MetricsToProto(internal.Metrics(md)) return pb.Size() } -type pbUnmarshaler struct{} - -// NewProtoUnmarshaler returns a model.Unmarshaler. Unmarshals from OTLP binary protobuf bytes. -func NewProtoUnmarshaler() Unmarshaler { - return newPbUnmarshaler() -} - -func newPbUnmarshaler() *pbUnmarshaler { - return &pbUnmarshaler{} -} +type ProtoUnmarshaler struct{} -func (d *pbUnmarshaler) UnmarshalMetrics(buf []byte) (Metrics, error) { +func (d *ProtoUnmarshaler) UnmarshalMetrics(buf []byte) (Metrics, error) { pb := otlpmetrics.MetricsData{} err := pb.Unmarshal(buf) - return internal.MetricsFromProto(pb), err + return Metrics(internal.MetricsFromProto(pb)), err } diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/generated_metrics_otlp.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/generated_metrics_otlp.go new file mode 100644 index 00000000000..d16203f4e47 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/generated_metrics_otlp.go @@ -0,0 +1,82 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". + +package pmetricotlp + +import ( + "go.opentelemetry.io/collector/pdata/internal" + otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1" +) + +// ExportPartialSuccess represents the details of a partially successful export request. +// +// This is a reference type, if passed by value and callee modifies it the +// caller will see the modification. +// +// Must use NewExportPartialSuccess function to create new instances. +// Important: zero-initialized instance is not valid for use. + +type ExportPartialSuccess internal.MetricsExportPartialSuccess + +func newExportPartialSuccess(orig *otlpcollectormetrics.ExportMetricsPartialSuccess) ExportPartialSuccess { + return ExportPartialSuccess(internal.NewMetricsExportPartialSuccess(orig)) +} + +func (ms ExportPartialSuccess) getOrig() *otlpcollectormetrics.ExportMetricsPartialSuccess { + return internal.GetOrigMetricsExportPartialSuccess(internal.MetricsExportPartialSuccess(ms)) +} + +// NewExportPartialSuccess creates a new empty ExportPartialSuccess. +// +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. +func NewExportPartialSuccess() ExportPartialSuccess { + return newExportPartialSuccess(&otlpcollectormetrics.ExportMetricsPartialSuccess{}) +} + +// MoveTo moves all properties from the current struct overriding the destination and +// resetting the current instance to its zero value +func (ms ExportPartialSuccess) MoveTo(dest ExportPartialSuccess) { + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpcollectormetrics.ExportMetricsPartialSuccess{} +} + +// RejectedDataPoints returns the rejecteddatapoints associated with this ExportPartialSuccess. +func (ms ExportPartialSuccess) RejectedDataPoints() int64 { + return ms.getOrig().RejectedDataPoints +} + +// SetRejectedDataPoints replaces the rejecteddatapoints associated with this ExportPartialSuccess. +func (ms ExportPartialSuccess) SetRejectedDataPoints(v int64) { + ms.getOrig().RejectedDataPoints = v +} + +// ErrorMessage returns the errormessage associated with this ExportPartialSuccess. +func (ms ExportPartialSuccess) ErrorMessage() string { + return ms.getOrig().ErrorMessage +} + +// SetErrorMessage replaces the errormessage associated with this ExportPartialSuccess. +func (ms ExportPartialSuccess) SetErrorMessage(v string) { + ms.getOrig().ErrorMessage = v +} + +// CopyTo copies all properties from the current struct overriding the destination. +func (ms ExportPartialSuccess) CopyTo(dest ExportPartialSuccess) { + dest.SetRejectedDataPoints(ms.RejectedDataPoints()) + dest.SetErrorMessage(ms.ErrorMessage()) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/grpc.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/grpc.go new file mode 100644 index 00000000000..ed478410767 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/grpc.go @@ -0,0 +1,73 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package pmetricotlp // import "go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp" + +import ( + "context" + + "google.golang.org/grpc" + + otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1" + "go.opentelemetry.io/collector/pdata/internal/otlp" +) + +// GRPCClient is the client API for OTLP-GRPC Metrics service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type GRPCClient interface { + // Export pmetric.Metrics to the server. + // + // For performance reasons, it is recommended to keep this RPC + // alive for the entire life of the application. + Export(ctx context.Context, request ExportRequest, opts ...grpc.CallOption) (ExportResponse, error) +} + +// NewGRPCClient returns a new GRPCClient connected using the given connection. +func NewGRPCClient(cc *grpc.ClientConn) GRPCClient { + return &grpcClient{rawClient: otlpcollectormetrics.NewMetricsServiceClient(cc)} +} + +type grpcClient struct { + rawClient otlpcollectormetrics.MetricsServiceClient +} + +func (c *grpcClient) Export(ctx context.Context, request ExportRequest, opts ...grpc.CallOption) (ExportResponse, error) { + rsp, err := c.rawClient.Export(ctx, request.orig, opts...) + return ExportResponse{orig: rsp}, err +} + +// GRPCServer is the server API for OTLP gRPC MetricsService service. +type GRPCServer interface { + // Export is called every time a new request is received. + // + // For performance reasons, it is recommended to keep this RPC + // alive for the entire life of the application. + Export(context.Context, ExportRequest) (ExportResponse, error) +} + +// RegisterGRPCServer registers the GRPCServer to the grpc.Server. +func RegisterGRPCServer(s *grpc.Server, srv GRPCServer) { + otlpcollectormetrics.RegisterMetricsServiceServer(s, &rawMetricsServer{srv: srv}) +} + +type rawMetricsServer struct { + srv GRPCServer +} + +func (s rawMetricsServer) Export(ctx context.Context, request *otlpcollectormetrics.ExportMetricsServiceRequest) (*otlpcollectormetrics.ExportMetricsServiceResponse, error) { + otlp.MigrateMetrics(request.ResourceMetrics) + rsp, err := s.srv.Export(ctx, ExportRequest{orig: request}) + return rsp.orig, err +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/metrics.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/metrics.go deleted file mode 100644 index 7499e6e185c..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/metrics.go +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -package pmetricotlp // import "go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp" - -import ( - "bytes" - "context" - - "github.com/gogo/protobuf/jsonpb" - "google.golang.org/grpc" - - "go.opentelemetry.io/collector/pdata/internal" - otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1" - "go.opentelemetry.io/collector/pdata/internal/otlp" - "go.opentelemetry.io/collector/pdata/pmetric" -) - -var jsonMarshaler = &jsonpb.Marshaler{} -var jsonUnmarshaler = &jsonpb.Unmarshaler{} - -// Response represents the response for gRPC/HTTP client/server. -type Response struct { - orig *otlpcollectormetrics.ExportMetricsServiceResponse -} - -// NewResponse returns an empty Response. -func NewResponse() Response { - return Response{orig: &otlpcollectormetrics.ExportMetricsServiceResponse{}} -} - -// MarshalProto marshals Response into proto bytes. -func (mr Response) MarshalProto() ([]byte, error) { - return mr.orig.Marshal() -} - -// UnmarshalProto unmarshalls Response from proto bytes. -func (mr Response) UnmarshalProto(data []byte) error { - return mr.orig.Unmarshal(data) -} - -// MarshalJSON marshals Response into JSON bytes. -func (mr Response) MarshalJSON() ([]byte, error) { - var buf bytes.Buffer - if err := jsonMarshaler.Marshal(&buf, mr.orig); err != nil { - return nil, err - } - return buf.Bytes(), nil -} - -// UnmarshalJSON unmarshalls Response from JSON bytes. -func (mr Response) UnmarshalJSON(data []byte) error { - return jsonUnmarshaler.Unmarshal(bytes.NewReader(data), mr.orig) -} - -// Request represents the request for gRPC/HTTP client/server. -// It's a wrapper for pmetric.Metrics data. -type Request struct { - orig *otlpcollectormetrics.ExportMetricsServiceRequest -} - -// NewRequest returns an empty Request. -func NewRequest() Request { - return Request{orig: &otlpcollectormetrics.ExportMetricsServiceRequest{}} -} - -// NewRequestFromMetrics returns a Request from pmetric.Metrics. -// Because Request is a wrapper for pmetric.Metrics, -// any changes to the provided Metrics struct will be reflected in the Request and vice versa. -func NewRequestFromMetrics(m pmetric.Metrics) Request { - return Request{orig: internal.MetricsToOtlp(m)} -} - -// MarshalProto marshals Request into proto bytes. -func (mr Request) MarshalProto() ([]byte, error) { - return mr.orig.Marshal() -} - -// UnmarshalProto unmarshalls Request from proto bytes. -func (mr Request) UnmarshalProto(data []byte) error { - return mr.orig.Unmarshal(data) -} - -// MarshalJSON marshals Request into JSON bytes. -func (mr Request) MarshalJSON() ([]byte, error) { - var buf bytes.Buffer - if err := jsonMarshaler.Marshal(&buf, mr.orig); err != nil { - return nil, err - } - return buf.Bytes(), nil -} - -// UnmarshalJSON unmarshalls Request from JSON bytes. -func (mr Request) UnmarshalJSON(data []byte) error { - if err := jsonUnmarshaler.Unmarshal(bytes.NewReader(data), mr.orig); err != nil { - return err - } - otlp.InstrumentationLibraryMetricsToScope(mr.orig.ResourceMetrics) - return nil -} - -func (mr Request) Metrics() pmetric.Metrics { - return internal.MetricsFromOtlp(mr.orig) -} - -// Client is the client API for OTLP-GRPC Metrics service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type Client interface { - // Export pmetric.Metrics to the server. - // - // For performance reasons, it is recommended to keep this RPC - // alive for the entire life of the application. - Export(ctx context.Context, request Request, opts ...grpc.CallOption) (Response, error) -} - -type metricsClient struct { - rawClient otlpcollectormetrics.MetricsServiceClient -} - -// NewClient returns a new Client connected using the given connection. -func NewClient(cc *grpc.ClientConn) Client { - return &metricsClient{rawClient: otlpcollectormetrics.NewMetricsServiceClient(cc)} -} - -func (c *metricsClient) Export(ctx context.Context, request Request, opts ...grpc.CallOption) (Response, error) { - rsp, err := c.rawClient.Export(ctx, request.orig, opts...) - return Response{orig: rsp}, err -} - -// Server is the server API for OTLP gRPC MetricsService service. -type Server interface { - // Export is called every time a new request is received. - // - // For performance reasons, it is recommended to keep this RPC - // alive for the entire life of the application. - Export(context.Context, Request) (Response, error) -} - -// RegisterServer registers the Server to the grpc.Server. -func RegisterServer(s *grpc.Server, srv Server) { - otlpcollectormetrics.RegisterMetricsServiceServer(s, &rawMetricsServer{srv: srv}) -} - -type rawMetricsServer struct { - srv Server -} - -func (s rawMetricsServer) Export(ctx context.Context, request *otlpcollectormetrics.ExportMetricsServiceRequest) (*otlpcollectormetrics.ExportMetricsServiceResponse, error) { - otlp.InstrumentationLibraryMetricsToScope(request.ResourceMetrics) - rsp, err := s.srv.Export(ctx, Request{orig: request}) - return rsp.orig, err -} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/request.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/request.go new file mode 100644 index 00000000000..3dd6a7544f0 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/request.go @@ -0,0 +1,70 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package pmetricotlp // import "go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp" + +import ( + "bytes" + + "go.opentelemetry.io/collector/pdata/internal" + otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/pmetric/internal/pmetricjson" +) + +// ExportRequest represents the request for gRPC/HTTP client/server. +// It's a wrapper for pmetric.Metrics data. +type ExportRequest struct { + orig *otlpcollectormetrics.ExportMetricsServiceRequest +} + +// NewExportRequest returns an empty ExportRequest. +func NewExportRequest() ExportRequest { + return ExportRequest{orig: &otlpcollectormetrics.ExportMetricsServiceRequest{}} +} + +// NewExportRequestFromMetrics returns a ExportRequest from pmetric.Metrics. +// Because ExportRequest is a wrapper for pmetric.Metrics, +// any changes to the provided Metrics struct will be reflected in the ExportRequest and vice versa. +func NewExportRequestFromMetrics(md pmetric.Metrics) ExportRequest { + return ExportRequest{orig: internal.GetOrigMetrics(internal.Metrics(md))} +} + +// MarshalProto marshals ExportRequest into proto bytes. +func (mr ExportRequest) MarshalProto() ([]byte, error) { + return mr.orig.Marshal() +} + +// UnmarshalProto unmarshalls ExportRequest from proto bytes. +func (mr ExportRequest) UnmarshalProto(data []byte) error { + return mr.orig.Unmarshal(data) +} + +// MarshalJSON marshals ExportRequest into JSON bytes. +func (mr ExportRequest) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + if err := pmetricjson.JSONMarshaler.Marshal(&buf, mr.orig); err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +// UnmarshalJSON unmarshalls ExportRequest from JSON bytes. +func (mr ExportRequest) UnmarshalJSON(data []byte) error { + return pmetricjson.UnmarshalExportMetricsServiceRequest(data, mr.orig) +} + +func (mr ExportRequest) Metrics() pmetric.Metrics { + return pmetric.Metrics(internal.NewMetrics(mr.orig)) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/response.go b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/response.go new file mode 100644 index 00000000000..9e9fd549254 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp/response.go @@ -0,0 +1,61 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package pmetricotlp // import "go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp" +import ( + "bytes" + + "go.opentelemetry.io/collector/pdata/internal" + otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1" + "go.opentelemetry.io/collector/pdata/pmetric/internal/pmetricjson" +) + +// ExportResponse represents the response for gRPC/HTTP client/server. +type ExportResponse struct { + orig *otlpcollectormetrics.ExportMetricsServiceResponse +} + +// NewExportResponse returns an empty ExportResponse. +func NewExportResponse() ExportResponse { + return ExportResponse{orig: &otlpcollectormetrics.ExportMetricsServiceResponse{}} +} + +// MarshalProto marshals ExportResponse into proto bytes. +func (ms ExportResponse) MarshalProto() ([]byte, error) { + return ms.orig.Marshal() +} + +// UnmarshalProto unmarshalls ExportResponse from proto bytes. +func (ms ExportResponse) UnmarshalProto(data []byte) error { + return ms.orig.Unmarshal(data) +} + +// MarshalJSON marshals ExportResponse into JSON bytes. +func (ms ExportResponse) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + if err := pmetricjson.JSONMarshaler.Marshal(&buf, ms.orig); err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +// UnmarshalJSON unmarshalls ExportResponse from JSON bytes. +func (ms ExportResponse) UnmarshalJSON(data []byte) error { + return pmetricjson.UnmarshalExportMetricsServiceResponse(data, ms.orig) +} + +// PartialSuccess returns the ExportLogsPartialSuccess associated with this ExportResponse. +func (ms ExportResponse) PartialSuccess() ExportPartialSuccess { + return ExportPartialSuccess(internal.NewMetricsExportPartialSuccess(&ms.orig.PartialSuccess)) +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/alias.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/alias.go deleted file mode 100644 index 331f52c5e77..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/alias.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -package ptrace // import "go.opentelemetry.io/collector/pdata/ptrace" - -import "go.opentelemetry.io/collector/pdata/internal" - -// This file contains aliases for trace data structures. - -// Traces is the top-level struct that is propagated through the traces pipeline. -// Use NewTraces to create new instance, zero-initialized instance is not valid for use. -type Traces = internal.Traces - -// NewTraces creates a new Traces struct. -var NewTraces = internal.NewTraces - -// TraceState is a string representing the tracestate in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header -type TraceState = internal.TraceState - -const ( - // TraceStateEmpty represents the empty TraceState. - TraceStateEmpty = internal.TraceStateEmpty -) - -// SpanKind is the type of span. Can be used to specify additional relationships between spans -// in addition to a parent/child relationship. -type SpanKind = internal.SpanKind - -const ( - // SpanKindUnspecified represents that the SpanKind is unspecified, it MUST NOT be used. - SpanKindUnspecified = internal.SpanKindUnspecified - - // SpanKindInternal indicates that the span represents an internal operation within an application, - // as opposed to an operation happening at the boundaries. Default value. - SpanKindInternal = internal.SpanKindInternal - - // SpanKindServer indicates that the span covers server-side handling of an RPC or other - // remote network request. - SpanKindServer = internal.SpanKindServer - - // SpanKindProducer indicates that the span describes a producer sending a message to a broker. - // Unlike CLIENT and SERVER, there is often no direct critical path latency relationship - // between producer and consumer spans. - // A PRODUCER span ends when the message was accepted by the broker while the logical processing of - // the message might span a much longer time. - SpanKindClient = internal.SpanKindClient - - // SpanKindProducer indicates that the span describes a producer sending a message to a broker. - // Unlike CLIENT and SERVER, there is often no direct critical path latency relationship - // between producer and consumer spans. - // A PRODUCER span ends when the message was accepted by the broker while the logical processing of - // the message might span a much longer time. - SpanKindProducer = internal.SpanKindProducer - - // SpanKindConsumer indicates that the span describes consumer receiving a message from a broker. - // Like the PRODUCER kind, there is often no direct critical path latency relationship between - // producer and consumer spans. - SpanKindConsumer = internal.SpanKindConsumer -) - -// StatusCode mirrors the codes defined at -// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status -type StatusCode = internal.StatusCode - -const ( - StatusCodeUnset = internal.StatusCodeUnset - StatusCodeOk = internal.StatusCodeOk - StatusCodeError = internal.StatusCodeError -) diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/encoding.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/encoding.go index e1c2d72a33d..78c2fba7cb8 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/encoding.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/encoding.go @@ -14,6 +14,12 @@ package ptrace // import "go.opentelemetry.io/collector/pdata/ptrace" +// MarshalSizer is the interface that groups the basic Marshal and Size methods +type MarshalSizer interface { + Marshaler + Sizer +} + // Marshaler marshals pdata.Traces into bytes. type Marshaler interface { // MarshalTraces the given pdata.Traces into bytes. diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_alias.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_alias.go deleted file mode 100644 index e932ad1e0e0..00000000000 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_alias.go +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". - -package ptrace - -import "go.opentelemetry.io/collector/pdata/internal" - -// ResourceSpansSlice logically represents a slice of ResourceSpans. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewResourceSpansSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ResourceSpansSlice = internal.ResourceSpansSlice - -// NewResourceSpansSlice creates a ResourceSpansSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewResourceSpansSlice = internal.NewResourceSpansSlice - -// ResourceSpans is a collection of spans from a Resource. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewResourceSpans function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ResourceSpans = internal.ResourceSpans - -// NewResourceSpans is an alias for a function to create a new empty ResourceSpans. -var NewResourceSpans = internal.NewResourceSpans - -// ScopeSpansSlice logically represents a slice of ScopeSpans. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewScopeSpansSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ScopeSpansSlice = internal.ScopeSpansSlice - -// NewScopeSpansSlice creates a ScopeSpansSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewScopeSpansSlice = internal.NewScopeSpansSlice - -// ScopeSpans is a collection of spans from a LibraryInstrumentation. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewScopeSpans function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ScopeSpans = internal.ScopeSpans - -// NewScopeSpans is an alias for a function to create a new empty ScopeSpans. -var NewScopeSpans = internal.NewScopeSpans - -// SpanSlice logically represents a slice of Span. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewSpanSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type SpanSlice = internal.SpanSlice - -// NewSpanSlice creates a SpanSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewSpanSlice = internal.NewSpanSlice - -// Span represents a single operation within a trace. -// See Span definition in OTLP: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewSpan function to create new instances. -// Important: zero-initialized instance is not valid for use. -type Span = internal.Span - -// NewSpan is an alias for a function to create a new empty Span. -var NewSpan = internal.NewSpan - -// SpanEventSlice logically represents a slice of SpanEvent. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewSpanEventSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type SpanEventSlice = internal.SpanEventSlice - -// NewSpanEventSlice creates a SpanEventSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewSpanEventSlice = internal.NewSpanEventSlice - -// SpanEvent is a time-stamped annotation of the span, consisting of user-supplied -// text description and key-value pairs. See OTLP for event definition. -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewSpanEvent function to create new instances. -// Important: zero-initialized instance is not valid for use. -type SpanEvent = internal.SpanEvent - -// NewSpanEvent is an alias for a function to create a new empty SpanEvent. -var NewSpanEvent = internal.NewSpanEvent - -// SpanLinkSlice logically represents a slice of SpanLink. -// -// This is a reference type. If passed by value and callee modifies it, the -// caller will see the modification. -// -// Must use NewSpanLinkSlice function to create new instances. -// Important: zero-initialized instance is not valid for use. -type SpanLinkSlice = internal.SpanLinkSlice - -// NewSpanLinkSlice creates a SpanLinkSlice with 0 elements. -// Can use "EnsureCapacity" to initialize with a given capacity. -var NewSpanLinkSlice = internal.NewSpanLinkSlice - -// SpanLink is a pointer from the current span to another span in the same trace or in a -// different trace. -// See Link definition in OTLP: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewSpanLink function to create new instances. -// Important: zero-initialized instance is not valid for use. -type SpanLink = internal.SpanLink - -// NewSpanLink is an alias for a function to create a new empty SpanLink. -var NewSpanLink = internal.NewSpanLink - -// SpanStatus is an optional final status for this span. Semantically, when Status was not -// set, that means the span ended without errors and to assume Status.Ok (code = 0). -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewSpanStatus function to create new instances. -// Important: zero-initialized instance is not valid for use. -type SpanStatus = internal.SpanStatus - -// NewSpanStatus is an alias for a function to create a new empty SpanStatus. -var NewSpanStatus = internal.NewSpanStatus diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_ptrace.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_traces.go similarity index 61% rename from vendor/go.opentelemetry.io/collector/pdata/internal/generated_ptrace.go rename to vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_traces.go index dc40b5e131a..b84d11404b6 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_ptrace.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/generated_traces.go @@ -15,12 +15,15 @@ // Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". -package internal +package ptrace import ( "sort" + "go.opentelemetry.io/collector/pdata/internal" + "go.opentelemetry.io/collector/pdata/internal/data" otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" + "go.opentelemetry.io/collector/pdata/pcommon" ) // ResourceSpansSlice logically represents a slice of ResourceSpans. @@ -30,59 +33,60 @@ import ( // // Must use NewResourceSpansSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type ResourceSpansSlice struct { - // orig points to the slice otlptrace.ResourceSpans field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]*otlptrace.ResourceSpans -} +type ResourceSpansSlice internal.ResourceSpansSlice func newResourceSpansSlice(orig *[]*otlptrace.ResourceSpans) ResourceSpansSlice { - return ResourceSpansSlice{orig} + return ResourceSpansSlice(internal.NewResourceSpansSlice(orig)) +} + +func (ms ResourceSpansSlice) getOrig() *[]*otlptrace.ResourceSpans { + return internal.GetOrigResourceSpansSlice(internal.ResourceSpansSlice(ms)) } // NewResourceSpansSlice creates a ResourceSpansSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewResourceSpansSlice() ResourceSpansSlice { orig := []*otlptrace.ResourceSpans(nil) - return ResourceSpansSlice{&orig} + return newResourceSpansSlice(&orig) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewResourceSpansSlice()". func (es ResourceSpansSlice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es ResourceSpansSlice) At(ix int) ResourceSpans { - return newResourceSpans((*es.orig)[ix]) + return newResourceSpans((*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es ResourceSpansSlice) CopyTo(dest ResourceSpansSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newResourceSpans((*es.orig)[i]).CopyTo(newResourceSpans((*dest.orig)[i])) + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] + for i := range *es.getOrig() { + newResourceSpans((*es.getOrig())[i]).CopyTo(newResourceSpans((*dest.getOrig())[i])) } return } origs := make([]otlptrace.ResourceSpans, srcLen) wrappers := make([]*otlptrace.ResourceSpans, srcLen) - for i := range *es.orig { + for i := range *es.getOrig() { wrappers[i] = &origs[i] - newResourceSpans((*es.orig)[i]).CopyTo(newResourceSpans(wrappers[i])) + newResourceSpans((*es.getOrig())[i]).CopyTo(newResourceSpans(wrappers[i])) } - *dest.orig = wrappers + *dest.getOrig() = wrappers } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. @@ -90,61 +94,55 @@ func (es ResourceSpansSlice) CopyTo(dest ResourceSpansSlice) { // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new ResourceSpansSlice can be initialized: -// es := NewResourceSpansSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewResourceSpansSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es ResourceSpansSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]*otlptrace.ResourceSpans, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]*otlptrace.ResourceSpans, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty ResourceSpans. // It returns the newly added ResourceSpans. func (es ResourceSpansSlice) AppendEmpty() ResourceSpans { - *es.orig = append(*es.orig, &otlptrace.ResourceSpans{}) + *es.getOrig() = append(*es.getOrig(), &otlptrace.ResourceSpans{}) return es.At(es.Len() - 1) } // Sort sorts the ResourceSpans elements within ResourceSpansSlice given the // provided less function so that two instances of ResourceSpansSlice // can be compared. -// -// Returns the same instance to allow nicer code like: -// lessFunc := func(a, b ResourceSpans) bool { -// return a.Name() < b.Name() // choose any comparison here -// } -// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) -func (es ResourceSpansSlice) Sort(less func(a, b ResourceSpans) bool) ResourceSpansSlice { - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) - return es +func (es ResourceSpansSlice) Sort(less func(a, b ResourceSpans) bool) { + sort.SliceStable(*es.getOrig(), func(i, j int) bool { return less(es.At(i), es.At(j)) }) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es ResourceSpansSlice) MoveAndAppendTo(dest ResourceSpansSlice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es ResourceSpansSlice) RemoveIf(f func(ResourceSpans) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -153,11 +151,11 @@ func (es ResourceSpansSlice) RemoveIf(f func(ResourceSpans) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } // ResourceSpans is a collection of spans from a Resource. @@ -167,12 +165,15 @@ func (es ResourceSpansSlice) RemoveIf(f func(ResourceSpans) bool) { // // Must use NewResourceSpans function to create new instances. // Important: zero-initialized instance is not valid for use. -type ResourceSpans struct { - orig *otlptrace.ResourceSpans -} + +type ResourceSpans internal.ResourceSpans func newResourceSpans(orig *otlptrace.ResourceSpans) ResourceSpans { - return ResourceSpans{orig: orig} + return ResourceSpans(internal.NewResourceSpans(orig)) +} + +func (ms ResourceSpans) getOrig() *otlptrace.ResourceSpans { + return internal.GetOrigResourceSpans(internal.ResourceSpans(ms)) } // NewResourceSpans creates a new empty ResourceSpans. @@ -183,34 +184,34 @@ func NewResourceSpans() ResourceSpans { return newResourceSpans(&otlptrace.ResourceSpans{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms ResourceSpans) MoveTo(dest ResourceSpans) { - *dest.orig = *ms.orig - *ms.orig = otlptrace.ResourceSpans{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlptrace.ResourceSpans{} } // Resource returns the resource associated with this ResourceSpans. -func (ms ResourceSpans) Resource() Resource { - return newResource(&(*ms.orig).Resource) +func (ms ResourceSpans) Resource() pcommon.Resource { + return pcommon.Resource(internal.NewResource(&ms.getOrig().Resource)) } // SchemaUrl returns the schemaurl associated with this ResourceSpans. func (ms ResourceSpans) SchemaUrl() string { - return (*ms.orig).SchemaUrl + return ms.getOrig().SchemaUrl } // SetSchemaUrl replaces the schemaurl associated with this ResourceSpans. func (ms ResourceSpans) SetSchemaUrl(v string) { - (*ms.orig).SchemaUrl = v + ms.getOrig().SchemaUrl = v } // ScopeSpans returns the ScopeSpans associated with this ResourceSpans. func (ms ResourceSpans) ScopeSpans() ScopeSpansSlice { - return newScopeSpansSlice(&(*ms.orig).ScopeSpans) + return ScopeSpansSlice(internal.NewScopeSpansSlice(&ms.getOrig().ScopeSpans)) } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms ResourceSpans) CopyTo(dest ResourceSpans) { ms.Resource().CopyTo(dest.Resource()) dest.SetSchemaUrl(ms.SchemaUrl()) @@ -224,59 +225,60 @@ func (ms ResourceSpans) CopyTo(dest ResourceSpans) { // // Must use NewScopeSpansSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type ScopeSpansSlice struct { - // orig points to the slice otlptrace.ScopeSpans field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]*otlptrace.ScopeSpans -} +type ScopeSpansSlice internal.ScopeSpansSlice func newScopeSpansSlice(orig *[]*otlptrace.ScopeSpans) ScopeSpansSlice { - return ScopeSpansSlice{orig} + return ScopeSpansSlice(internal.NewScopeSpansSlice(orig)) +} + +func (ms ScopeSpansSlice) getOrig() *[]*otlptrace.ScopeSpans { + return internal.GetOrigScopeSpansSlice(internal.ScopeSpansSlice(ms)) } // NewScopeSpansSlice creates a ScopeSpansSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewScopeSpansSlice() ScopeSpansSlice { orig := []*otlptrace.ScopeSpans(nil) - return ScopeSpansSlice{&orig} + return newScopeSpansSlice(&orig) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewScopeSpansSlice()". func (es ScopeSpansSlice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es ScopeSpansSlice) At(ix int) ScopeSpans { - return newScopeSpans((*es.orig)[ix]) + return newScopeSpans((*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es ScopeSpansSlice) CopyTo(dest ScopeSpansSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newScopeSpans((*es.orig)[i]).CopyTo(newScopeSpans((*dest.orig)[i])) + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] + for i := range *es.getOrig() { + newScopeSpans((*es.getOrig())[i]).CopyTo(newScopeSpans((*dest.getOrig())[i])) } return } origs := make([]otlptrace.ScopeSpans, srcLen) wrappers := make([]*otlptrace.ScopeSpans, srcLen) - for i := range *es.orig { + for i := range *es.getOrig() { wrappers[i] = &origs[i] - newScopeSpans((*es.orig)[i]).CopyTo(newScopeSpans(wrappers[i])) + newScopeSpans((*es.getOrig())[i]).CopyTo(newScopeSpans(wrappers[i])) } - *dest.orig = wrappers + *dest.getOrig() = wrappers } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. @@ -284,61 +286,55 @@ func (es ScopeSpansSlice) CopyTo(dest ScopeSpansSlice) { // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new ScopeSpansSlice can be initialized: -// es := NewScopeSpansSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewScopeSpansSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es ScopeSpansSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]*otlptrace.ScopeSpans, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]*otlptrace.ScopeSpans, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty ScopeSpans. // It returns the newly added ScopeSpans. func (es ScopeSpansSlice) AppendEmpty() ScopeSpans { - *es.orig = append(*es.orig, &otlptrace.ScopeSpans{}) + *es.getOrig() = append(*es.getOrig(), &otlptrace.ScopeSpans{}) return es.At(es.Len() - 1) } // Sort sorts the ScopeSpans elements within ScopeSpansSlice given the // provided less function so that two instances of ScopeSpansSlice // can be compared. -// -// Returns the same instance to allow nicer code like: -// lessFunc := func(a, b ScopeSpans) bool { -// return a.Name() < b.Name() // choose any comparison here -// } -// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) -func (es ScopeSpansSlice) Sort(less func(a, b ScopeSpans) bool) ScopeSpansSlice { - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) - return es +func (es ScopeSpansSlice) Sort(less func(a, b ScopeSpans) bool) { + sort.SliceStable(*es.getOrig(), func(i, j int) bool { return less(es.At(i), es.At(j)) }) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es ScopeSpansSlice) MoveAndAppendTo(dest ScopeSpansSlice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es ScopeSpansSlice) RemoveIf(f func(ScopeSpans) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -347,11 +343,11 @@ func (es ScopeSpansSlice) RemoveIf(f func(ScopeSpans) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } // ScopeSpans is a collection of spans from a LibraryInstrumentation. @@ -361,12 +357,15 @@ func (es ScopeSpansSlice) RemoveIf(f func(ScopeSpans) bool) { // // Must use NewScopeSpans function to create new instances. // Important: zero-initialized instance is not valid for use. -type ScopeSpans struct { - orig *otlptrace.ScopeSpans -} + +type ScopeSpans internal.ScopeSpans func newScopeSpans(orig *otlptrace.ScopeSpans) ScopeSpans { - return ScopeSpans{orig: orig} + return ScopeSpans(internal.NewScopeSpans(orig)) +} + +func (ms ScopeSpans) getOrig() *otlptrace.ScopeSpans { + return internal.GetOrigScopeSpans(internal.ScopeSpans(ms)) } // NewScopeSpans creates a new empty ScopeSpans. @@ -377,34 +376,34 @@ func NewScopeSpans() ScopeSpans { return newScopeSpans(&otlptrace.ScopeSpans{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms ScopeSpans) MoveTo(dest ScopeSpans) { - *dest.orig = *ms.orig - *ms.orig = otlptrace.ScopeSpans{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlptrace.ScopeSpans{} } // Scope returns the scope associated with this ScopeSpans. -func (ms ScopeSpans) Scope() InstrumentationScope { - return newInstrumentationScope(&(*ms.orig).Scope) +func (ms ScopeSpans) Scope() pcommon.InstrumentationScope { + return pcommon.InstrumentationScope(internal.NewInstrumentationScope(&ms.getOrig().Scope)) } // SchemaUrl returns the schemaurl associated with this ScopeSpans. func (ms ScopeSpans) SchemaUrl() string { - return (*ms.orig).SchemaUrl + return ms.getOrig().SchemaUrl } // SetSchemaUrl replaces the schemaurl associated with this ScopeSpans. func (ms ScopeSpans) SetSchemaUrl(v string) { - (*ms.orig).SchemaUrl = v + ms.getOrig().SchemaUrl = v } // Spans returns the Spans associated with this ScopeSpans. func (ms ScopeSpans) Spans() SpanSlice { - return newSpanSlice(&(*ms.orig).Spans) + return SpanSlice(internal.NewSpanSlice(&ms.getOrig().Spans)) } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms ScopeSpans) CopyTo(dest ScopeSpans) { ms.Scope().CopyTo(dest.Scope()) dest.SetSchemaUrl(ms.SchemaUrl()) @@ -418,59 +417,60 @@ func (ms ScopeSpans) CopyTo(dest ScopeSpans) { // // Must use NewSpanSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type SpanSlice struct { - // orig points to the slice otlptrace.Span field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]*otlptrace.Span -} +type SpanSlice internal.SpanSlice func newSpanSlice(orig *[]*otlptrace.Span) SpanSlice { - return SpanSlice{orig} + return SpanSlice(internal.NewSpanSlice(orig)) +} + +func (ms SpanSlice) getOrig() *[]*otlptrace.Span { + return internal.GetOrigSpanSlice(internal.SpanSlice(ms)) } // NewSpanSlice creates a SpanSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewSpanSlice() SpanSlice { orig := []*otlptrace.Span(nil) - return SpanSlice{&orig} + return newSpanSlice(&orig) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewSpanSlice()". func (es SpanSlice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es SpanSlice) At(ix int) Span { - return newSpan((*es.orig)[ix]) + return newSpan((*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es SpanSlice) CopyTo(dest SpanSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newSpan((*es.orig)[i]).CopyTo(newSpan((*dest.orig)[i])) + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] + for i := range *es.getOrig() { + newSpan((*es.getOrig())[i]).CopyTo(newSpan((*dest.getOrig())[i])) } return } origs := make([]otlptrace.Span, srcLen) wrappers := make([]*otlptrace.Span, srcLen) - for i := range *es.orig { + for i := range *es.getOrig() { wrappers[i] = &origs[i] - newSpan((*es.orig)[i]).CopyTo(newSpan(wrappers[i])) + newSpan((*es.getOrig())[i]).CopyTo(newSpan(wrappers[i])) } - *dest.orig = wrappers + *dest.getOrig() = wrappers } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. @@ -478,61 +478,55 @@ func (es SpanSlice) CopyTo(dest SpanSlice) { // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new SpanSlice can be initialized: -// es := NewSpanSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewSpanSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es SpanSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]*otlptrace.Span, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]*otlptrace.Span, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty Span. // It returns the newly added Span. func (es SpanSlice) AppendEmpty() Span { - *es.orig = append(*es.orig, &otlptrace.Span{}) + *es.getOrig() = append(*es.getOrig(), &otlptrace.Span{}) return es.At(es.Len() - 1) } // Sort sorts the Span elements within SpanSlice given the // provided less function so that two instances of SpanSlice // can be compared. -// -// Returns the same instance to allow nicer code like: -// lessFunc := func(a, b Span) bool { -// return a.Name() < b.Name() // choose any comparison here -// } -// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) -func (es SpanSlice) Sort(less func(a, b Span) bool) SpanSlice { - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) - return es +func (es SpanSlice) Sort(less func(a, b Span) bool) { + sort.SliceStable(*es.getOrig(), func(i, j int) bool { return less(es.At(i), es.At(j)) }) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es SpanSlice) MoveAndAppendTo(dest SpanSlice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es SpanSlice) RemoveIf(f func(Span) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -541,11 +535,11 @@ func (es SpanSlice) RemoveIf(f func(Span) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } // Span represents a single operation within a trace. @@ -556,12 +550,15 @@ func (es SpanSlice) RemoveIf(f func(Span) bool) { // // Must use NewSpan function to create new instances. // Important: zero-initialized instance is not valid for use. -type Span struct { - orig *otlptrace.Span -} + +type Span internal.Span func newSpan(orig *otlptrace.Span) Span { - return Span{orig: orig} + return Span(internal.NewSpan(orig)) +} + +func (ms Span) getOrig() *otlptrace.Span { + return internal.GetOrigSpan(internal.Span(ms)) } // NewSpan creates a new empty Span. @@ -572,148 +569,143 @@ func NewSpan() Span { return newSpan(&otlptrace.Span{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms Span) MoveTo(dest Span) { - *dest.orig = *ms.orig - *ms.orig = otlptrace.Span{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlptrace.Span{} } // TraceID returns the traceid associated with this Span. -func (ms Span) TraceID() TraceID { - return TraceID{orig: ((*ms.orig).TraceId)} +func (ms Span) TraceID() pcommon.TraceID { + return pcommon.TraceID(ms.getOrig().TraceId) } // SetTraceID replaces the traceid associated with this Span. -func (ms Span) SetTraceID(v TraceID) { - (*ms.orig).TraceId = v.orig +func (ms Span) SetTraceID(v pcommon.TraceID) { + ms.getOrig().TraceId = data.TraceID(v) } // SpanID returns the spanid associated with this Span. -func (ms Span) SpanID() SpanID { - return SpanID{orig: ((*ms.orig).SpanId)} +func (ms Span) SpanID() pcommon.SpanID { + return pcommon.SpanID(ms.getOrig().SpanId) } // SetSpanID replaces the spanid associated with this Span. -func (ms Span) SetSpanID(v SpanID) { - (*ms.orig).SpanId = v.orig +func (ms Span) SetSpanID(v pcommon.SpanID) { + ms.getOrig().SpanId = data.SpanID(v) } // TraceState returns the tracestate associated with this Span. -func (ms Span) TraceState() TraceState { - return TraceState((*ms.orig).TraceState) -} - -// SetTraceState replaces the tracestate associated with this Span. -func (ms Span) SetTraceState(v TraceState) { - (*ms.orig).TraceState = string(v) +func (ms Span) TraceState() pcommon.TraceState { + return pcommon.TraceState(internal.NewTraceState(&ms.getOrig().TraceState)) } // ParentSpanID returns the parentspanid associated with this Span. -func (ms Span) ParentSpanID() SpanID { - return SpanID{orig: ((*ms.orig).ParentSpanId)} +func (ms Span) ParentSpanID() pcommon.SpanID { + return pcommon.SpanID(ms.getOrig().ParentSpanId) } // SetParentSpanID replaces the parentspanid associated with this Span. -func (ms Span) SetParentSpanID(v SpanID) { - (*ms.orig).ParentSpanId = v.orig +func (ms Span) SetParentSpanID(v pcommon.SpanID) { + ms.getOrig().ParentSpanId = data.SpanID(v) } // Name returns the name associated with this Span. func (ms Span) Name() string { - return (*ms.orig).Name + return ms.getOrig().Name } // SetName replaces the name associated with this Span. func (ms Span) SetName(v string) { - (*ms.orig).Name = v + ms.getOrig().Name = v } // Kind returns the kind associated with this Span. func (ms Span) Kind() SpanKind { - return SpanKind((*ms.orig).Kind) + return SpanKind(ms.getOrig().Kind) } // SetKind replaces the kind associated with this Span. func (ms Span) SetKind(v SpanKind) { - (*ms.orig).Kind = otlptrace.Span_SpanKind(v) + ms.getOrig().Kind = otlptrace.Span_SpanKind(v) } // StartTimestamp returns the starttimestamp associated with this Span. -func (ms Span) StartTimestamp() Timestamp { - return Timestamp((*ms.orig).StartTimeUnixNano) +func (ms Span) StartTimestamp() pcommon.Timestamp { + return pcommon.Timestamp(ms.getOrig().StartTimeUnixNano) } // SetStartTimestamp replaces the starttimestamp associated with this Span. -func (ms Span) SetStartTimestamp(v Timestamp) { - (*ms.orig).StartTimeUnixNano = uint64(v) +func (ms Span) SetStartTimestamp(v pcommon.Timestamp) { + ms.getOrig().StartTimeUnixNano = uint64(v) } // EndTimestamp returns the endtimestamp associated with this Span. -func (ms Span) EndTimestamp() Timestamp { - return Timestamp((*ms.orig).EndTimeUnixNano) +func (ms Span) EndTimestamp() pcommon.Timestamp { + return pcommon.Timestamp(ms.getOrig().EndTimeUnixNano) } // SetEndTimestamp replaces the endtimestamp associated with this Span. -func (ms Span) SetEndTimestamp(v Timestamp) { - (*ms.orig).EndTimeUnixNano = uint64(v) +func (ms Span) SetEndTimestamp(v pcommon.Timestamp) { + ms.getOrig().EndTimeUnixNano = uint64(v) } // Attributes returns the Attributes associated with this Span. -func (ms Span) Attributes() Map { - return newMap(&(*ms.orig).Attributes) +func (ms Span) Attributes() pcommon.Map { + return pcommon.Map(internal.NewMap(&ms.getOrig().Attributes)) } // DroppedAttributesCount returns the droppedattributescount associated with this Span. func (ms Span) DroppedAttributesCount() uint32 { - return (*ms.orig).DroppedAttributesCount + return ms.getOrig().DroppedAttributesCount } // SetDroppedAttributesCount replaces the droppedattributescount associated with this Span. func (ms Span) SetDroppedAttributesCount(v uint32) { - (*ms.orig).DroppedAttributesCount = v + ms.getOrig().DroppedAttributesCount = v } // Events returns the Events associated with this Span. func (ms Span) Events() SpanEventSlice { - return newSpanEventSlice(&(*ms.orig).Events) + return SpanEventSlice(internal.NewSpanEventSlice(&ms.getOrig().Events)) } // DroppedEventsCount returns the droppedeventscount associated with this Span. func (ms Span) DroppedEventsCount() uint32 { - return (*ms.orig).DroppedEventsCount + return ms.getOrig().DroppedEventsCount } // SetDroppedEventsCount replaces the droppedeventscount associated with this Span. func (ms Span) SetDroppedEventsCount(v uint32) { - (*ms.orig).DroppedEventsCount = v + ms.getOrig().DroppedEventsCount = v } // Links returns the Links associated with this Span. func (ms Span) Links() SpanLinkSlice { - return newSpanLinkSlice(&(*ms.orig).Links) + return SpanLinkSlice(internal.NewSpanLinkSlice(&ms.getOrig().Links)) } // DroppedLinksCount returns the droppedlinkscount associated with this Span. func (ms Span) DroppedLinksCount() uint32 { - return (*ms.orig).DroppedLinksCount + return ms.getOrig().DroppedLinksCount } // SetDroppedLinksCount replaces the droppedlinkscount associated with this Span. func (ms Span) SetDroppedLinksCount(v uint32) { - (*ms.orig).DroppedLinksCount = v + ms.getOrig().DroppedLinksCount = v } // Status returns the status associated with this Span. -func (ms Span) Status() SpanStatus { - return newSpanStatus(&(*ms.orig).Status) +func (ms Span) Status() Status { + return Status(internal.NewStatus(&ms.getOrig().Status)) } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms Span) CopyTo(dest Span) { dest.SetTraceID(ms.TraceID()) dest.SetSpanID(ms.SpanID()) - dest.SetTraceState(ms.TraceState()) + ms.TraceState().CopyTo(dest.TraceState()) dest.SetParentSpanID(ms.ParentSpanID()) dest.SetName(ms.Name()) dest.SetKind(ms.Kind()) @@ -735,59 +727,60 @@ func (ms Span) CopyTo(dest Span) { // // Must use NewSpanEventSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type SpanEventSlice struct { - // orig points to the slice otlptrace.Span_Event field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]*otlptrace.Span_Event -} +type SpanEventSlice internal.SpanEventSlice func newSpanEventSlice(orig *[]*otlptrace.Span_Event) SpanEventSlice { - return SpanEventSlice{orig} + return SpanEventSlice(internal.NewSpanEventSlice(orig)) +} + +func (ms SpanEventSlice) getOrig() *[]*otlptrace.Span_Event { + return internal.GetOrigSpanEventSlice(internal.SpanEventSlice(ms)) } // NewSpanEventSlice creates a SpanEventSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewSpanEventSlice() SpanEventSlice { orig := []*otlptrace.Span_Event(nil) - return SpanEventSlice{&orig} + return newSpanEventSlice(&orig) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewSpanEventSlice()". func (es SpanEventSlice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es SpanEventSlice) At(ix int) SpanEvent { - return newSpanEvent((*es.orig)[ix]) + return newSpanEvent((*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es SpanEventSlice) CopyTo(dest SpanEventSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newSpanEvent((*es.orig)[i]).CopyTo(newSpanEvent((*dest.orig)[i])) + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] + for i := range *es.getOrig() { + newSpanEvent((*es.getOrig())[i]).CopyTo(newSpanEvent((*dest.getOrig())[i])) } return } origs := make([]otlptrace.Span_Event, srcLen) wrappers := make([]*otlptrace.Span_Event, srcLen) - for i := range *es.orig { + for i := range *es.getOrig() { wrappers[i] = &origs[i] - newSpanEvent((*es.orig)[i]).CopyTo(newSpanEvent(wrappers[i])) + newSpanEvent((*es.getOrig())[i]).CopyTo(newSpanEvent(wrappers[i])) } - *dest.orig = wrappers + *dest.getOrig() = wrappers } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. @@ -795,61 +788,55 @@ func (es SpanEventSlice) CopyTo(dest SpanEventSlice) { // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new SpanEventSlice can be initialized: -// es := NewSpanEventSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewSpanEventSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es SpanEventSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]*otlptrace.Span_Event, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]*otlptrace.Span_Event, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty SpanEvent. // It returns the newly added SpanEvent. func (es SpanEventSlice) AppendEmpty() SpanEvent { - *es.orig = append(*es.orig, &otlptrace.Span_Event{}) + *es.getOrig() = append(*es.getOrig(), &otlptrace.Span_Event{}) return es.At(es.Len() - 1) } // Sort sorts the SpanEvent elements within SpanEventSlice given the // provided less function so that two instances of SpanEventSlice // can be compared. -// -// Returns the same instance to allow nicer code like: -// lessFunc := func(a, b SpanEvent) bool { -// return a.Name() < b.Name() // choose any comparison here -// } -// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) -func (es SpanEventSlice) Sort(less func(a, b SpanEvent) bool) SpanEventSlice { - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) - return es +func (es SpanEventSlice) Sort(less func(a, b SpanEvent) bool) { + sort.SliceStable(*es.getOrig(), func(i, j int) bool { return less(es.At(i), es.At(j)) }) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es SpanEventSlice) MoveAndAppendTo(dest SpanEventSlice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es SpanEventSlice) RemoveIf(f func(SpanEvent) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -858,11 +845,11 @@ func (es SpanEventSlice) RemoveIf(f func(SpanEvent) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } // SpanEvent is a time-stamped annotation of the span, consisting of user-supplied @@ -873,12 +860,15 @@ func (es SpanEventSlice) RemoveIf(f func(SpanEvent) bool) { // // Must use NewSpanEvent function to create new instances. // Important: zero-initialized instance is not valid for use. -type SpanEvent struct { - orig *otlptrace.Span_Event -} + +type SpanEvent internal.SpanEvent func newSpanEvent(orig *otlptrace.Span_Event) SpanEvent { - return SpanEvent{orig: orig} + return SpanEvent(internal.NewSpanEvent(orig)) +} + +func (ms SpanEvent) getOrig() *otlptrace.Span_Event { + return internal.GetOrigSpanEvent(internal.SpanEvent(ms)) } // NewSpanEvent creates a new empty SpanEvent. @@ -889,49 +879,49 @@ func NewSpanEvent() SpanEvent { return newSpanEvent(&otlptrace.Span_Event{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms SpanEvent) MoveTo(dest SpanEvent) { - *dest.orig = *ms.orig - *ms.orig = otlptrace.Span_Event{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlptrace.Span_Event{} } // Timestamp returns the timestamp associated with this SpanEvent. -func (ms SpanEvent) Timestamp() Timestamp { - return Timestamp((*ms.orig).TimeUnixNano) +func (ms SpanEvent) Timestamp() pcommon.Timestamp { + return pcommon.Timestamp(ms.getOrig().TimeUnixNano) } // SetTimestamp replaces the timestamp associated with this SpanEvent. -func (ms SpanEvent) SetTimestamp(v Timestamp) { - (*ms.orig).TimeUnixNano = uint64(v) +func (ms SpanEvent) SetTimestamp(v pcommon.Timestamp) { + ms.getOrig().TimeUnixNano = uint64(v) } // Name returns the name associated with this SpanEvent. func (ms SpanEvent) Name() string { - return (*ms.orig).Name + return ms.getOrig().Name } // SetName replaces the name associated with this SpanEvent. func (ms SpanEvent) SetName(v string) { - (*ms.orig).Name = v + ms.getOrig().Name = v } // Attributes returns the Attributes associated with this SpanEvent. -func (ms SpanEvent) Attributes() Map { - return newMap(&(*ms.orig).Attributes) +func (ms SpanEvent) Attributes() pcommon.Map { + return pcommon.Map(internal.NewMap(&ms.getOrig().Attributes)) } // DroppedAttributesCount returns the droppedattributescount associated with this SpanEvent. func (ms SpanEvent) DroppedAttributesCount() uint32 { - return (*ms.orig).DroppedAttributesCount + return ms.getOrig().DroppedAttributesCount } // SetDroppedAttributesCount replaces the droppedattributescount associated with this SpanEvent. func (ms SpanEvent) SetDroppedAttributesCount(v uint32) { - (*ms.orig).DroppedAttributesCount = v + ms.getOrig().DroppedAttributesCount = v } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms SpanEvent) CopyTo(dest SpanEvent) { dest.SetTimestamp(ms.Timestamp()) dest.SetName(ms.Name()) @@ -946,59 +936,60 @@ func (ms SpanEvent) CopyTo(dest SpanEvent) { // // Must use NewSpanLinkSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type SpanLinkSlice struct { - // orig points to the slice otlptrace.Span_Link field contained somewhere else. - // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. - orig *[]*otlptrace.Span_Link -} +type SpanLinkSlice internal.SpanLinkSlice func newSpanLinkSlice(orig *[]*otlptrace.Span_Link) SpanLinkSlice { - return SpanLinkSlice{orig} + return SpanLinkSlice(internal.NewSpanLinkSlice(orig)) +} + +func (ms SpanLinkSlice) getOrig() *[]*otlptrace.Span_Link { + return internal.GetOrigSpanLinkSlice(internal.SpanLinkSlice(ms)) } // NewSpanLinkSlice creates a SpanLinkSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. func NewSpanLinkSlice() SpanLinkSlice { orig := []*otlptrace.Span_Link(nil) - return SpanLinkSlice{&orig} + return newSpanLinkSlice(&orig) } // Len returns the number of elements in the slice. // // Returns "0" for a newly instance created with "NewSpanLinkSlice()". func (es SpanLinkSlice) Len() int { - return len(*es.orig) + return len(*es.getOrig()) } // At returns the element at the given index. // // This function is used mostly for iterating over all the values in the slice: -// for i := 0; i < es.Len(); i++ { -// e := es.At(i) -// ... // Do something with the element -// } +// +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } func (es SpanLinkSlice) At(ix int) SpanLink { - return newSpanLink((*es.orig)[ix]) + return newSpanLink((*es.getOrig())[ix]) } -// CopyTo copies all elements from the current slice to the dest. +// CopyTo copies all elements from the current slice overriding the destination. func (es SpanLinkSlice) CopyTo(dest SpanLinkSlice) { srcLen := es.Len() - destCap := cap(*dest.orig) + destCap := cap(*dest.getOrig()) if srcLen <= destCap { - (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newSpanLink((*es.orig)[i]).CopyTo(newSpanLink((*dest.orig)[i])) + (*dest.getOrig()) = (*dest.getOrig())[:srcLen:destCap] + for i := range *es.getOrig() { + newSpanLink((*es.getOrig())[i]).CopyTo(newSpanLink((*dest.getOrig())[i])) } return } origs := make([]otlptrace.Span_Link, srcLen) wrappers := make([]*otlptrace.Span_Link, srcLen) - for i := range *es.orig { + for i := range *es.getOrig() { wrappers[i] = &origs[i] - newSpanLink((*es.orig)[i]).CopyTo(newSpanLink(wrappers[i])) + newSpanLink((*es.getOrig())[i]).CopyTo(newSpanLink(wrappers[i])) } - *dest.orig = wrappers + *dest.getOrig() = wrappers } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. @@ -1006,61 +997,55 @@ func (es SpanLinkSlice) CopyTo(dest SpanLinkSlice) { // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // // Here is how a new SpanLinkSlice can be initialized: -// es := NewSpanLinkSlice() -// es.EnsureCapacity(4) -// for i := 0; i < 4; i++ { -// e := es.AppendEmpty() -// // Here should set all the values for e. -// } +// +// es := NewSpanLinkSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } func (es SpanLinkSlice) EnsureCapacity(newCap int) { - oldCap := cap(*es.orig) + oldCap := cap(*es.getOrig()) if newCap <= oldCap { return } - newOrig := make([]*otlptrace.Span_Link, len(*es.orig), newCap) - copy(newOrig, *es.orig) - *es.orig = newOrig + newOrig := make([]*otlptrace.Span_Link, len(*es.getOrig()), newCap) + copy(newOrig, *es.getOrig()) + *es.getOrig() = newOrig } // AppendEmpty will append to the end of the slice an empty SpanLink. // It returns the newly added SpanLink. func (es SpanLinkSlice) AppendEmpty() SpanLink { - *es.orig = append(*es.orig, &otlptrace.Span_Link{}) + *es.getOrig() = append(*es.getOrig(), &otlptrace.Span_Link{}) return es.At(es.Len() - 1) } // Sort sorts the SpanLink elements within SpanLinkSlice given the // provided less function so that two instances of SpanLinkSlice // can be compared. -// -// Returns the same instance to allow nicer code like: -// lessFunc := func(a, b SpanLink) bool { -// return a.Name() < b.Name() // choose any comparison here -// } -// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) -func (es SpanLinkSlice) Sort(less func(a, b SpanLink) bool) SpanLinkSlice { - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) - return es +func (es SpanLinkSlice) Sort(less func(a, b SpanLink) bool) { + sort.SliceStable(*es.getOrig(), func(i, j int) bool { return less(es.At(i), es.At(j)) }) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. func (es SpanLinkSlice) MoveAndAppendTo(dest SpanLinkSlice) { - if *dest.orig == nil { + if *dest.getOrig() == nil { // We can simply move the entire vector and avoid any allocations. - *dest.orig = *es.orig + *dest.getOrig() = *es.getOrig() } else { - *dest.orig = append(*dest.orig, *es.orig...) + *dest.getOrig() = append(*dest.getOrig(), *es.getOrig()...) } - *es.orig = nil + *es.getOrig() = nil } // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. func (es SpanLinkSlice) RemoveIf(f func(SpanLink) bool) { newLen := 0 - for i := 0; i < len(*es.orig); i++ { + for i := 0; i < len(*es.getOrig()); i++ { if f(es.At(i)) { continue } @@ -1069,11 +1054,11 @@ func (es SpanLinkSlice) RemoveIf(f func(SpanLink) bool) { newLen++ continue } - (*es.orig)[newLen] = (*es.orig)[i] + (*es.getOrig())[newLen] = (*es.getOrig())[i] newLen++ } // TODO: Prevent memory leak by erasing truncated values. - *es.orig = (*es.orig)[:newLen] + *es.getOrig() = (*es.getOrig())[:newLen] } // SpanLink is a pointer from the current span to another span in the same trace or in a @@ -1085,12 +1070,15 @@ func (es SpanLinkSlice) RemoveIf(f func(SpanLink) bool) { // // Must use NewSpanLink function to create new instances. // Important: zero-initialized instance is not valid for use. -type SpanLink struct { - orig *otlptrace.Span_Link -} + +type SpanLink internal.SpanLink func newSpanLink(orig *otlptrace.Span_Link) SpanLink { - return SpanLink{orig: orig} + return SpanLink(internal.NewSpanLink(orig)) +} + +func (ms SpanLink) getOrig() *otlptrace.Span_Link { + return internal.GetOrigSpanLink(internal.SpanLink(ms)) } // NewSpanLink creates a new empty SpanLink. @@ -1101,120 +1089,118 @@ func NewSpanLink() SpanLink { return newSpanLink(&otlptrace.Span_Link{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value func (ms SpanLink) MoveTo(dest SpanLink) { - *dest.orig = *ms.orig - *ms.orig = otlptrace.Span_Link{} + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlptrace.Span_Link{} } // TraceID returns the traceid associated with this SpanLink. -func (ms SpanLink) TraceID() TraceID { - return TraceID{orig: ((*ms.orig).TraceId)} +func (ms SpanLink) TraceID() pcommon.TraceID { + return pcommon.TraceID(ms.getOrig().TraceId) } // SetTraceID replaces the traceid associated with this SpanLink. -func (ms SpanLink) SetTraceID(v TraceID) { - (*ms.orig).TraceId = v.orig +func (ms SpanLink) SetTraceID(v pcommon.TraceID) { + ms.getOrig().TraceId = data.TraceID(v) } // SpanID returns the spanid associated with this SpanLink. -func (ms SpanLink) SpanID() SpanID { - return SpanID{orig: ((*ms.orig).SpanId)} +func (ms SpanLink) SpanID() pcommon.SpanID { + return pcommon.SpanID(ms.getOrig().SpanId) } // SetSpanID replaces the spanid associated with this SpanLink. -func (ms SpanLink) SetSpanID(v SpanID) { - (*ms.orig).SpanId = v.orig +func (ms SpanLink) SetSpanID(v pcommon.SpanID) { + ms.getOrig().SpanId = data.SpanID(v) } // TraceState returns the tracestate associated with this SpanLink. -func (ms SpanLink) TraceState() TraceState { - return TraceState((*ms.orig).TraceState) -} - -// SetTraceState replaces the tracestate associated with this SpanLink. -func (ms SpanLink) SetTraceState(v TraceState) { - (*ms.orig).TraceState = string(v) +func (ms SpanLink) TraceState() pcommon.TraceState { + return pcommon.TraceState(internal.NewTraceState(&ms.getOrig().TraceState)) } // Attributes returns the Attributes associated with this SpanLink. -func (ms SpanLink) Attributes() Map { - return newMap(&(*ms.orig).Attributes) +func (ms SpanLink) Attributes() pcommon.Map { + return pcommon.Map(internal.NewMap(&ms.getOrig().Attributes)) } // DroppedAttributesCount returns the droppedattributescount associated with this SpanLink. func (ms SpanLink) DroppedAttributesCount() uint32 { - return (*ms.orig).DroppedAttributesCount + return ms.getOrig().DroppedAttributesCount } // SetDroppedAttributesCount replaces the droppedattributescount associated with this SpanLink. func (ms SpanLink) SetDroppedAttributesCount(v uint32) { - (*ms.orig).DroppedAttributesCount = v + ms.getOrig().DroppedAttributesCount = v } -// CopyTo copies all properties from the current struct to the dest. +// CopyTo copies all properties from the current struct overriding the destination. func (ms SpanLink) CopyTo(dest SpanLink) { dest.SetTraceID(ms.TraceID()) dest.SetSpanID(ms.SpanID()) - dest.SetTraceState(ms.TraceState()) + ms.TraceState().CopyTo(dest.TraceState()) ms.Attributes().CopyTo(dest.Attributes()) dest.SetDroppedAttributesCount(ms.DroppedAttributesCount()) } -// SpanStatus is an optional final status for this span. Semantically, when Status was not +// Status is an optional final status for this span. Semantically, when Status was not // set, that means the span ended without errors and to assume Status.Ok (code = 0). // // This is a reference type, if passed by value and callee modifies it the // caller will see the modification. // -// Must use NewSpanStatus function to create new instances. +// Must use NewStatus function to create new instances. // Important: zero-initialized instance is not valid for use. -type SpanStatus struct { - orig *otlptrace.Status + +type Status internal.Status + +func newStatus(orig *otlptrace.Status) Status { + return Status(internal.NewStatus(orig)) } -func newSpanStatus(orig *otlptrace.Status) SpanStatus { - return SpanStatus{orig: orig} +func (ms Status) getOrig() *otlptrace.Status { + return internal.GetOrigStatus(internal.Status(ms)) } -// NewSpanStatus creates a new empty SpanStatus. +// NewStatus creates a new empty Status. // // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. -func NewSpanStatus() SpanStatus { - return newSpanStatus(&otlptrace.Status{}) +func NewStatus() Status { + return newStatus(&otlptrace.Status{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves all properties from the current struct overriding the destination and // resetting the current instance to its zero value -func (ms SpanStatus) MoveTo(dest SpanStatus) { - *dest.orig = *ms.orig - *ms.orig = otlptrace.Status{} +func (ms Status) MoveTo(dest Status) { + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlptrace.Status{} } -// Code returns the code associated with this SpanStatus. -func (ms SpanStatus) Code() StatusCode { - return StatusCode((*ms.orig).Code) +// Code returns the code associated with this Status. +func (ms Status) Code() StatusCode { + return StatusCode(ms.getOrig().Code) } -// SetCode replaces the code associated with this SpanStatus. -func (ms SpanStatus) SetCode(v StatusCode) { - (*ms.orig).Code = otlptrace.Status_StatusCode(v) +// SetCode replaces the code associated with this Status. +func (ms Status) SetCode(v StatusCode) { + ms.getOrig().Code = otlptrace.Status_StatusCode(v) } -// Message returns the message associated with this SpanStatus. -func (ms SpanStatus) Message() string { - return (*ms.orig).Message +// Message returns the message associated with this Status. +func (ms Status) Message() string { + return ms.getOrig().Message } -// SetMessage replaces the message associated with this SpanStatus. -func (ms SpanStatus) SetMessage(v string) { - (*ms.orig).Message = v +// SetMessage replaces the message associated with this Status. +func (ms Status) SetMessage(v string) { + ms.getOrig().Message = v } -// CopyTo copies all properties from the current struct to the dest. -func (ms SpanStatus) CopyTo(dest SpanStatus) { +// CopyTo copies all properties from the current struct overriding the destination. +func (ms Status) CopyTo(dest Status) { dest.SetCode(ms.Code()) dest.SetMessage(ms.Message()) } diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/internal/ptracejson/json.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/internal/ptracejson/json.go new file mode 100644 index 00000000000..58aa2678793 --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/internal/ptracejson/json.go @@ -0,0 +1,268 @@ +// Copyright The OpenTelemetry Authors +// +// 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. + +package ptracejson // import "go.opentelemetry.io/collector/pdata/ptrace/internal/ptracejson" + +import ( + "fmt" + + "github.com/gogo/protobuf/jsonpb" + jsoniter "github.com/json-iterator/go" + + otlpcollectortrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1" + otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" + "go.opentelemetry.io/collector/pdata/internal/json" + "go.opentelemetry.io/collector/pdata/internal/otlp" +) + +var JSONMarshaler = &jsonpb.Marshaler{ + // https://github.com/open-telemetry/opentelemetry-specification/pull/2758 + EnumsAsInts: true, + // https://github.com/open-telemetry/opentelemetry-specification/pull/2829 + OrigName: false, +} + +func UnmarshalTraceData(buf []byte, dest *otlptrace.TracesData) error { + iter := jsoniter.ConfigFastest.BorrowIterator(buf) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "resourceSpans", "resource_spans": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + dest.ResourceSpans = append(dest.ResourceSpans, readResourceSpans(iter)) + return true + }) + default: + iter.Skip() + } + return true + }) + otlp.MigrateTraces(dest.ResourceSpans) + return iter.Error +} + +func UnmarshalExportTraceServiceRequest(buf []byte, dest *otlpcollectortrace.ExportTraceServiceRequest) error { + iter := jsoniter.ConfigFastest.BorrowIterator(buf) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "resourceSpans", "resource_spans": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + dest.ResourceSpans = append(dest.ResourceSpans, readResourceSpans(iter)) + return true + }) + default: + iter.Skip() + } + return true + }) + otlp.MigrateTraces(dest.ResourceSpans) + return iter.Error +} + +func UnmarshalExportTraceServiceResponse(buf []byte, dest *otlpcollectortrace.ExportTraceServiceResponse) error { + iter := jsoniter.ConfigFastest.BorrowIterator(buf) + defer jsoniter.ConfigFastest.ReturnIterator(iter) + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "partial_success", "partialSuccess": + dest.PartialSuccess = readExportTracePartialSuccess(iter) + default: + iter.Skip() + } + return true + }) + return iter.Error +} + +func readResourceSpans(iter *jsoniter.Iterator) *otlptrace.ResourceSpans { + rs := &otlptrace.ResourceSpans{} + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "resource": + json.ReadResource(iter, &rs.Resource) + case "scopeSpans", "scope_spans": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + rs.ScopeSpans = append(rs.ScopeSpans, readScopeSpans(iter)) + return true + }) + case "schemaUrl", "schema_url": + rs.SchemaUrl = iter.ReadString() + default: + iter.Skip() + } + return true + }) + return rs +} + +func readScopeSpans(iter *jsoniter.Iterator) *otlptrace.ScopeSpans { + ils := &otlptrace.ScopeSpans{} + + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "scope": + json.ReadScope(iter, &ils.Scope) + case "spans": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + ils.Spans = append(ils.Spans, readSpan(iter)) + return true + }) + case "schemaUrl", "schema_url": + ils.SchemaUrl = iter.ReadString() + default: + iter.Skip() + } + return true + }) + return ils +} + +func readSpan(iter *jsoniter.Iterator) *otlptrace.Span { + sp := &otlptrace.Span{} + + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "traceId", "trace_id": + if err := sp.TraceId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { + iter.ReportError("readSpan.traceId", fmt.Sprintf("parse trace_id:%v", err)) + } + case "spanId", "span_id": + if err := sp.SpanId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { + iter.ReportError("readSpan.spanId", fmt.Sprintf("parse span_id:%v", err)) + } + case "traceState", "trace_state": + sp.TraceState = iter.ReadString() + case "parentSpanId", "parent_span_id": + if err := sp.ParentSpanId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { + iter.ReportError("readSpan.parentSpanId", fmt.Sprintf("parse parent_span_id:%v", err)) + } + case "name": + sp.Name = iter.ReadString() + case "kind": + sp.Kind = otlptrace.Span_SpanKind(json.ReadEnumValue(iter, otlptrace.Span_SpanKind_value)) + case "startTimeUnixNano", "start_time_unix_nano": + sp.StartTimeUnixNano = json.ReadUint64(iter) + case "endTimeUnixNano", "end_time_unix_nano": + sp.EndTimeUnixNano = json.ReadUint64(iter) + case "attributes": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + sp.Attributes = append(sp.Attributes, json.ReadAttribute(iter)) + return true + }) + case "droppedAttributesCount", "dropped_attributes_count": + sp.DroppedAttributesCount = json.ReadUint32(iter) + case "events": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + sp.Events = append(sp.Events, readSpanEvent(iter)) + return true + }) + case "droppedEventsCount", "dropped_events_count": + sp.DroppedEventsCount = json.ReadUint32(iter) + case "links": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + sp.Links = append(sp.Links, readSpanLink(iter)) + return true + }) + case "droppedLinksCount", "dropped_links_count": + sp.DroppedLinksCount = json.ReadUint32(iter) + case "status": + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "message": + sp.Status.Message = iter.ReadString() + case "code": + sp.Status.Code = otlptrace.Status_StatusCode(json.ReadEnumValue(iter, otlptrace.Status_StatusCode_value)) + default: + iter.Skip() + } + return true + }) + default: + iter.Skip() + } + return true + }) + return sp +} + +func readSpanLink(iter *jsoniter.Iterator) *otlptrace.Span_Link { + link := &otlptrace.Span_Link{} + + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "traceId", "trace_id": + if err := link.TraceId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { + iter.ReportError("readSpanLink", fmt.Sprintf("parse trace_id:%v", err)) + } + case "spanId", "span_id": + if err := link.SpanId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { + iter.ReportError("readSpanLink", fmt.Sprintf("parse span_id:%v", err)) + } + case "traceState", "trace_state": + link.TraceState = iter.ReadString() + case "attributes": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + link.Attributes = append(link.Attributes, json.ReadAttribute(iter)) + return true + }) + case "droppedAttributesCount", "dropped_attributes_count": + link.DroppedAttributesCount = json.ReadUint32(iter) + default: + iter.Skip() + } + return true + }) + return link +} + +func readSpanEvent(iter *jsoniter.Iterator) *otlptrace.Span_Event { + event := &otlptrace.Span_Event{} + + iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { + switch f { + case "timeUnixNano", "time_unix_nano": + event.TimeUnixNano = json.ReadUint64(iter) + case "name": + event.Name = iter.ReadString() + case "attributes": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + event.Attributes = append(event.Attributes, json.ReadAttribute(iter)) + return true + }) + case "droppedAttributesCount", "dropped_attributes_count": + event.DroppedAttributesCount = json.ReadUint32(iter) + default: + iter.Skip() + } + return true + }) + return event +} + +func readExportTracePartialSuccess(iter *jsoniter.Iterator) otlpcollectortrace.ExportTracePartialSuccess { + lpr := otlpcollectortrace.ExportTracePartialSuccess{} + iter.ReadObjectCB(func(iterator *jsoniter.Iterator, f string) bool { + switch f { + case "rejected_spans", "rejectedSpans": + lpr.RejectedSpans = json.ReadInt64(iter) + case "error_message", "errorMessage": + lpr.ErrorMessage = iter.ReadString() + default: + iter.Skip() + } + return true + }) + return lpr +} diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/json.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/json.go index bddee762cf3..6ac389c297d 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/json.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/json.go @@ -16,389 +16,31 @@ package ptrace // import "go.opentelemetry.io/collector/pdata/ptrace" import ( "bytes" - "encoding/base64" - "fmt" - - "github.com/gogo/protobuf/jsonpb" - jsoniter "github.com/json-iterator/go" "go.opentelemetry.io/collector/pdata/internal" - otlpcommon "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" + "go.opentelemetry.io/collector/pdata/ptrace/internal/ptracejson" ) -// NewJSONMarshaler returns a model.Marshaler. Marshals to OTLP json bytes. -func NewJSONMarshaler() Marshaler { - return newJSONMarshaler() -} +var delegate = ptracejson.JSONMarshaler -type jsonMarshaler struct { - delegate jsonpb.Marshaler -} +var _ Marshaler = (*JSONMarshaler)(nil) -func newJSONMarshaler() *jsonMarshaler { - return &jsonMarshaler{delegate: jsonpb.Marshaler{}} -} +type JSONMarshaler struct{} -func (e *jsonMarshaler) MarshalTraces(td Traces) ([]byte, error) { +func (*JSONMarshaler) MarshalTraces(td Traces) ([]byte, error) { buf := bytes.Buffer{} - pb := internal.TracesToProto(td) - err := e.delegate.Marshal(&buf, &pb) + pb := internal.TracesToProto(internal.Traces(td)) + err := delegate.Marshal(&buf, &pb) return buf.Bytes(), err } -// NewJSONUnmarshaler returns a model.Unmarshaler. Unmarshalls from OTLP json bytes. -func NewJSONUnmarshaler() Unmarshaler { - return &jsonUnmarshaler{} -} - -type jsonUnmarshaler struct { -} - -func (d *jsonUnmarshaler) UnmarshalTraces(buf []byte) (Traces, error) { - iter := jsoniter.ConfigFastest.BorrowIterator(buf) - defer jsoniter.ConfigFastest.ReturnIterator(iter) - td := readTraceData(iter) - err := iter.Error - return internal.TracesFromProto(td), err -} - -func readTraceData(iter *jsoniter.Iterator) otlptrace.TracesData { - td := otlptrace.TracesData{} - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "resourceSpans", "resource_spans": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - td.ResourceSpans = append(td.ResourceSpans, readResourceSpans(iter)) - return true - }) - default: - iter.ReportError("root", fmt.Sprintf("unknown field:%v", f)) - } - return true - }) - return td -} - -func readResourceSpans(iter *jsoniter.Iterator) *otlptrace.ResourceSpans { - rs := &otlptrace.ResourceSpans{} - - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "resource": - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "attributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - rs.Resource.Attributes = append(rs.Resource.Attributes, readAttribute(iter)) - return true - }) - case "droppedAttributesCount", "dropped_attributes_count": - rs.Resource.DroppedAttributesCount = iter.ReadUint32() - default: - iter.ReportError("readResourceSpans.resource", fmt.Sprintf("unknown field:%v", f)) - } - return true - }) - case "instrumentationLibrarySpans", "instrumentation_library_spans", "scopeSpans", "scope_spans": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - rs.ScopeSpans = append(rs.ScopeSpans, - readInstrumentationLibrarySpans(iter)) - return true - }) - case "schemaUrl", "schema_url": - rs.SchemaUrl = iter.ReadString() - default: - iter.ReportError("readResourceSpans", fmt.Sprintf("unknown field:%v", f)) - } - return true - }) - return rs -} - -func readInstrumentationLibrarySpans(iter *jsoniter.Iterator) *otlptrace.ScopeSpans { - ils := &otlptrace.ScopeSpans{} - - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "instrumentationLibrary", "instrumentation_library", "scope": - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "name": - ils.Scope.Name = iter.ReadString() - case "version": - ils.Scope.Version = iter.ReadString() - default: - iter.ReportError("readInstrumentationLibrarySpans.instrumentationLibrary", fmt.Sprintf("unknown field:%v", f)) - } - return true - }) - case "spans": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - ils.Spans = append(ils.Spans, readSpan(iter)) - return true - }) - case "schemaUrl", "schema_url": - ils.SchemaUrl = iter.ReadString() - default: - iter.ReportError("readInstrumentationLibrarySpans", fmt.Sprintf("unknown field:%v", f)) - } - return true - }) - return ils -} - -func readSpan(iter *jsoniter.Iterator) *otlptrace.Span { - sp := &otlptrace.Span{} - - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "traceId", "trace_id": - if err := sp.TraceId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { - iter.ReportError("readSpan.traceId", fmt.Sprintf("parse trace_id:%v", err)) - } - case "spanId", "span_id": - if err := sp.SpanId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { - iter.ReportError("readSpan.spanId", fmt.Sprintf("parse span_id:%v", err)) - } - case "traceState", "trace_state": - sp.TraceState = iter.ReadString() - case "parentSpanId", "parent_span_id": - if err := sp.ParentSpanId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { - iter.ReportError("readSpan.parentSpanId", fmt.Sprintf("parse parent_span_id:%v", err)) - } - case "name": - sp.Name = iter.ReadString() - case "kind": - sp.Kind = readSpanKind(iter) - case "startTimeUnixNano", "start_time_unix_nano": - sp.StartTimeUnixNano = uint64(readInt64(iter)) - case "endTimeUnixNano", "end_time_unix_nano": - sp.EndTimeUnixNano = uint64(readInt64(iter)) - case "attributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - sp.Attributes = append(sp.Attributes, readAttribute(iter)) - return true - }) - case "droppedAttributesCount", "dropped_attributes_count": - sp.DroppedAttributesCount = iter.ReadUint32() - case "events": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - sp.Events = append(sp.Events, readSpanEvent(iter)) - return true - }) - case "droppedEventsCount", "dropped_events_count": - sp.DroppedEventsCount = iter.ReadUint32() - case "links": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - sp.Links = append(sp.Links, readSpanLink(iter)) - return true - }) - case "droppedLinksCount", "dropped_links_count": - sp.DroppedLinksCount = iter.ReadUint32() - case "status": - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "message": - sp.Status.Message = iter.ReadString() - case "code": - sp.Status.Code = readStatusCode(iter) - default: - iter.ReportError("readSpan.status", fmt.Sprintf("unknown field:%v", f)) - } - return true - }) - default: - iter.ReportError("readSpan", fmt.Sprintf("unknown field:%v", f)) - } - return true - }) - return sp -} - -func readSpanLink(iter *jsoniter.Iterator) *otlptrace.Span_Link { - link := &otlptrace.Span_Link{} - - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "traceId", "trace_id": - if err := link.TraceId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { - iter.ReportError("readSpanLink", fmt.Sprintf("parse trace_id:%v", err)) - } - case "spanId", "span_id": - if err := link.SpanId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { - iter.ReportError("readSpanLink", fmt.Sprintf("parse span_id:%v", err)) - } - case "traceState", "trace_state": - link.TraceState = iter.ReadString() - case "attributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - link.Attributes = append(link.Attributes, readAttribute(iter)) - return true - }) - case "droppedAttributesCount", "dropped_attributes_count": - link.DroppedAttributesCount = iter.ReadUint32() - default: - iter.ReportError("readSpanLink", fmt.Sprintf("unknown field:%v", f)) - } - return true - }) - return link -} - -func readSpanEvent(iter *jsoniter.Iterator) *otlptrace.Span_Event { - event := &otlptrace.Span_Event{} - - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "timeUnixNano", "time_unix_nano": - event.TimeUnixNano = uint64(readInt64(iter)) - case "name": - event.Name = iter.ReadString() - case "attributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - event.Attributes = append(event.Attributes, readAttribute(iter)) - return true - }) - case "droppedAttributesCount", "dropped_attributes_count": - event.DroppedAttributesCount = iter.ReadUint32() - default: - iter.ReportError("readSpanEvent", fmt.Sprintf("unknown field:%v", f)) - } - return true - }) - return event -} - -func readAttribute(iter *jsoniter.Iterator) otlpcommon.KeyValue { - kv := otlpcommon.KeyValue{} - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "key": - kv.Key = iter.ReadString() - case "value": - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - kv.Value = readAnyValue(iter, f) - return true - }) - default: - iter.ReportError("readAttribute", fmt.Sprintf("unknown field:%v", f)) - } - return true - }) - return kv -} - -func readAnyValue(iter *jsoniter.Iterator, f string) otlpcommon.AnyValue { - switch f { - case "stringValue", "string_value": - return otlpcommon.AnyValue{ - Value: &otlpcommon.AnyValue_StringValue{ - StringValue: iter.ReadString(), - }, - } - case "boolValue", "bool_value": - return otlpcommon.AnyValue{ - Value: &otlpcommon.AnyValue_BoolValue{ - BoolValue: iter.ReadBool(), - }, - } - case "intValue", "int_value": - return otlpcommon.AnyValue{ - Value: &otlpcommon.AnyValue_IntValue{ - IntValue: readInt64(iter), - }, - } - case "doubleValue", "double_value": - return otlpcommon.AnyValue{ - Value: &otlpcommon.AnyValue_DoubleValue{ - DoubleValue: iter.ReadFloat64(), - }, - } - case "bytesValue", "bytes_value": - v, err := base64.StdEncoding.DecodeString(iter.ReadString()) - if err != nil { - iter.ReportError("bytesValue", fmt.Sprintf("base64 decode:%v", err)) - return otlpcommon.AnyValue{} - } - return otlpcommon.AnyValue{ - Value: &otlpcommon.AnyValue_BytesValue{ - BytesValue: v, - }, - } - case "arrayValue", "array_value": - return otlpcommon.AnyValue{ - Value: &otlpcommon.AnyValue_ArrayValue{ - ArrayValue: readArray(iter), - }, - } - case "kvlistValue", "kvlist_value": - return otlpcommon.AnyValue{ - Value: &otlpcommon.AnyValue_KvlistValue{ - KvlistValue: readKvlistValue(iter), - }, - } - default: - iter.ReportError("readAnyValue", fmt.Sprintf("unknown field:%v", f)) - return otlpcommon.AnyValue{} - } -} - -func readArray(iter *jsoniter.Iterator) *otlpcommon.ArrayValue { - v := &otlpcommon.ArrayValue{} - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "values": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - v.Values = append(v.Values, readAnyValue(iter, f)) - return true - }) - return true - }) - default: - iter.ReportError("readArray", fmt.Sprintf("unknown field:%s", f)) - } - return true - }) - return v -} - -func readKvlistValue(iter *jsoniter.Iterator) *otlpcommon.KeyValueList { - v := &otlpcommon.KeyValueList{} - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "values": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - v.Values = append(v.Values, readAttribute(iter)) - return true - }) - default: - iter.ReportError("readKvlistValue", fmt.Sprintf("unknown field:%s", f)) - } - return true - }) - return v -} - -func readInt64(iter *jsoniter.Iterator) int64 { - return iter.ReadAny().ToInt64() -} - -func readSpanKind(iter *jsoniter.Iterator) otlptrace.Span_SpanKind { - any := iter.ReadAny() - if v := any.ToInt(); v > 0 { - return otlptrace.Span_SpanKind(v) - } - v := any.ToString() - return otlptrace.Span_SpanKind(otlptrace.Span_SpanKind_value[v]) -} +type JSONUnmarshaler struct{} -func readStatusCode(iter *jsoniter.Iterator) otlptrace.Status_StatusCode { - any := iter.ReadAny() - if v := any.ToInt(); v > 0 { - return otlptrace.Status_StatusCode(v) +func (*JSONUnmarshaler) UnmarshalTraces(buf []byte) (Traces, error) { + var td otlptrace.TracesData + if err := ptracejson.UnmarshalTraceData(buf, &td); err != nil { + return Traces{}, err } - v := any.ToString() - return otlptrace.Status_StatusCode(otlptrace.Status_StatusCode_value[v]) + return Traces(internal.TracesFromProto(td)), nil } diff --git a/vendor/go.opentelemetry.io/collector/pdata/ptrace/pb.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/pb.go index acc4440d7ce..9e4c4171d92 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/ptrace/pb.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/pb.go @@ -19,43 +19,24 @@ import ( otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" ) -// NewProtoMarshaler returns a Marshaler. Marshals to OTLP binary protobuf bytes. -func NewProtoMarshaler() Marshaler { - return newPbMarshaler() -} - -// TODO(#3842): Figure out how we want to represent/return *Sizers. -type pbMarshaler struct{} - -func newPbMarshaler() *pbMarshaler { - return &pbMarshaler{} -} +var _ MarshalSizer = (*ProtoMarshaler)(nil) -var _ Sizer = (*pbMarshaler)(nil) +type ProtoMarshaler struct{} -func (e *pbMarshaler) MarshalTraces(td Traces) ([]byte, error) { - pb := internal.TracesToProto(td) +func (e *ProtoMarshaler) MarshalTraces(td Traces) ([]byte, error) { + pb := internal.TracesToProto(internal.Traces(td)) return pb.Marshal() } -func (e *pbMarshaler) TracesSize(td Traces) int { - pb := internal.TracesToProto(td) +func (e *ProtoMarshaler) TracesSize(td Traces) int { + pb := internal.TracesToProto(internal.Traces(td)) return pb.Size() } -type pbUnmarshaler struct{} - -// NewProtoUnmarshaler returns a model.Unmarshaler. Unmarshals from OTLP binary protobuf bytes. -func NewProtoUnmarshaler() Unmarshaler { - return newPbUnmarshaler() -} - -func newPbUnmarshaler() *pbUnmarshaler { - return &pbUnmarshaler{} -} +type ProtoUnmarshaler struct{} -func (d *pbUnmarshaler) UnmarshalTraces(buf []byte) (Traces, error) { +func (d *ProtoUnmarshaler) UnmarshalTraces(buf []byte) (Traces, error) { pb := otlptrace.TracesData{} err := pb.Unmarshal(buf) - return internal.TracesFromProto(pb), err + return Traces(internal.TracesFromProto(pb)), err } diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/traces.go b/vendor/go.opentelemetry.io/collector/pdata/ptrace/traces.go similarity index 63% rename from vendor/go.opentelemetry.io/collector/pdata/internal/traces.go rename to vendor/go.opentelemetry.io/collector/pdata/ptrace/traces.go index e9477fb6a17..0af4b9e478c 100644 --- a/vendor/go.opentelemetry.io/collector/pdata/internal/traces.go +++ b/vendor/go.opentelemetry.io/collector/pdata/ptrace/traces.go @@ -12,67 +12,47 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal // import "go.opentelemetry.io/collector/pdata/internal" +package ptrace // import "go.opentelemetry.io/collector/pdata/ptrace" import ( + "go.opentelemetry.io/collector/pdata/internal" otlpcollectortrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1" otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1" ) -// TracesToOtlp internal helper to convert Traces to otlp request representation. -func TracesToOtlp(mw Traces) *otlpcollectortrace.ExportTraceServiceRequest { - return mw.orig -} - -// TracesFromOtlp internal helper to convert otlp request representation to Traces. -func TracesFromOtlp(orig *otlpcollectortrace.ExportTraceServiceRequest) Traces { - return Traces{orig: orig} -} - -// TracesToProto internal helper to convert Traces to protobuf representation. -func TracesToProto(mw Traces) otlptrace.TracesData { - return otlptrace.TracesData{ - ResourceSpans: mw.orig.ResourceSpans, - } -} +// Traces is the top-level struct that is propagated through the traces pipeline. +// Use NewTraces to create new instance, zero-initialized instance is not valid for use. +type Traces internal.Traces -// TracesFromProto internal helper to convert protobuf representation to Traces. -func TracesFromProto(orig otlptrace.TracesData) Traces { - return Traces{orig: &otlpcollectortrace.ExportTraceServiceRequest{ - ResourceSpans: orig.ResourceSpans, - }} +func newTraces(orig *otlpcollectortrace.ExportTraceServiceRequest) Traces { + return Traces(internal.NewTraces(orig)) } -// Traces is the top-level struct that is propagated through the traces pipeline. -// Use NewTraces to create new instance, zero-initialized instance is not valid for use. -type Traces struct { - // When marhsal/unmarshal unless it is in the request for otlp protocol, convert to otlptrace.TracesData. - orig *otlpcollectortrace.ExportTraceServiceRequest +func (ms Traces) getOrig() *otlpcollectortrace.ExportTraceServiceRequest { + return internal.GetOrigTraces(internal.Traces(ms)) } // NewTraces creates a new Traces struct. func NewTraces() Traces { - return Traces{orig: &otlpcollectortrace.ExportTraceServiceRequest{}} + return newTraces(&otlpcollectortrace.ExportTraceServiceRequest{}) } -// MoveTo moves all properties from the current struct to dest +// MoveTo moves the Traces instance overriding the destination and // resetting the current instance to its zero value. -func (td Traces) MoveTo(dest Traces) { - *dest.orig = *td.orig - *td.orig = otlpcollectortrace.ExportTraceServiceRequest{} +func (ms Traces) MoveTo(dest Traces) { + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = otlpcollectortrace.ExportTraceServiceRequest{} } -// Clone returns a copy of Traces. -func (td Traces) Clone() Traces { - cloneTd := NewTraces() - td.ResourceSpans().CopyTo(cloneTd.ResourceSpans()) - return cloneTd +// CopyTo copies the Traces instance overriding the destination. +func (ms Traces) CopyTo(dest Traces) { + ms.ResourceSpans().CopyTo(dest.ResourceSpans()) } // SpanCount calculates the total number of spans. -func (td Traces) SpanCount() int { +func (ms Traces) SpanCount() int { spanCount := 0 - rss := td.ResourceSpans() + rss := ms.ResourceSpans() for i := 0; i < rss.Len(); i++ { rs := rss.At(i) ilss := rs.ScopeSpans() @@ -84,25 +64,14 @@ func (td Traces) SpanCount() int { } // ResourceSpans returns the ResourceSpansSlice associated with this Metrics. -func (td Traces) ResourceSpans() ResourceSpansSlice { - return newResourceSpansSlice(&td.orig.ResourceSpans) +func (ms Traces) ResourceSpans() ResourceSpansSlice { + return newResourceSpansSlice(&ms.getOrig().ResourceSpans) } -// TraceState is a string representing the tracestate in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header -type TraceState string - -const ( - // TraceStateEmpty represents the empty TraceState. - TraceStateEmpty TraceState = "" -) - // SpanKind is the type of span. Can be used to specify additional relationships between spans // in addition to a parent/child relationship. type SpanKind int32 -// String returns the string representation of the SpanKind. -func (sk SpanKind) String() string { return otlptrace.Span_SpanKind(sk).String() } - const ( // SpanKindUnspecified represents that the SpanKind is unspecified, it MUST NOT be used. SpanKindUnspecified = SpanKind(otlptrace.Span_SPAN_KIND_UNSPECIFIED) @@ -126,6 +95,25 @@ const ( SpanKindConsumer = SpanKind(otlptrace.Span_SPAN_KIND_CONSUMER) ) +// String returns the string representation of the SpanKind. +func (sk SpanKind) String() string { + switch sk { + case SpanKindUnspecified: + return "Unspecified" + case SpanKindInternal: + return "Internal" + case SpanKindServer: + return "Server" + case SpanKindClient: + return "Client" + case SpanKindProducer: + return "Producer" + case SpanKindConsumer: + return "Consumer" + } + return "" +} + // StatusCode mirrors the codes defined at // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status type StatusCode int32 @@ -137,4 +125,14 @@ const ( ) // String returns the string representation of the StatusCode. -func (sc StatusCode) String() string { return otlptrace.Status_StatusCode(sc).String() } +func (sc StatusCode) String() string { + switch sc { + case StatusCodeUnset: + return "Unset" + case StatusCodeOk: + return "Ok" + case StatusCodeError: + return "Error" + } + return "" +} diff --git a/vendor/go.opentelemetry.io/collector/service/featuregate/gates.go b/vendor/go.opentelemetry.io/collector/service/featuregate/gates.go deleted file mode 100644 index 751c45b4e04..00000000000 --- a/vendor/go.opentelemetry.io/collector/service/featuregate/gates.go +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// 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. - -package featuregate // import "go.opentelemetry.io/collector/service/featuregate" - -import ( - "fmt" - "sync" -) - -// Gate represents an individual feature that may be enabled or disabled based -// on the lifecycle state of the feature and CLI flags specified by the user. -type Gate struct { - ID string - Description string - Enabled bool -} - -var reg = NewRegistry() - -// GetRegistry returns the global Registry. -func GetRegistry() *Registry { - return reg -} - -// NewRegistry returns a new empty Registry. -func NewRegistry() *Registry { - return &Registry{gates: make(map[string]Gate)} -} - -type Registry struct { - mu sync.RWMutex - gates map[string]Gate -} - -// Apply a configuration in the form of a map of Gate identifiers to boolean values. -// Sets only those values provided in the map, other gate values are not changed. -// Deprecated: [v0.56.0] Use MustApply instead. -func (r *Registry) Apply(cfg map[string]bool) { - r.mu.Lock() - defer r.mu.Unlock() - for id, val := range cfg { - if g, ok := r.gates[id]; ok { - g.Enabled = val - r.gates[g.ID] = g - } - } -} - -// MustApply a configuration in the form of a map of Gate identifiers to boolean values. -// Sets only those values provided in the map, other gate values are not changed. -func (r *Registry) MustApply(cfg map[string]bool) { - r.mu.Lock() - defer r.mu.Unlock() - for id, val := range cfg { - if g, ok := r.gates[id]; ok { - g.Enabled = val - r.gates[g.ID] = g - } else { - panic(fmt.Sprintf("feature gate %s is unregistered", id)) - } - } -} - -// IsEnabled returns true if a registered feature gate is enabled and false otherwise. -func (r *Registry) IsEnabled(id string) bool { - r.mu.RLock() - defer r.mu.RUnlock() - g, ok := r.gates[id] - return ok && g.Enabled -} - -// MustRegister like Register but panics if a Gate with the same ID is already registered. -func (r *Registry) MustRegister(g Gate) { - if err := r.Register(g); err != nil { - panic(err) - } -} - -// Register registers a Gate. May only be called in an init() function. -func (r *Registry) Register(g Gate) error { - r.mu.Lock() - defer r.mu.Unlock() - if _, ok := r.gates[g.ID]; ok { - return fmt.Errorf("attempted to add pre-existing gate %q", g.ID) - } - r.gates[g.ID] = g - return nil -} - -// List returns a slice of copies of all registered Gates. -func (r *Registry) List() []Gate { - r.mu.RLock() - defer r.mu.RUnlock() - ret := make([]Gate, len(r.gates)) - i := 0 - for _, gate := range r.gates { - ret[i] = gate - i++ - } - - return ret -} diff --git a/vendor/go.uber.org/multierr/CHANGELOG.md b/vendor/go.uber.org/multierr/CHANGELOG.md index 3ba05276f1a..d2c8aadaf0e 100644 --- a/vendor/go.uber.org/multierr/CHANGELOG.md +++ b/vendor/go.uber.org/multierr/CHANGELOG.md @@ -1,6 +1,14 @@ Releases ======== +v1.9.0 (2022-12-12) +=================== + +- Add `AppendFunc` that allow passsing functions to similar to + `AppendInvoke`. + +- Bump up yaml.v3 dependency to 3.0.1. + v1.8.0 (2022-02-28) =================== diff --git a/vendor/go.uber.org/multierr/error.go b/vendor/go.uber.org/multierr/error.go index f45af149c10..cdd91ae56d9 100644 --- a/vendor/go.uber.org/multierr/error.go +++ b/vendor/go.uber.org/multierr/error.go @@ -20,106 +20,109 @@ // Package multierr allows combining one or more errors together. // -// Overview +// # Overview // // Errors can be combined with the use of the Combine function. // -// multierr.Combine( -// reader.Close(), -// writer.Close(), -// conn.Close(), -// ) +// multierr.Combine( +// reader.Close(), +// writer.Close(), +// conn.Close(), +// ) // // If only two errors are being combined, the Append function may be used // instead. // -// err = multierr.Append(reader.Close(), writer.Close()) +// err = multierr.Append(reader.Close(), writer.Close()) // // The underlying list of errors for a returned error object may be retrieved // with the Errors function. // -// errors := multierr.Errors(err) -// if len(errors) > 0 { -// fmt.Println("The following errors occurred:", errors) -// } +// errors := multierr.Errors(err) +// if len(errors) > 0 { +// fmt.Println("The following errors occurred:", errors) +// } // -// Appending from a loop +// # Appending from a loop // // You sometimes need to append into an error from a loop. // -// var err error -// for _, item := range items { -// err = multierr.Append(err, process(item)) -// } +// var err error +// for _, item := range items { +// err = multierr.Append(err, process(item)) +// } // // Cases like this may require knowledge of whether an individual instance // failed. This usually requires introduction of a new variable. // -// var err error -// for _, item := range items { -// if perr := process(item); perr != nil { -// log.Warn("skipping item", item) -// err = multierr.Append(err, perr) -// } -// } +// var err error +// for _, item := range items { +// if perr := process(item); perr != nil { +// log.Warn("skipping item", item) +// err = multierr.Append(err, perr) +// } +// } // // multierr includes AppendInto to simplify cases like this. // -// var err error -// for _, item := range items { -// if multierr.AppendInto(&err, process(item)) { -// log.Warn("skipping item", item) -// } -// } +// var err error +// for _, item := range items { +// if multierr.AppendInto(&err, process(item)) { +// log.Warn("skipping item", item) +// } +// } // // This will append the error into the err variable, and return true if that // individual error was non-nil. // -// See AppendInto for more information. +// See [AppendInto] for more information. // -// Deferred Functions +// # Deferred Functions // // Go makes it possible to modify the return value of a function in a defer // block if the function was using named returns. This makes it possible to // record resource cleanup failures from deferred blocks. // -// func sendRequest(req Request) (err error) { -// conn, err := openConnection() -// if err != nil { -// return err -// } -// defer func() { -// err = multierr.Append(err, conn.Close()) -// }() -// // ... -// } +// func sendRequest(req Request) (err error) { +// conn, err := openConnection() +// if err != nil { +// return err +// } +// defer func() { +// err = multierr.Append(err, conn.Close()) +// }() +// // ... +// } // // multierr provides the Invoker type and AppendInvoke function to make cases // like the above simpler and obviate the need for a closure. The following is // roughly equivalent to the example above. // -// func sendRequest(req Request) (err error) { -// conn, err := openConnection() -// if err != nil { -// return err -// } -// defer multierr.AppendInvoke(&err, multierr.Close(conn)) -// // ... -// } +// func sendRequest(req Request) (err error) { +// conn, err := openConnection() +// if err != nil { +// return err +// } +// defer multierr.AppendInvoke(&err, multierr.Close(conn)) +// // ... +// } // -// See AppendInvoke and Invoker for more information. +// See [AppendInvoke] and [Invoker] for more information. // -// Advanced Usage +// NOTE: If you're modifying an error from inside a defer, you MUST use a named +// return value for that function. +// +// # Advanced Usage // // Errors returned by Combine and Append MAY implement the following // interface. // -// type errorGroup interface { -// // Returns a slice containing the underlying list of errors. -// // -// // This slice MUST NOT be modified by the caller. -// Errors() []error -// } +// type errorGroup interface { +// // Returns a slice containing the underlying list of errors. +// // +// // This slice MUST NOT be modified by the caller. +// Errors() []error +// } // // Note that if you need access to list of errors behind a multierr error, you // should prefer using the Errors function. That said, if you need cheap @@ -128,13 +131,13 @@ // because errors returned by Combine and Append are not guaranteed to // implement this interface. // -// var errors []error -// group, ok := err.(errorGroup) -// if ok { -// errors = group.Errors() -// } else { -// errors = []error{err} -// } +// var errors []error +// group, ok := err.(errorGroup) +// if ok { +// errors = group.Errors() +// } else { +// errors = []error{err} +// } package multierr // import "go.uber.org/multierr" import ( @@ -185,8 +188,8 @@ type errorGroup interface { // Errors returns a slice containing zero or more errors that the supplied // error is composed of. If the error is nil, a nil slice is returned. // -// err := multierr.Append(r.Close(), w.Close()) -// errors := multierr.Errors(err) +// err := multierr.Append(r.Close(), w.Close()) +// errors := multierr.Errors(err) // // If the error is not composed of other errors, the returned slice contains // just the error that was passed in. @@ -209,10 +212,7 @@ func Errors(err error) []error { return []error{err} } - errors := eg.Errors() - result := make([]error, len(errors)) - copy(result, errors) - return result + return append(([]error)(nil), eg.Errors()...) } // multiError is an error that holds one or more errors. @@ -393,8 +393,7 @@ func fromSlice(errors []error) error { // Otherwise "errors" escapes to the heap // unconditionally for all other cases. // This lets us optimize for the "no errors" case. - out := make([]error, len(errors)) - copy(out, errors) + out := append(([]error)(nil), errors...) return &multiError{errors: out} } } @@ -420,32 +419,32 @@ func fromSlice(errors []error) error { // If zero arguments were passed or if all items are nil, a nil error is // returned. // -// Combine(nil, nil) // == nil +// Combine(nil, nil) // == nil // // If only a single error was passed, it is returned as-is. // -// Combine(err) // == err +// Combine(err) // == err // // Combine skips over nil arguments so this function may be used to combine // together errors from operations that fail independently of each other. // -// multierr.Combine( -// reader.Close(), -// writer.Close(), -// pipe.Close(), -// ) +// multierr.Combine( +// reader.Close(), +// writer.Close(), +// pipe.Close(), +// ) // // If any of the passed errors is a multierr error, it will be flattened along // with the other errors. // -// multierr.Combine(multierr.Combine(err1, err2), err3) -// // is the same as -// multierr.Combine(err1, err2, err3) +// multierr.Combine(multierr.Combine(err1, err2), err3) +// // is the same as +// multierr.Combine(err1, err2, err3) // // The returned error formats into a readable multi-line error message if // formatted with %+v. // -// fmt.Sprintf("%+v", multierr.Combine(err1, err2)) +// fmt.Sprintf("%+v", multierr.Combine(err1, err2)) func Combine(errors ...error) error { return fromSlice(errors) } @@ -455,16 +454,19 @@ func Combine(errors ...error) error { // This function is a specialization of Combine for the common case where // there are only two errors. // -// err = multierr.Append(reader.Close(), writer.Close()) +// err = multierr.Append(reader.Close(), writer.Close()) // // The following pattern may also be used to record failure of deferred // operations without losing information about the original error. // -// func doSomething(..) (err error) { -// f := acquireResource() -// defer func() { -// err = multierr.Append(err, f.Close()) -// }() +// func doSomething(..) (err error) { +// f := acquireResource() +// defer func() { +// err = multierr.Append(err, f.Close()) +// }() +// +// Note that the variable MUST be a named return to append an error to it from +// the defer statement. See also [AppendInvoke]. func Append(left error, right error) error { switch { case left == nil: @@ -494,37 +496,37 @@ func Append(left error, right error) error { // AppendInto appends an error into the destination of an error pointer and // returns whether the error being appended was non-nil. // -// var err error -// multierr.AppendInto(&err, r.Close()) -// multierr.AppendInto(&err, w.Close()) +// var err error +// multierr.AppendInto(&err, r.Close()) +// multierr.AppendInto(&err, w.Close()) // // The above is equivalent to, // -// err := multierr.Append(r.Close(), w.Close()) +// err := multierr.Append(r.Close(), w.Close()) // // As AppendInto reports whether the provided error was non-nil, it may be // used to build a multierr error in a loop more ergonomically. For example: // -// var err error -// for line := range lines { -// var item Item -// if multierr.AppendInto(&err, parse(line, &item)) { -// continue -// } -// items = append(items, item) -// } +// var err error +// for line := range lines { +// var item Item +// if multierr.AppendInto(&err, parse(line, &item)) { +// continue +// } +// items = append(items, item) +// } // // Compare this with a version that relies solely on Append: // -// var err error -// for line := range lines { -// var item Item -// if parseErr := parse(line, &item); parseErr != nil { -// err = multierr.Append(err, parseErr) -// continue -// } -// items = append(items, item) -// } +// var err error +// for line := range lines { +// var item Item +// if parseErr := parse(line, &item); parseErr != nil { +// err = multierr.Append(err, parseErr) +// continue +// } +// items = append(items, item) +// } func AppendInto(into *error, err error) (errored bool) { if into == nil { // We panic if 'into' is nil. This is not documented above @@ -545,7 +547,7 @@ func AppendInto(into *error, err error) (errored bool) { // AppendInvoke to append the result of calling the function into an error. // This allows you to conveniently defer capture of failing operations. // -// See also, Close and Invoke. +// See also, [Close] and [Invoke]. type Invoker interface { Invoke() error } @@ -556,19 +558,22 @@ type Invoker interface { // // For example, // -// func processReader(r io.Reader) (err error) { -// scanner := bufio.NewScanner(r) -// defer multierr.AppendInvoke(&err, multierr.Invoke(scanner.Err)) -// for scanner.Scan() { -// // ... -// } -// // ... -// } +// func processReader(r io.Reader) (err error) { +// scanner := bufio.NewScanner(r) +// defer multierr.AppendInvoke(&err, multierr.Invoke(scanner.Err)) +// for scanner.Scan() { +// // ... +// } +// // ... +// } // // In this example, the following line will construct the Invoker right away, // but defer the invocation of scanner.Err() until the function returns. // -// defer multierr.AppendInvoke(&err, multierr.Invoke(scanner.Err)) +// defer multierr.AppendInvoke(&err, multierr.Invoke(scanner.Err)) +// +// Note that the error you're appending to from the defer statement MUST be a +// named return. type Invoke func() error // Invoke calls the supplied function and returns its result. @@ -579,19 +584,22 @@ func (i Invoke) Invoke() error { return i() } // // For example, // -// func processFile(path string) (err error) { -// f, err := os.Open(path) -// if err != nil { -// return err -// } -// defer multierr.AppendInvoke(&err, multierr.Close(f)) -// return processReader(f) -// } +// func processFile(path string) (err error) { +// f, err := os.Open(path) +// if err != nil { +// return err +// } +// defer multierr.AppendInvoke(&err, multierr.Close(f)) +// return processReader(f) +// } // // In this example, multierr.Close will construct the Invoker right away, but // defer the invocation of f.Close until the function returns. // -// defer multierr.AppendInvoke(&err, multierr.Close(f)) +// defer multierr.AppendInvoke(&err, multierr.Close(f)) +// +// Note that the error you're appending to from the defer statement MUST be a +// named return. func Close(closer io.Closer) Invoker { return Invoke(closer.Close) } @@ -601,52 +609,73 @@ func Close(closer io.Closer) Invoker { // invocation of fallible operations until a function returns, and capture the // resulting errors. // -// func doSomething(...) (err error) { -// // ... -// f, err := openFile(..) -// if err != nil { -// return err -// } +// func doSomething(...) (err error) { +// // ... +// f, err := openFile(..) +// if err != nil { +// return err +// } +// +// // multierr will call f.Close() when this function returns and +// // if the operation fails, its append its error into the +// // returned error. +// defer multierr.AppendInvoke(&err, multierr.Close(f)) // -// // multierr will call f.Close() when this function returns and -// // if the operation fails, its append its error into the -// // returned error. -// defer multierr.AppendInvoke(&err, multierr.Close(f)) +// scanner := bufio.NewScanner(f) +// // Similarly, this scheduled scanner.Err to be called and +// // inspected when the function returns and append its error +// // into the returned error. +// defer multierr.AppendInvoke(&err, multierr.Invoke(scanner.Err)) // -// scanner := bufio.NewScanner(f) -// // Similarly, this scheduled scanner.Err to be called and -// // inspected when the function returns and append its error -// // into the returned error. -// defer multierr.AppendInvoke(&err, multierr.Invoke(scanner.Err)) +// // ... +// } // -// // ... -// } +// NOTE: If used with a defer, the error variable MUST be a named return. // // Without defer, AppendInvoke behaves exactly like AppendInto. // -// err := // ... -// multierr.AppendInvoke(&err, mutltierr.Invoke(foo)) +// err := // ... +// multierr.AppendInvoke(&err, mutltierr.Invoke(foo)) // -// // ...is roughly equivalent to... +// // ...is roughly equivalent to... // -// err := // ... -// multierr.AppendInto(&err, foo()) +// err := // ... +// multierr.AppendInto(&err, foo()) // // The advantage of the indirection introduced by Invoker is to make it easy // to defer the invocation of a function. Without this indirection, the // invoked function will be evaluated at the time of the defer block rather // than when the function returns. // -// // BAD: This is likely not what the caller intended. This will evaluate -// // foo() right away and append its result into the error when the -// // function returns. -// defer multierr.AppendInto(&err, foo()) +// // BAD: This is likely not what the caller intended. This will evaluate +// // foo() right away and append its result into the error when the +// // function returns. +// defer multierr.AppendInto(&err, foo()) // -// // GOOD: This will defer invocation of foo unutil the function returns. -// defer multierr.AppendInvoke(&err, multierr.Invoke(foo)) +// // GOOD: This will defer invocation of foo unutil the function returns. +// defer multierr.AppendInvoke(&err, multierr.Invoke(foo)) // // multierr provides a few Invoker implementations out of the box for -// convenience. See Invoker for more information. +// convenience. See [Invoker] for more information. func AppendInvoke(into *error, invoker Invoker) { AppendInto(into, invoker.Invoke()) } + +// AppendFunc is a shorthand for [AppendInvoke]. +// It allows using function or method value directly +// without having to wrap it into an [Invoker] interface. +// +// func doSomething(...) (err error) { +// w, err := startWorker(...) +// if err != nil { +// return err +// } +// +// // multierr will call w.Stop() when this function returns and +// // if the operation fails, it appends its error into the +// // returned error. +// defer multierr.AppendFunc(&err, w.Stop) +// } +func AppendFunc(into *error, fn func() error) { + AppendInvoke(into, Invoke(fn)) +} diff --git a/vendor/golang.org/x/net/http2/flow.go b/vendor/golang.org/x/net/http2/flow.go index b51f0e0cf1f..750ac52f2a5 100644 --- a/vendor/golang.org/x/net/http2/flow.go +++ b/vendor/golang.org/x/net/http2/flow.go @@ -6,23 +6,91 @@ package http2 -// flow is the flow control window's size. -type flow struct { +// inflowMinRefresh is the minimum number of bytes we'll send for a +// flow control window update. +const inflowMinRefresh = 4 << 10 + +// inflow accounts for an inbound flow control window. +// It tracks both the latest window sent to the peer (used for enforcement) +// and the accumulated unsent window. +type inflow struct { + avail int32 + unsent int32 +} + +// set sets the initial window. +func (f *inflow) init(n int32) { + f.avail = n +} + +// add adds n bytes to the window, with a maximum window size of max, +// indicating that the peer can now send us more data. +// For example, the user read from a {Request,Response} body and consumed +// some of the buffered data, so the peer can now send more. +// It returns the number of bytes to send in a WINDOW_UPDATE frame to the peer. +// Window updates are accumulated and sent when the unsent capacity +// is at least inflowMinRefresh or will at least double the peer's available window. +func (f *inflow) add(n int) (connAdd int32) { + if n < 0 { + panic("negative update") + } + unsent := int64(f.unsent) + int64(n) + // "A sender MUST NOT allow a flow-control window to exceed 2^31-1 octets." + // RFC 7540 Section 6.9.1. + const maxWindow = 1<<31 - 1 + if unsent+int64(f.avail) > maxWindow { + panic("flow control update exceeds maximum window size") + } + f.unsent = int32(unsent) + if f.unsent < inflowMinRefresh && f.unsent < f.avail { + // If there aren't at least inflowMinRefresh bytes of window to send, + // and this update won't at least double the window, buffer the update for later. + return 0 + } + f.avail += f.unsent + f.unsent = 0 + return int32(unsent) +} + +// take attempts to take n bytes from the peer's flow control window. +// It reports whether the window has available capacity. +func (f *inflow) take(n uint32) bool { + if n > uint32(f.avail) { + return false + } + f.avail -= int32(n) + return true +} + +// takeInflows attempts to take n bytes from two inflows, +// typically connection-level and stream-level flows. +// It reports whether both windows have available capacity. +func takeInflows(f1, f2 *inflow, n uint32) bool { + if n > uint32(f1.avail) || n > uint32(f2.avail) { + return false + } + f1.avail -= int32(n) + f2.avail -= int32(n) + return true +} + +// outflow is the outbound flow control window's size. +type outflow struct { _ incomparable // n is the number of DATA bytes we're allowed to send. - // A flow is kept both on a conn and a per-stream. + // An outflow is kept both on a conn and a per-stream. n int32 - // conn points to the shared connection-level flow that is - // shared by all streams on that conn. It is nil for the flow + // conn points to the shared connection-level outflow that is + // shared by all streams on that conn. It is nil for the outflow // that's on the conn directly. - conn *flow + conn *outflow } -func (f *flow) setConnFlow(cf *flow) { f.conn = cf } +func (f *outflow) setConnFlow(cf *outflow) { f.conn = cf } -func (f *flow) available() int32 { +func (f *outflow) available() int32 { n := f.n if f.conn != nil && f.conn.n < n { n = f.conn.n @@ -30,7 +98,7 @@ func (f *flow) available() int32 { return n } -func (f *flow) take(n int32) { +func (f *outflow) take(n int32) { if n > f.available() { panic("internal error: took too much") } @@ -42,7 +110,7 @@ func (f *flow) take(n int32) { // add adds n bytes (positive or negative) to the flow control window. // It returns false if the sum would exceed 2^31-1. -func (f *flow) add(n int32) bool { +func (f *outflow) add(n int32) bool { sum := f.n + n if (sum > n) == (f.n > 0) { f.n = sum diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index 4eb7617fa0d..b624dc0a705 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -448,7 +448,7 @@ func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { // configured value for inflow, that will be updated when we send a // WINDOW_UPDATE shortly after sending SETTINGS. sc.flow.add(initialWindowSize) - sc.inflow.add(initialWindowSize) + sc.inflow.init(initialWindowSize) sc.hpackEncoder = hpack.NewEncoder(&sc.headerWriteBuf) sc.hpackEncoder.SetMaxDynamicTableSizeLimit(s.maxEncoderHeaderTableSize()) @@ -563,8 +563,8 @@ type serverConn struct { wroteFrameCh chan frameWriteResult // from writeFrameAsync -> serve, tickles more frame writes bodyReadCh chan bodyReadMsg // from handlers -> serve serveMsgCh chan interface{} // misc messages & code to send to / run on the serve loop - flow flow // conn-wide (not stream-specific) outbound flow control - inflow flow // conn-wide inbound flow control + flow outflow // conn-wide (not stream-specific) outbound flow control + inflow inflow // conn-wide inbound flow control tlsState *tls.ConnectionState // shared by all handlers, like net/http remoteAddrStr string writeSched WriteScheduler @@ -641,10 +641,10 @@ type stream struct { cancelCtx func() // owned by serverConn's serve loop: - bodyBytes int64 // body bytes seen so far - declBodyBytes int64 // or -1 if undeclared - flow flow // limits writing from Handler to client - inflow flow // what the client is allowed to POST/etc to us + bodyBytes int64 // body bytes seen so far + declBodyBytes int64 // or -1 if undeclared + flow outflow // limits writing from Handler to client + inflow inflow // what the client is allowed to POST/etc to us state streamState resetQueued bool // RST_STREAM queued for write; set by sc.resetStream gotTrailerHeader bool // HEADER frame for trailers was seen @@ -1503,7 +1503,7 @@ func (sc *serverConn) processFrame(f Frame) error { if sc.inGoAway && (sc.goAwayCode != ErrCodeNo || f.Header().StreamID > sc.maxClientStreamID) { if f, ok := f.(*DataFrame); ok { - if sc.inflow.available() < int32(f.Length) { + if !sc.inflow.take(f.Length) { return sc.countError("data_flow", streamError(f.Header().StreamID, ErrCodeFlowControl)) } sc.sendWindowUpdate(nil, int(f.Length)) // conn-level @@ -1775,14 +1775,9 @@ func (sc *serverConn) processData(f *DataFrame) error { // But still enforce their connection-level flow control, // and return any flow control bytes since we're not going // to consume them. - if sc.inflow.available() < int32(f.Length) { + if !sc.inflow.take(f.Length) { return sc.countError("data_flow", streamError(id, ErrCodeFlowControl)) } - // Deduct the flow control from inflow, since we're - // going to immediately add it back in - // sendWindowUpdate, which also schedules sending the - // frames. - sc.inflow.take(int32(f.Length)) sc.sendWindowUpdate(nil, int(f.Length)) // conn-level if st != nil && st.resetQueued { @@ -1797,10 +1792,9 @@ func (sc *serverConn) processData(f *DataFrame) error { // Sender sending more than they'd declared? if st.declBodyBytes != -1 && st.bodyBytes+int64(len(data)) > st.declBodyBytes { - if sc.inflow.available() < int32(f.Length) { + if !sc.inflow.take(f.Length) { return sc.countError("data_flow", streamError(id, ErrCodeFlowControl)) } - sc.inflow.take(int32(f.Length)) sc.sendWindowUpdate(nil, int(f.Length)) // conn-level st.body.CloseWithError(fmt.Errorf("sender tried to send more than declared Content-Length of %d bytes", st.declBodyBytes)) @@ -1811,10 +1805,9 @@ func (sc *serverConn) processData(f *DataFrame) error { } if f.Length > 0 { // Check whether the client has flow control quota. - if st.inflow.available() < int32(f.Length) { + if !takeInflows(&sc.inflow, &st.inflow, f.Length) { return sc.countError("flow_on_data_length", streamError(id, ErrCodeFlowControl)) } - st.inflow.take(int32(f.Length)) if len(data) > 0 { wrote, err := st.body.Write(data) @@ -1830,10 +1823,12 @@ func (sc *serverConn) processData(f *DataFrame) error { // Return any padded flow control now, since we won't // refund it later on body reads. - if pad := int32(f.Length) - int32(len(data)); pad > 0 { - sc.sendWindowUpdate32(nil, pad) - sc.sendWindowUpdate32(st, pad) - } + // Call sendWindowUpdate even if there is no padding, + // to return buffered flow control credit if the sent + // window has shrunk. + pad := int32(f.Length) - int32(len(data)) + sc.sendWindowUpdate32(nil, pad) + sc.sendWindowUpdate32(st, pad) } if f.StreamEnded() { st.endStream() @@ -2105,8 +2100,7 @@ func (sc *serverConn) newStream(id, pusherID uint32, state streamState) *stream st.cw.Init() st.flow.conn = &sc.flow // link to conn-level counter st.flow.add(sc.initialStreamSendWindowSize) - st.inflow.conn = &sc.inflow // link to conn-level counter - st.inflow.add(sc.srv.initialStreamRecvWindowSize()) + st.inflow.init(sc.srv.initialStreamRecvWindowSize()) if sc.hs.WriteTimeout != 0 { st.writeDeadline = time.AfterFunc(sc.hs.WriteTimeout, st.onWriteTimeout) } @@ -2388,47 +2382,28 @@ func (sc *serverConn) noteBodyRead(st *stream, n int) { } // st may be nil for conn-level -func (sc *serverConn) sendWindowUpdate(st *stream, n int) { - sc.serveG.check() - // "The legal range for the increment to the flow control - // window is 1 to 2^31-1 (2,147,483,647) octets." - // A Go Read call on 64-bit machines could in theory read - // a larger Read than this. Very unlikely, but we handle it here - // rather than elsewhere for now. - const maxUint31 = 1<<31 - 1 - for n > maxUint31 { - sc.sendWindowUpdate32(st, maxUint31) - n -= maxUint31 - } - sc.sendWindowUpdate32(st, int32(n)) +func (sc *serverConn) sendWindowUpdate32(st *stream, n int32) { + sc.sendWindowUpdate(st, int(n)) } // st may be nil for conn-level -func (sc *serverConn) sendWindowUpdate32(st *stream, n int32) { +func (sc *serverConn) sendWindowUpdate(st *stream, n int) { sc.serveG.check() - if n == 0 { - return - } - if n < 0 { - panic("negative update") - } var streamID uint32 - if st != nil { + var send int32 + if st == nil { + send = sc.inflow.add(n) + } else { streamID = st.id + send = st.inflow.add(n) + } + if send == 0 { + return } sc.writeFrame(FrameWriteRequest{ - write: writeWindowUpdate{streamID: streamID, n: uint32(n)}, + write: writeWindowUpdate{streamID: streamID, n: uint32(send)}, stream: st, }) - var ok bool - if st == nil { - ok = sc.inflow.add(n) - } else { - ok = st.inflow.add(n) - } - if !ok { - panic("internal error; sent too many window updates without decrements?") - } } // requestBody is the Handler's Request.Body type. diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index 30f706e6cb8..b43ec10cfed 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -47,10 +47,6 @@ const ( // we buffer per stream. transportDefaultStreamFlow = 4 << 20 - // transportDefaultStreamMinRefresh is the minimum number of bytes we'll send - // a stream-level WINDOW_UPDATE for at a time. - transportDefaultStreamMinRefresh = 4 << 10 - defaultUserAgent = "Go-http-client/2.0" // initialMaxConcurrentStreams is a connections maxConcurrentStreams until @@ -310,8 +306,8 @@ type ClientConn struct { mu sync.Mutex // guards following cond *sync.Cond // hold mu; broadcast on flow/closed changes - flow flow // our conn-level flow control quota (cs.flow is per stream) - inflow flow // peer's conn-level flow control + flow outflow // our conn-level flow control quota (cs.outflow is per stream) + inflow inflow // peer's conn-level flow control doNotReuse bool // whether conn is marked to not be reused for any future requests closing bool closed bool @@ -376,10 +372,10 @@ type clientStream struct { respHeaderRecv chan struct{} // closed when headers are received res *http.Response // set if respHeaderRecv is closed - flow flow // guarded by cc.mu - inflow flow // guarded by cc.mu - bytesRemain int64 // -1 means unknown; owned by transportResponseBody.Read - readErr error // sticky read error; owned by transportResponseBody.Read + flow outflow // guarded by cc.mu + inflow inflow // guarded by cc.mu + bytesRemain int64 // -1 means unknown; owned by transportResponseBody.Read + readErr error // sticky read error; owned by transportResponseBody.Read reqBody io.ReadCloser reqBodyContentLength int64 // -1 means unknown @@ -811,7 +807,7 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro cc.bw.Write(clientPreface) cc.fr.WriteSettings(initialSettings...) cc.fr.WriteWindowUpdate(0, transportDefaultConnFlow) - cc.inflow.add(transportDefaultConnFlow + initialWindowSize) + cc.inflow.init(transportDefaultConnFlow + initialWindowSize) cc.bw.Flush() if cc.werr != nil { cc.Close() @@ -2073,8 +2069,7 @@ type resAndError struct { func (cc *ClientConn) addStreamLocked(cs *clientStream) { cs.flow.add(int32(cc.initialWindowSize)) cs.flow.setConnFlow(&cc.flow) - cs.inflow.add(transportDefaultStreamFlow) - cs.inflow.setConnFlow(&cc.inflow) + cs.inflow.init(transportDefaultStreamFlow) cs.ID = cc.nextStreamID cc.nextStreamID += 2 cc.streams[cs.ID] = cs @@ -2533,21 +2528,10 @@ func (b transportResponseBody) Read(p []byte) (n int, err error) { } cc.mu.Lock() - var connAdd, streamAdd int32 - // Check the conn-level first, before the stream-level. - if v := cc.inflow.available(); v < transportDefaultConnFlow/2 { - connAdd = transportDefaultConnFlow - v - cc.inflow.add(connAdd) - } + connAdd := cc.inflow.add(n) + var streamAdd int32 if err == nil { // No need to refresh if the stream is over or failed. - // Consider any buffered body data (read from the conn but not - // consumed by the client) when computing flow control for this - // stream. - v := int(cs.inflow.available()) + cs.bufPipe.Len() - if v < transportDefaultStreamFlow-transportDefaultStreamMinRefresh { - streamAdd = int32(transportDefaultStreamFlow - v) - cs.inflow.add(streamAdd) - } + streamAdd = cs.inflow.add(n) } cc.mu.Unlock() @@ -2575,17 +2559,15 @@ func (b transportResponseBody) Close() error { if unread > 0 { cc.mu.Lock() // Return connection-level flow control. - if unread > 0 { - cc.inflow.add(int32(unread)) - } + connAdd := cc.inflow.add(unread) cc.mu.Unlock() // TODO(dneil): Acquiring this mutex can block indefinitely. // Move flow control return to a goroutine? cc.wmu.Lock() // Return connection-level flow control. - if unread > 0 { - cc.fr.WriteWindowUpdate(0, uint32(unread)) + if connAdd > 0 { + cc.fr.WriteWindowUpdate(0, uint32(connAdd)) } cc.bw.Flush() cc.wmu.Unlock() @@ -2628,13 +2610,18 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error { // But at least return their flow control: if f.Length > 0 { cc.mu.Lock() - cc.inflow.add(int32(f.Length)) + ok := cc.inflow.take(f.Length) + connAdd := cc.inflow.add(int(f.Length)) cc.mu.Unlock() - - cc.wmu.Lock() - cc.fr.WriteWindowUpdate(0, uint32(f.Length)) - cc.bw.Flush() - cc.wmu.Unlock() + if !ok { + return ConnectionError(ErrCodeFlowControl) + } + if connAdd > 0 { + cc.wmu.Lock() + cc.fr.WriteWindowUpdate(0, uint32(connAdd)) + cc.bw.Flush() + cc.wmu.Unlock() + } } return nil } @@ -2665,9 +2652,7 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error { } // Check connection-level flow control. cc.mu.Lock() - if cs.inflow.available() >= int32(f.Length) { - cs.inflow.take(int32(f.Length)) - } else { + if !takeInflows(&cc.inflow, &cs.inflow, f.Length) { cc.mu.Unlock() return ConnectionError(ErrCodeFlowControl) } @@ -2689,19 +2674,20 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error { } } - if refund > 0 { - cc.inflow.add(int32(refund)) - if !didReset { - cs.inflow.add(int32(refund)) - } + sendConn := cc.inflow.add(refund) + var sendStream int32 + if !didReset { + sendStream = cs.inflow.add(refund) } cc.mu.Unlock() - if refund > 0 { + if sendConn > 0 || sendStream > 0 { cc.wmu.Lock() - cc.fr.WriteWindowUpdate(0, uint32(refund)) - if !didReset { - cc.fr.WriteWindowUpdate(cs.ID, uint32(refund)) + if sendConn > 0 { + cc.fr.WriteWindowUpdate(0, uint32(sendConn)) + } + if sendStream > 0 { + cc.fr.WriteWindowUpdate(cs.ID, uint32(sendStream)) } cc.bw.Flush() cc.wmu.Unlock() diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go index 79a38a0b9bc..a968b80fa6a 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go @@ -4,6 +4,11 @@ package cpu +import ( + "strings" + "syscall" +) + // HWCAP/HWCAP2 bits. These are exposed by Linux. const ( hwcap_FP = 1 << 0 @@ -32,10 +37,45 @@ const ( hwcap_ASIMDFHM = 1 << 23 ) +// linuxKernelCanEmulateCPUID reports whether we're running +// on Linux 4.11+. Ideally we'd like to ask the question about +// whether the current kernel contains +// https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=77c97b4ee21290f5f083173d957843b615abbff2 +// but the version number will have to do. +func linuxKernelCanEmulateCPUID() bool { + var un syscall.Utsname + syscall.Uname(&un) + var sb strings.Builder + for _, b := range un.Release[:] { + if b == 0 { + break + } + sb.WriteByte(byte(b)) + } + major, minor, _, ok := parseRelease(sb.String()) + return ok && (major > 4 || major == 4 && minor >= 11) +} + func doinit() { if err := readHWCAP(); err != nil { - // failed to read /proc/self/auxv, try reading registers directly - readARM64Registers() + // We failed to read /proc/self/auxv. This can happen if the binary has + // been given extra capabilities(7) with /bin/setcap. + // + // When this happens, we have two options. If the Linux kernel is new + // enough (4.11+), we can read the arm64 registers directly which'll + // trap into the kernel and then return back to userspace. + // + // But on older kernels, such as Linux 4.4.180 as used on many Synology + // devices, calling readARM64Registers (specifically getisar0) will + // cause a SIGILL and we'll die. So for older kernels, parse /proc/cpuinfo + // instead. + // + // See golang/go#57336. + if linuxKernelCanEmulateCPUID() { + readARM64Registers() + } else { + readLinuxProcCPUInfo() + } return } diff --git a/vendor/golang.org/x/sys/cpu/parse.go b/vendor/golang.org/x/sys/cpu/parse.go new file mode 100644 index 00000000000..762b63d6882 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/parse.go @@ -0,0 +1,43 @@ +// Copyright 2022 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cpu + +import "strconv" + +// parseRelease parses a dot-separated version number. It follows the semver +// syntax, but allows the minor and patch versions to be elided. +// +// This is a copy of the Go runtime's parseRelease from +// https://golang.org/cl/209597. +func parseRelease(rel string) (major, minor, patch int, ok bool) { + // Strip anything after a dash or plus. + for i := 0; i < len(rel); i++ { + if rel[i] == '-' || rel[i] == '+' { + rel = rel[:i] + break + } + } + + next := func() (int, bool) { + for i := 0; i < len(rel); i++ { + if rel[i] == '.' { + ver, err := strconv.Atoi(rel[:i]) + rel = rel[i+1:] + return ver, err == nil + } + } + ver, err := strconv.Atoi(rel) + rel = "" + return ver, err == nil + } + if major, ok = next(); !ok || rel == "" { + return + } + if minor, ok = next(); !ok || rel == "" { + return + } + patch, ok = next() + return +} diff --git a/vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go b/vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go new file mode 100644 index 00000000000..d87bd6b3eb0 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go @@ -0,0 +1,54 @@ +// Copyright 2022 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build linux && arm64 +// +build linux,arm64 + +package cpu + +import ( + "errors" + "io" + "os" + "strings" +) + +func readLinuxProcCPUInfo() error { + f, err := os.Open("/proc/cpuinfo") + if err != nil { + return err + } + defer f.Close() + + var buf [1 << 10]byte // enough for first CPU + n, err := io.ReadFull(f, buf[:]) + if err != nil && err != io.ErrUnexpectedEOF { + return err + } + in := string(buf[:n]) + const features = "\nFeatures : " + i := strings.Index(in, features) + if i == -1 { + return errors.New("no CPU features found") + } + in = in[i+len(features):] + if i := strings.Index(in, "\n"); i != -1 { + in = in[:i] + } + m := map[string]*bool{} + + initOptions() // need it early here; it's harmless to call twice + for _, o := range options { + m[o.Name] = o.Feature + } + // The EVTSTRM field has alias "evstrm" in Go, but Linux calls it "evtstrm". + m["evtstrm"] = &ARM64.HasEVTSTRM + + for _, f := range strings.Fields(in) { + if p, ok := m[f]; ok { + *p = true + } + } + return nil +} diff --git a/vendor/golang.org/x/sys/unix/gccgo.go b/vendor/golang.org/x/sys/unix/gccgo.go index 0dee23222ca..b06f52d748f 100644 --- a/vendor/golang.org/x/sys/unix/gccgo.go +++ b/vendor/golang.org/x/sys/unix/gccgo.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build gccgo && !aix -// +build gccgo,!aix +//go:build gccgo && !aix && !hurd +// +build gccgo,!aix,!hurd package unix diff --git a/vendor/golang.org/x/sys/unix/gccgo_c.c b/vendor/golang.org/x/sys/unix/gccgo_c.c index 2cb1fefac64..c4fce0e7003 100644 --- a/vendor/golang.org/x/sys/unix/gccgo_c.c +++ b/vendor/golang.org/x/sys/unix/gccgo_c.c @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build gccgo -// +build !aix +// +build gccgo,!hurd +// +build !aix,!hurd #include #include diff --git a/vendor/golang.org/x/sys/unix/ioctl.go b/vendor/golang.org/x/sys/unix/ioctl.go index 6c7ad052e6b..1c51b0ec2bc 100644 --- a/vendor/golang.org/x/sys/unix/ioctl.go +++ b/vendor/golang.org/x/sys/unix/ioctl.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +//go:build aix || darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd || solaris +// +build aix darwin dragonfly freebsd hurd linux netbsd openbsd solaris package unix diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh index 727cba21270..8e3947c3686 100644 --- a/vendor/golang.org/x/sys/unix/mkall.sh +++ b/vendor/golang.org/x/sys/unix/mkall.sh @@ -174,10 +174,10 @@ openbsd_arm64) mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; openbsd_mips64) + mkasm="go run mkasm.go" mkerrors="$mkerrors -m64" - mksyscall="go run mksyscall.go -openbsd" + mksyscall="go run mksyscall.go -openbsd -libc" mksysctl="go run mksysctl_openbsd.go" - mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'" # Let the type of C char be signed for making the bare syscall # API consistent across platforms. mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go index 61c0d0de15d..a41111a794e 100644 --- a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go +++ b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go @@ -255,6 +255,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys Chmod(path string, mode uint32) (err error) //sys Chown(path string, uid int, gid int) (err error) //sys Chroot(path string) (err error) +//sys ClockGettime(clockid int32, time *Timespec) (err error) //sys Close(fd int) (err error) //sys Dup(fd int) (nfd int, err error) //sys Dup2(from int, to int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/vendor/golang.org/x/sys/unix/syscall_freebsd.go index de7c23e0648..d50b9dc250b 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd.go @@ -319,6 +319,7 @@ func PtraceSingleStep(pid int) (err error) { //sys Chmod(path string, mode uint32) (err error) //sys Chown(path string, uid int, gid int) (err error) //sys Chroot(path string) (err error) +//sys ClockGettime(clockid int32, time *Timespec) (err error) //sys Close(fd int) (err error) //sys Dup(fd int) (nfd int, err error) //sys Dup2(from int, to int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_hurd.go b/vendor/golang.org/x/sys/unix/syscall_hurd.go new file mode 100644 index 00000000000..4ffb64808d7 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/syscall_hurd.go @@ -0,0 +1,22 @@ +// Copyright 2022 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build hurd +// +build hurd + +package unix + +/* +#include +int ioctl(int, unsigned long int, uintptr_t); +*/ +import "C" + +func ioctl(fd int, req uint, arg uintptr) (err error) { + r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg)) + if r0 == -1 && er != nil { + err = er + } + return +} diff --git a/vendor/golang.org/x/sys/unix/syscall_hurd_386.go b/vendor/golang.org/x/sys/unix/syscall_hurd_386.go new file mode 100644 index 00000000000..7cf54a3e4f1 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/syscall_hurd_386.go @@ -0,0 +1,29 @@ +// Copyright 2022 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build 386 && hurd +// +build 386,hurd + +package unix + +const ( + TIOCGETA = 0x62251713 +) + +type Winsize struct { + Row uint16 + Col uint16 + Xpixel uint16 + Ypixel uint16 +} + +type Termios struct { + Iflag uint32 + Oflag uint32 + Cflag uint32 + Lflag uint32 + Cc [20]uint8 + Ispeed int32 + Ospeed int32 +} diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index c5a98440eca..d839962e663 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -1973,36 +1973,46 @@ func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) { //sys preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PREADV2 //sys pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PWRITEV2 -func bytes2iovec(bs [][]byte) []Iovec { - iovecs := make([]Iovec, len(bs)) - for i, b := range bs { - iovecs[i].SetLen(len(b)) +// minIovec is the size of the small initial allocation used by +// Readv, Writev, etc. +// +// This small allocation gets stack allocated, which lets the +// common use case of len(iovs) <= minIovs avoid more expensive +// heap allocations. +const minIovec = 8 + +// appendBytes converts bs to Iovecs and appends them to vecs. +func appendBytes(vecs []Iovec, bs [][]byte) []Iovec { + for _, b := range bs { + var v Iovec + v.SetLen(len(b)) if len(b) > 0 { - iovecs[i].Base = &b[0] + v.Base = &b[0] } else { - iovecs[i].Base = (*byte)(unsafe.Pointer(&_zero)) + v.Base = (*byte)(unsafe.Pointer(&_zero)) } + vecs = append(vecs, v) } - return iovecs + return vecs } -// offs2lohi splits offs into its lower and upper unsigned long. On 64-bit -// systems, hi will always be 0. On 32-bit systems, offs will be split in half. -// preadv/pwritev chose this calling convention so they don't need to add a -// padding-register for alignment on ARM. +// offs2lohi splits offs into its low and high order bits. func offs2lohi(offs int64) (lo, hi uintptr) { - return uintptr(offs), uintptr(uint64(offs) >> SizeofLong) + const longBits = SizeofLong * 8 + return uintptr(offs), uintptr(uint64(offs) >> longBits) } func Readv(fd int, iovs [][]byte) (n int, err error) { - iovecs := bytes2iovec(iovs) + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) n, err = readv(fd, iovecs) readvRacedetect(iovecs, n, err) return n, err } func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) { - iovecs := bytes2iovec(iovs) + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) lo, hi := offs2lohi(offset) n, err = preadv(fd, iovecs, lo, hi) readvRacedetect(iovecs, n, err) @@ -2010,7 +2020,8 @@ func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) { } func Preadv2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) { - iovecs := bytes2iovec(iovs) + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) lo, hi := offs2lohi(offset) n, err = preadv2(fd, iovecs, lo, hi, flags) readvRacedetect(iovecs, n, err) @@ -2037,7 +2048,8 @@ func readvRacedetect(iovecs []Iovec, n int, err error) { } func Writev(fd int, iovs [][]byte) (n int, err error) { - iovecs := bytes2iovec(iovs) + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } @@ -2047,7 +2059,8 @@ func Writev(fd int, iovs [][]byte) (n int, err error) { } func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { - iovecs := bytes2iovec(iovs) + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } @@ -2058,7 +2071,8 @@ func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { } func Pwritev2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) { - iovecs := bytes2iovec(iovs) + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/vendor/golang.org/x/sys/unix/syscall_netbsd.go index 666f0a1b33d..35a3ad758f5 100644 --- a/vendor/golang.org/x/sys/unix/syscall_netbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_netbsd.go @@ -110,6 +110,20 @@ func direntNamlen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) } +func SysctlUvmexp(name string) (*Uvmexp, error) { + mib, err := sysctlmib(name) + if err != nil { + return nil, err + } + + n := uintptr(SizeofUvmexp) + var u Uvmexp + if err := sysctl(mib, (*byte)(unsafe.Pointer(&u)), &n, nil, 0); err != nil { + return nil, err + } + return &u, nil +} + func Pipe(p []int) (err error) { return Pipe2(p, 0) } @@ -245,6 +259,7 @@ func Statvfs(path string, buf *Statvfs_t) (err error) { //sys Chmod(path string, mode uint32) (err error) //sys Chown(path string, uid int, gid int) (err error) //sys Chroot(path string) (err error) +//sys ClockGettime(clockid int32, time *Timespec) (err error) //sys Close(fd int) (err error) //sys Dup(fd int) (nfd int, err error) //sys Dup2(from int, to int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go index 78daceb338b..9b67b908e5f 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -220,6 +220,7 @@ func Uname(uname *Utsname) error { //sys Chmod(path string, mode uint32) (err error) //sys Chown(path string, uid int, gid int) (err error) //sys Chroot(path string) (err error) +//sys ClockGettime(clockid int32, time *Timespec) (err error) //sys Close(fd int) (err error) //sys Dup(fd int) (nfd int, err error) //sys Dup2(from int, to int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go index e23c5394eff..04aa43f41b2 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build openbsd && !mips64 -// +build openbsd,!mips64 +//go:build openbsd +// +build openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go index 2109e569cce..07ac56109a0 100644 --- a/vendor/golang.org/x/sys/unix/syscall_solaris.go +++ b/vendor/golang.org/x/sys/unix/syscall_solaris.go @@ -590,6 +590,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys Chmod(path string, mode uint32) (err error) //sys Chown(path string, uid int, gid int) (err error) //sys Chroot(path string) (err error) +//sys ClockGettime(clockid int32, time *Timespec) (err error) //sys Close(fd int) (err error) //sys Creat(path string, mode uint32) (fd int, err error) //sys Dup(fd int) (nfd int, err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/vendor/golang.org/x/sys/unix/syscall_unix.go index 00bafda8654..a386f8897df 100644 --- a/vendor/golang.org/x/sys/unix/syscall_unix.go +++ b/vendor/golang.org/x/sys/unix/syscall_unix.go @@ -331,6 +331,19 @@ func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) { return } +// Recvmsg receives a message from a socket using the recvmsg system call. The +// received non-control data will be written to p, and any "out of band" +// control data will be written to oob. The flags are passed to recvmsg. +// +// The results are: +// - n is the number of non-control data bytes read into p +// - oobn is the number of control data bytes read into oob; this may be interpreted using [ParseSocketControlMessage] +// - recvflags is flags returned by recvmsg +// - from is the address of the sender +// +// If the underlying socket type is not SOCK_DGRAM, a received message +// containing oob data and a single '\0' of non-control data is treated as if +// the message contained only control data, i.e. n will be zero on return. func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { var iov [1]Iovec if len(p) > 0 { @@ -346,13 +359,9 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from return } -// RecvmsgBuffers receives a message from a socket using the recvmsg -// system call. The flags are passed to recvmsg. Any non-control data -// read is scattered into the buffers slices. The results are: -// - n is the number of non-control data read into bufs -// - oobn is the number of control data read into oob; this may be interpreted using [ParseSocketControlMessage] -// - recvflags is flags returned by recvmsg -// - from is the address of the sender +// RecvmsgBuffers receives a message from a socket using the recvmsg system +// call. This function is equivalent to Recvmsg, but non-control data read is +// scattered into the buffers slices. func RecvmsgBuffers(fd int, buffers [][]byte, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { iov := make([]Iovec, len(buffers)) for i := range buffers { @@ -371,11 +380,38 @@ func RecvmsgBuffers(fd int, buffers [][]byte, oob []byte, flags int) (n, oobn in return } +// Sendmsg sends a message on a socket to an address using the sendmsg system +// call. This function is equivalent to SendmsgN, but does not return the +// number of bytes actually sent. func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) { _, err = SendmsgN(fd, p, oob, to, flags) return } +// SendmsgN sends a message on a socket to an address using the sendmsg system +// call. p contains the non-control data to send, and oob contains the "out of +// band" control data. The flags are passed to sendmsg. The number of +// non-control bytes actually written to the socket is returned. +// +// Some socket types do not support sending control data without accompanying +// non-control data. If p is empty, and oob contains control data, and the +// underlying socket type is not SOCK_DGRAM, p will be treated as containing a +// single '\0' and the return value will indicate zero bytes sent. +// +// The Go function Recvmsg, if called with an empty p and a non-empty oob, +// will read and ignore this additional '\0'. If the message is received by +// code that does not use Recvmsg, or that does not use Go at all, that code +// will need to be written to expect and ignore the additional '\0'. +// +// If you need to send non-empty oob with p actually empty, and if the +// underlying socket type supports it, you can do so via a raw system call as +// follows: +// +// msg := &unix.Msghdr{ +// Control: &oob[0], +// } +// msg.SetControllen(len(oob)) +// n, _, errno := unix.Syscall(unix.SYS_SENDMSG, uintptr(fd), uintptr(unsafe.Pointer(msg)), flags) func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) { var iov [1]Iovec if len(p) > 0 { @@ -394,9 +430,8 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) } // SendmsgBuffers sends a message on a socket to an address using the sendmsg -// system call. The flags are passed to sendmsg. Any non-control data written -// is gathered from buffers. The function returns the number of bytes written -// to the socket. +// system call. This function is equivalent to SendmsgN, but the non-control +// data is gathered from buffers. func SendmsgBuffers(fd int, buffers [][]byte, oob []byte, to Sockaddr, flags int) (n int, err error) { iov := make([]Iovec, len(buffers)) for i := range buffers { diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go index 6d56edc05ac..af20e474b38 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go @@ -46,6 +46,7 @@ const ( AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 + ALTWERASE = 0x200 ARPHRD_ETHER = 0x1 ARPHRD_FRELAY = 0xf ARPHRD_IEEE1394 = 0x18 @@ -108,6 +109,15 @@ const ( BPF_DIRECTION_IN = 0x1 BPF_DIRECTION_OUT = 0x2 BPF_DIV = 0x30 + BPF_FILDROP_CAPTURE = 0x1 + BPF_FILDROP_DROP = 0x2 + BPF_FILDROP_PASS = 0x0 + BPF_F_DIR_IN = 0x10 + BPF_F_DIR_MASK = 0x30 + BPF_F_DIR_OUT = 0x20 + BPF_F_DIR_SHIFT = 0x4 + BPF_F_FLOWID = 0x8 + BPF_F_PRI_MASK = 0x7 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 @@ -136,6 +146,7 @@ const ( BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 + BPF_RND = 0xc0 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 @@ -147,6 +158,12 @@ const ( BRKINT = 0x2 CFLUSH = 0xf CLOCAL = 0x8000 + CLOCK_BOOTTIME = 0x6 + CLOCK_MONOTONIC = 0x3 + CLOCK_PROCESS_CPUTIME_ID = 0x2 + CLOCK_REALTIME = 0x0 + CLOCK_THREAD_CPUTIME_ID = 0x4 + CLOCK_UPTIME = 0x5 CPUSTATES = 0x6 CP_IDLE = 0x5 CP_INTR = 0x4 @@ -170,7 +187,65 @@ const ( CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 + DIOCADDQUEUE = 0xc100445d + DIOCADDRULE = 0xccc84404 + DIOCADDSTATE = 0xc1084425 + DIOCCHANGERULE = 0xccc8441a + DIOCCLRIFFLAG = 0xc024445a + DIOCCLRSRCNODES = 0x20004455 + DIOCCLRSTATES = 0xc0d04412 + DIOCCLRSTATUS = 0xc0244416 + DIOCGETLIMIT = 0xc0084427 + DIOCGETQSTATS = 0xc1084460 + DIOCGETQUEUE = 0xc100445f + DIOCGETQUEUES = 0xc100445e + DIOCGETRULE = 0xccc84407 + DIOCGETRULES = 0xccc84406 + DIOCGETRULESET = 0xc444443b + DIOCGETRULESETS = 0xc444443a + DIOCGETSRCNODES = 0xc0084454 + DIOCGETSTATE = 0xc1084413 + DIOCGETSTATES = 0xc0084419 + DIOCGETSTATUS = 0xc1e84415 + DIOCGETSYNFLWATS = 0xc0084463 + DIOCGETTIMEOUT = 0xc008441e + DIOCIGETIFACES = 0xc0244457 + DIOCKILLSRCNODES = 0xc068445b + DIOCKILLSTATES = 0xc0d04429 + DIOCNATLOOK = 0xc0504417 + DIOCOSFPADD = 0xc084444f DIOCOSFPFLUSH = 0x2000444e + DIOCOSFPGET = 0xc0844450 + DIOCRADDADDRS = 0xc44c4443 + DIOCRADDTABLES = 0xc44c443d + DIOCRCLRADDRS = 0xc44c4442 + DIOCRCLRASTATS = 0xc44c4448 + DIOCRCLRTABLES = 0xc44c443c + DIOCRCLRTSTATS = 0xc44c4441 + DIOCRDELADDRS = 0xc44c4444 + DIOCRDELTABLES = 0xc44c443e + DIOCRGETADDRS = 0xc44c4446 + DIOCRGETASTATS = 0xc44c4447 + DIOCRGETTABLES = 0xc44c443f + DIOCRGETTSTATS = 0xc44c4440 + DIOCRINADEFINE = 0xc44c444d + DIOCRSETADDRS = 0xc44c4445 + DIOCRSETTFLAGS = 0xc44c444a + DIOCRTSTADDRS = 0xc44c4449 + DIOCSETDEBUG = 0xc0044418 + DIOCSETHOSTID = 0xc0044456 + DIOCSETIFFLAG = 0xc0244459 + DIOCSETLIMIT = 0xc0084428 + DIOCSETREASS = 0xc004445c + DIOCSETSTATUSIF = 0xc0244414 + DIOCSETSYNCOOKIES = 0xc0014462 + DIOCSETSYNFLWATS = 0xc0084461 + DIOCSETTIMEOUT = 0xc008441d + DIOCSTART = 0x20004401 + DIOCSTOP = 0x20004402 + DIOCXBEGIN = 0xc00c4451 + DIOCXCOMMIT = 0xc00c4452 + DIOCXROLLBACK = 0xc00c4453 DLT_ARCNET = 0x7 DLT_ATM_RFC1483 = 0xb DLT_AX25 = 0x3 @@ -186,6 +261,7 @@ const ( DLT_LOOP = 0xc DLT_MPLS = 0xdb DLT_NULL = 0x0 + DLT_OPENFLOW = 0x10b DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPP = 0x9 @@ -196,6 +272,23 @@ const ( DLT_RAW = 0xe DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xf + DLT_USBPCAP = 0xf9 + DLT_USER0 = 0x93 + DLT_USER1 = 0x94 + DLT_USER10 = 0x9d + DLT_USER11 = 0x9e + DLT_USER12 = 0x9f + DLT_USER13 = 0xa0 + DLT_USER14 = 0xa1 + DLT_USER15 = 0xa2 + DLT_USER2 = 0x95 + DLT_USER3 = 0x96 + DLT_USER4 = 0x97 + DLT_USER5 = 0x98 + DLT_USER6 = 0x99 + DLT_USER7 = 0x9a + DLT_USER8 = 0x9b + DLT_USER9 = 0x9c DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 @@ -215,6 +308,8 @@ const ( EMUL_ENABLED = 0x1 EMUL_NATIVE = 0x2 ENDRUNDISC = 0x9 + ETH64_8021_RSVD_MASK = 0xfffffffffff0 + ETH64_8021_RSVD_PREFIX = 0x180c2000000 ETHERMIN = 0x2e ETHERMTU = 0x5dc ETHERTYPE_8023 = 0x4 @@ -267,6 +362,7 @@ const ( ETHERTYPE_DN = 0x6003 ETHERTYPE_DOGFIGHT = 0x1989 ETHERTYPE_DSMD = 0x8039 + ETHERTYPE_EAPOL = 0x888e ETHERTYPE_ECMA = 0x803 ETHERTYPE_ENCRYPT = 0x803d ETHERTYPE_ES = 0x805d @@ -298,6 +394,7 @@ const ( ETHERTYPE_LLDP = 0x88cc ETHERTYPE_LOGICRAFT = 0x8148 ETHERTYPE_LOOPBACK = 0x9000 + ETHERTYPE_MACSEC = 0x88e5 ETHERTYPE_MATRA = 0x807a ETHERTYPE_MAX = 0xffff ETHERTYPE_MERIT = 0x807c @@ -326,15 +423,17 @@ const ( ETHERTYPE_NCD = 0x8149 ETHERTYPE_NESTAR = 0x8006 ETHERTYPE_NETBEUI = 0x8191 + ETHERTYPE_NHRP = 0x2001 ETHERTYPE_NOVELL = 0x8138 ETHERTYPE_NS = 0x600 ETHERTYPE_NSAT = 0x601 ETHERTYPE_NSCOMPAT = 0x807 + ETHERTYPE_NSH = 0x984f ETHERTYPE_NTRAILER = 0x10 ETHERTYPE_OS9 = 0x7007 ETHERTYPE_OS9NET = 0x7009 ETHERTYPE_PACER = 0x80c6 - ETHERTYPE_PAE = 0x888e + ETHERTYPE_PBB = 0x88e7 ETHERTYPE_PCS = 0x4242 ETHERTYPE_PLANNING = 0x8044 ETHERTYPE_PPP = 0x880b @@ -409,28 +508,40 @@ const ( ETHER_CRC_POLY_LE = 0xedb88320 ETHER_HDR_LEN = 0xe ETHER_MAX_DIX_LEN = 0x600 + ETHER_MAX_HARDMTU_LEN = 0xff9b ETHER_MAX_LEN = 0x5ee ETHER_MIN_LEN = 0x40 ETHER_TYPE_LEN = 0x2 ETHER_VLAN_ENCAP_LEN = 0x4 EVFILT_AIO = -0x3 + EVFILT_DEVICE = -0x8 + EVFILT_EXCEPT = -0x9 EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 - EVFILT_SYSCOUNT = 0x7 + EVFILT_SYSCOUNT = 0x9 EVFILT_TIMER = -0x7 EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 + EVL_ENCAPLEN = 0x4 + EVL_PRIO_BITS = 0xd + EVL_PRIO_MAX = 0x7 + EVL_VLID_MASK = 0xfff + EVL_VLID_MAX = 0xffe + EVL_VLID_MIN = 0x1 + EVL_VLID_NULL = 0x0 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 + EV_DISPATCH = 0x80 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 - EV_SYSFLAGS = 0xf000 + EV_RECEIPT = 0x40 + EV_SYSFLAGS = 0xf800 EXTA = 0x4b00 EXTB = 0x9600 EXTPROC = 0x800 @@ -443,6 +554,7 @@ const ( F_GETFL = 0x3 F_GETLK = 0x7 F_GETOWN = 0x5 + F_ISATTY = 0xb F_OK = 0x0 F_RDLCK = 0x1 F_SETFD = 0x2 @@ -460,7 +572,6 @@ const ( IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 - IFA_ROUTE = 0x1 IFF_ALLMULTI = 0x200 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x8e52 @@ -471,12 +582,12 @@ const ( IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 - IFF_NOTRAILERS = 0x20 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 + IFF_STATICARP = 0x20 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 @@ -605,6 +716,7 @@ const ( IFT_LINEGROUP = 0xd2 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 + IFT_MBIM = 0xfa IFT_MEDIAMAILOVERIP = 0x8b IFT_MFSIGLINK = 0xa7 IFT_MIOX25 = 0x26 @@ -695,6 +807,7 @@ const ( IFT_VOICEOVERCABLE = 0xc6 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 + IFT_WIREGUARD = 0xfb IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 @@ -729,8 +842,6 @@ const ( IPPROTO_AH = 0x33 IPPROTO_CARP = 0x70 IPPROTO_DIVERT = 0x102 - IPPROTO_DIVERT_INIT = 0x2 - IPPROTO_DIVERT_RESP = 0x1 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 @@ -762,9 +873,11 @@ const ( IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e + IPPROTO_SCTP = 0x84 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 + IPPROTO_UDPLITE = 0x88 IPV6_AUTH_LEVEL = 0x35 IPV6_AUTOFLOWLABEL = 0x3b IPV6_CHECKSUM = 0x1a @@ -787,6 +900,7 @@ const ( IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXPACKET = 0xffff + IPV6_MINHOPCOUNT = 0x41 IPV6_MMTU = 0x500 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 @@ -826,12 +940,12 @@ const ( IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 - IP_DIVERTFL = 0x1022 IP_DROP_MEMBERSHIP = 0xd IP_ESP_NETWORK_LEVEL = 0x16 IP_ESP_TRANS_LEVEL = 0x15 IP_HDRINCL = 0x2 IP_IPCOMP_LEVEL = 0x1d + IP_IPDEFTTL = 0x25 IP_IPSECFLOWINFO = 0x24 IP_IPSEC_LOCAL_AUTH = 0x1b IP_IPSEC_LOCAL_CRED = 0x19 @@ -865,10 +979,15 @@ const ( IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RTABLE = 0x1021 + IP_SENDSRCADDR = 0x7 IP_TOS = 0x3 IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 + ITIMER_PROF = 0x2 + ITIMER_REAL = 0x0 + ITIMER_VIRTUAL = 0x1 + IUCLC = 0x1000 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 @@ -900,10 +1019,11 @@ const ( MAP_INHERIT_COPY = 0x1 MAP_INHERIT_NONE = 0x2 MAP_INHERIT_SHARE = 0x0 - MAP_NOEXTEND = 0x100 - MAP_NORESERVE = 0x40 + MAP_INHERIT_ZERO = 0x3 + MAP_NOEXTEND = 0x0 + MAP_NORESERVE = 0x0 MAP_PRIVATE = 0x2 - MAP_RENAME = 0x20 + MAP_RENAME = 0x0 MAP_SHARED = 0x1 MAP_STACK = 0x4000 MAP_TRYFIXED = 0x0 @@ -922,6 +1042,7 @@ const ( MNT_NOATIME = 0x8000 MNT_NODEV = 0x10 MNT_NOEXEC = 0x4 + MNT_NOPERM = 0x20 MNT_NOSUID = 0x8 MNT_NOWAIT = 0x2 MNT_QUOTA = 0x2000 @@ -929,13 +1050,29 @@ const ( MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SOFTDEP = 0x4000000 + MNT_STALLED = 0x100000 + MNT_SWAPPABLE = 0x200000 MNT_SYNCHRONOUS = 0x2 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0x400ffff MNT_WAIT = 0x1 MNT_WANTRDWR = 0x2000000 MNT_WXALLOWED = 0x800 + MOUNT_AFS = "afs" + MOUNT_CD9660 = "cd9660" + MOUNT_EXT2FS = "ext2fs" + MOUNT_FFS = "ffs" + MOUNT_FUSEFS = "fuse" + MOUNT_MFS = "mfs" + MOUNT_MSDOS = "msdos" + MOUNT_NCPFS = "ncpfs" + MOUNT_NFS = "nfs" + MOUNT_NTFS = "ntfs" + MOUNT_TMPFS = "tmpfs" + MOUNT_UDF = "udf" + MOUNT_UFS = "ffs" MSG_BCAST = 0x100 + MSG_CMSG_CLOEXEC = 0x800 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 @@ -946,6 +1083,7 @@ const ( MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 + MSG_WAITFORONE = 0x1000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x4 MS_SYNC = 0x2 @@ -953,12 +1091,16 @@ const ( NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 - NET_RT_MAXID = 0x6 + NET_RT_IFNAMES = 0x6 + NET_RT_MAXID = 0x8 + NET_RT_SOURCE = 0x7 NET_RT_STATS = 0x4 NET_RT_TABLE = 0x5 NFDBITS = 0x20 NOFLSH = 0x80000000 + NOKERNINFO = 0x2000000 NOTE_ATTRIB = 0x8 + NOTE_CHANGE = 0x1 NOTE_CHILD = 0x4 NOTE_DELETE = 0x1 NOTE_EOF = 0x2 @@ -968,6 +1110,7 @@ const ( NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 + NOTE_OOB = 0x4 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 @@ -977,11 +1120,13 @@ const ( NOTE_TRUNCATE = 0x80 NOTE_WRITE = 0x2 OCRNL = 0x10 + OLCUC = 0x20 ONLCR = 0x2 ONLRET = 0x80 ONOCR = 0x40 ONOEOT = 0x8 OPOST = 0x1 + OXTABS = 0x4 O_ACCMODE = 0x3 O_APPEND = 0x8 O_ASYNC = 0x40 @@ -1015,7 +1160,6 @@ const ( PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 - PT_MASK = 0x3ff000 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 @@ -1027,19 +1171,25 @@ const ( RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 + RTAX_BFD = 0xb RTAX_BRD = 0x7 + RTAX_DNS = 0xc RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_LABEL = 0xa - RTAX_MAX = 0xb + RTAX_MAX = 0xf RTAX_NETMASK = 0x2 + RTAX_SEARCH = 0xe RTAX_SRC = 0x8 RTAX_SRCMASK = 0x9 + RTAX_STATIC = 0xd RTA_AUTHOR = 0x40 + RTA_BFD = 0x800 RTA_BRD = 0x80 + RTA_DNS = 0x1000 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 @@ -1047,49 +1197,57 @@ const ( RTA_IFP = 0x10 RTA_LABEL = 0x400 RTA_NETMASK = 0x4 + RTA_SEARCH = 0x4000 RTA_SRC = 0x100 RTA_SRCMASK = 0x200 + RTA_STATIC = 0x2000 RTF_ANNOUNCE = 0x4000 + RTF_BFD = 0x1000000 RTF_BLACKHOLE = 0x1000 + RTF_BROADCAST = 0x400000 + RTF_CACHED = 0x20000 RTF_CLONED = 0x10000 RTF_CLONING = 0x100 + RTF_CONNECTED = 0x800000 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 - RTF_FMASK = 0x10f808 + RTF_FMASK = 0x110fc08 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_LLINFO = 0x400 - RTF_MASK = 0x80 + RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MPATH = 0x40000 RTF_MPLS = 0x100000 + RTF_MULTICAST = 0x200 RTF_PERMANENT_ARP = 0x2000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x2000 RTF_REJECT = 0x8 - RTF_SOURCE = 0x20000 RTF_STATIC = 0x800 - RTF_TUNNEL = 0x100000 RTF_UP = 0x1 RTF_USETRAILERS = 0x8000 - RTF_XRESOLVE = 0x200 + RTM_80211INFO = 0x15 RTM_ADD = 0x1 + RTM_BFD = 0x12 RTM_CHANGE = 0x3 + RTM_CHGADDRATTR = 0x14 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DESYNC = 0x10 RTM_GET = 0x4 RTM_IFANNOUNCE = 0xf RTM_IFINFO = 0xe - RTM_LOCK = 0x8 + RTM_INVALIDATE = 0x11 RTM_LOSING = 0x5 RTM_MAXSIZE = 0x800 RTM_MISS = 0x7 RTM_NEWADDR = 0xc + RTM_PROPOSAL = 0x13 RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb - RTM_RTTUNIT = 0xf4240 + RTM_SOURCE = 0x16 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 @@ -1099,67 +1257,74 @@ const ( RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 + RT_TABLEID_BITS = 0x8 + RT_TABLEID_MASK = 0xff RT_TABLEID_MAX = 0xff RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x4 + SEEK_CUR = 0x1 + SEEK_END = 0x2 + SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCAIFGROUP = 0x80246987 - SIOCALIFADDR = 0x8218691c SIOCATMARK = 0x40047307 - SIOCBRDGADD = 0x8054693c - SIOCBRDGADDS = 0x80546941 - SIOCBRDGARL = 0x806e694d + SIOCBRDGADD = 0x805c693c + SIOCBRDGADDL = 0x805c6949 + SIOCBRDGADDS = 0x805c6941 + SIOCBRDGARL = 0x808c694d SIOCBRDGDADDR = 0x81286947 - SIOCBRDGDEL = 0x8054693d - SIOCBRDGDELS = 0x80546942 - SIOCBRDGFLUSH = 0x80546948 - SIOCBRDGFRL = 0x806e694e + SIOCBRDGDEL = 0x805c693d + SIOCBRDGDELS = 0x805c6942 + SIOCBRDGFLUSH = 0x805c6948 + SIOCBRDGFRL = 0x808c694e SIOCBRDGGCACHE = 0xc0146941 SIOCBRDGGFD = 0xc0146952 SIOCBRDGGHT = 0xc0146951 - SIOCBRDGGIFFLGS = 0xc054693e + SIOCBRDGGIFFLGS = 0xc05c693e SIOCBRDGGMA = 0xc0146953 SIOCBRDGGPARAM = 0xc03c6958 SIOCBRDGGPRI = 0xc0146950 SIOCBRDGGRL = 0xc028694f - SIOCBRDGGSIFS = 0xc054693c SIOCBRDGGTO = 0xc0146946 - SIOCBRDGIFS = 0xc0546942 + SIOCBRDGIFS = 0xc05c6942 SIOCBRDGRTS = 0xc0186943 SIOCBRDGSADDR = 0xc1286944 SIOCBRDGSCACHE = 0x80146940 SIOCBRDGSFD = 0x80146952 SIOCBRDGSHT = 0x80146951 - SIOCBRDGSIFCOST = 0x80546955 - SIOCBRDGSIFFLGS = 0x8054693f - SIOCBRDGSIFPRIO = 0x80546954 + SIOCBRDGSIFCOST = 0x805c6955 + SIOCBRDGSIFFLGS = 0x805c693f + SIOCBRDGSIFPRIO = 0x805c6954 + SIOCBRDGSIFPROT = 0x805c694a SIOCBRDGSMA = 0x80146953 SIOCBRDGSPRI = 0x80146950 SIOCBRDGSPROTO = 0x8014695a SIOCBRDGSTO = 0x80146945 SIOCBRDGSTXHC = 0x80146959 + SIOCDELLABEL = 0x80206997 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80246989 + SIOCDIFPARENT = 0x802069b4 SIOCDIFPHYADDR = 0x80206949 - SIOCDLIFADDR = 0x8218691e + SIOCDPWE3NEIGHBOR = 0x802069de + SIOCDVNETID = 0x802069af SIOCGETKALIVE = 0xc01869a4 SIOCGETLABEL = 0x8020699a + SIOCGETMPWCFG = 0xc02069ae SIOCGETPFLOW = 0xc02069fe SIOCGETPFSYNC = 0xc02069f8 SIOCGETSGCNT = 0xc0147534 SIOCGETVIFCNT = 0xc0147533 SIOCGETVLAN = 0xc0206990 - SIOCGHIWAT = 0x40047301 SIOCGIFADDR = 0xc0206921 - SIOCGIFASYNCMAP = 0xc020697c SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCONF = 0xc0086924 SIOCGIFDATA = 0xc020691b @@ -1168,40 +1333,53 @@ const ( SIOCGIFFLAGS = 0xc0206911 SIOCGIFGATTR = 0xc024698b SIOCGIFGENERIC = 0xc020693a + SIOCGIFGLIST = 0xc024698d SIOCGIFGMEMB = 0xc024698a SIOCGIFGROUP = 0xc0246988 SIOCGIFHARDMTU = 0xc02069a5 - SIOCGIFMEDIA = 0xc0286936 + SIOCGIFLLPRIO = 0xc02069b6 + SIOCGIFMEDIA = 0xc0386938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc020697e SIOCGIFNETMASK = 0xc0206925 - SIOCGIFPDSTADDR = 0xc0206948 + SIOCGIFPAIR = 0xc02069b1 + SIOCGIFPARENT = 0xc02069b3 SIOCGIFPRIORITY = 0xc020699c - SIOCGIFPSRCADDR = 0xc0206947 SIOCGIFRDOMAIN = 0xc02069a0 SIOCGIFRTLABEL = 0xc0206983 - SIOCGIFTIMESLOT = 0xc0206986 + SIOCGIFRXR = 0x802069aa + SIOCGIFSFFPAGE = 0xc1126939 SIOCGIFXFLAGS = 0xc020699e - SIOCGLIFADDR = 0xc218691d SIOCGLIFPHYADDR = 0xc218694b + SIOCGLIFPHYDF = 0xc02069c2 + SIOCGLIFPHYECN = 0xc02069c8 SIOCGLIFPHYRTABLE = 0xc02069a2 SIOCGLIFPHYTTL = 0xc02069a9 - SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 + SIOCGPWE3 = 0xc0206998 + SIOCGPWE3CTRLWORD = 0xc02069dc + SIOCGPWE3FAT = 0xc02069dd + SIOCGPWE3NEIGHBOR = 0xc21869de + SIOCGRXHPRIO = 0xc02069db SIOCGSPPPPARAMS = 0xc0206994 + SIOCGTXHPRIO = 0xc02069c6 + SIOCGUMBINFO = 0xc02069be + SIOCGUMBPARAM = 0xc02069c0 SIOCGVH = 0xc02069f6 + SIOCGVNETFLOWID = 0xc02069c4 SIOCGVNETID = 0xc02069a7 + SIOCIFAFATTACH = 0x801169ab + SIOCIFAFDETACH = 0x801169ac SIOCIFCREATE = 0x8020697a SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc00c6978 SIOCSETKALIVE = 0x801869a3 SIOCSETLABEL = 0x80206999 + SIOCSETMPWCFG = 0x802069ad SIOCSETPFLOW = 0x802069fd SIOCSETPFSYNC = 0x802069f7 SIOCSETVLAN = 0x8020698f - SIOCSHIWAT = 0x80047300 SIOCSIFADDR = 0x8020690c - SIOCSIFASYNCMAP = 0x8020697d SIOCSIFBRDADDR = 0x80206913 SIOCSIFDESCR = 0x80206980 SIOCSIFDSTADDR = 0x8020690e @@ -1209,25 +1387,37 @@ const ( SIOCSIFGATTR = 0x8024698c SIOCSIFGENERIC = 0x80206939 SIOCSIFLLADDR = 0x8020691f - SIOCSIFMEDIA = 0xc0206935 + SIOCSIFLLPRIO = 0x802069b5 + SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x8020697f SIOCSIFNETMASK = 0x80206916 - SIOCSIFPHYADDR = 0x80406946 + SIOCSIFPAIR = 0x802069b0 + SIOCSIFPARENT = 0x802069b2 SIOCSIFPRIORITY = 0x8020699b SIOCSIFRDOMAIN = 0x8020699f SIOCSIFRTLABEL = 0x80206982 - SIOCSIFTIMESLOT = 0x80206985 SIOCSIFXFLAGS = 0x8020699d SIOCSLIFPHYADDR = 0x8218694a + SIOCSLIFPHYDF = 0x802069c1 + SIOCSLIFPHYECN = 0x802069c7 SIOCSLIFPHYRTABLE = 0x802069a1 SIOCSLIFPHYTTL = 0x802069a8 - SIOCSLOWAT = 0x80047302 SIOCSPGRP = 0x80047308 + SIOCSPWE3CTRLWORD = 0x802069dc + SIOCSPWE3FAT = 0x802069dd + SIOCSPWE3NEIGHBOR = 0x821869de + SIOCSRXHPRIO = 0x802069db SIOCSSPPPPARAMS = 0x80206993 + SIOCSTXHPRIO = 0x802069c5 + SIOCSUMBPARAM = 0x802069bf SIOCSVH = 0xc02069f5 + SIOCSVNETFLOWID = 0x802069c3 SIOCSVNETID = 0x802069a6 + SOCK_CLOEXEC = 0x8000 SOCK_DGRAM = 0x2 + SOCK_DNS = 0x1000 + SOCK_NONBLOCK = 0x4000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 @@ -1238,6 +1428,7 @@ const ( SO_BINDANY = 0x1000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 + SO_DOMAIN = 0x1024 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 @@ -1245,6 +1436,7 @@ const ( SO_NETPROC = 0x1020 SO_OOBINLINE = 0x100 SO_PEERCRED = 0x1022 + SO_PROTOCOL = 0x1025 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 @@ -1258,6 +1450,7 @@ const ( SO_TIMESTAMP = 0x800 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 + SO_ZEROIZE = 0x2000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 @@ -1287,9 +1480,24 @@ const ( S_IXOTH = 0x1 S_IXUSR = 0x40 TCIFLUSH = 0x1 + TCIOFF = 0x3 TCIOFLUSH = 0x3 + TCION = 0x4 TCOFLUSH = 0x2 - TCP_MAXBURST = 0x4 + TCOOFF = 0x1 + TCOON = 0x2 + TCPOPT_EOL = 0x0 + TCPOPT_MAXSEG = 0x2 + TCPOPT_NOP = 0x1 + TCPOPT_SACK = 0x5 + TCPOPT_SACK_HDR = 0x1010500 + TCPOPT_SACK_PERMITTED = 0x4 + TCPOPT_SACK_PERMIT_HDR = 0x1010402 + TCPOPT_SIGNATURE = 0x13 + TCPOPT_TIMESTAMP = 0x8 + TCPOPT_TSTAMP_HDR = 0x101080a + TCPOPT_WINDOW = 0x3 + TCP_INFO = 0x9 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x3 @@ -1298,11 +1506,15 @@ const ( TCP_MSS = 0x200 TCP_NODELAY = 0x1 TCP_NOPUSH = 0x10 - TCP_NSTATES = 0xb + TCP_SACKHOLE_LIMIT = 0x80 TCP_SACK_ENABLE = 0x8 TCSAFLUSH = 0x2 + TIMER_ABSTIME = 0x1 + TIMER_RELTIME = 0x0 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 + TIOCCHKVERAUTH = 0x2000741e + TIOCCLRVERAUTH = 0x2000741d TIOCCONS = 0x80047462 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d @@ -1357,17 +1569,21 @@ const ( TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b + TIOCSETVERAUTH = 0x8004741c TIOCSFLAGS = 0x8004745c TIOCSIG = 0x8004745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e - TIOCSTAT = 0x80047465 - TIOCSTI = 0x80017472 + TIOCSTAT = 0x20007465 TIOCSTOP = 0x2000746f TIOCSTSTAMP = 0x8008745a TIOCSWINSZ = 0x80087467 TIOCUCNTL = 0x80047466 + TIOCUCNTL_CBRK = 0x7a + TIOCUCNTL_SBRK = 0x7b TOSTOP = 0x400000 + UTIME_NOW = -0x2 + UTIME_OMIT = -0x1 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 @@ -1378,6 +1594,19 @@ const ( VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 + VM_ANONMIN = 0x7 + VM_LOADAVG = 0x2 + VM_MALLOC_CONF = 0xc + VM_MAXID = 0xd + VM_MAXSLP = 0xa + VM_METER = 0x1 + VM_NKMEMPAGES = 0x6 + VM_PSSTRINGS = 0x3 + VM_SWAPENCRYPT = 0x5 + VM_USPACE = 0xb + VM_UVMEXP = 0x4 + VM_VNODEMIN = 0x9 + VM_VTEXTMIN = 0x8 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc @@ -1390,8 +1619,8 @@ const ( WCONTINUED = 0x8 WCOREFLAG = 0x80 WNOHANG = 0x1 - WSTOPPED = 0x7f WUNTRACED = 0x2 + XCASE = 0x1000000 ) // Errors @@ -1405,6 +1634,7 @@ const ( EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) + EBADMSG = syscall.Errno(0x5c) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x58) @@ -1431,7 +1661,7 @@ const ( EIPSEC = syscall.Errno(0x52) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) - ELAST = syscall.Errno(0x5b) + ELAST = syscall.Errno(0x5f) ELOOP = syscall.Errno(0x3e) EMEDIUMTYPE = syscall.Errno(0x56) EMFILE = syscall.Errno(0x18) @@ -1459,12 +1689,14 @@ const ( ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) + ENOTRECOVERABLE = syscall.Errno(0x5d) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x5b) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x57) + EOWNERDEAD = syscall.Errno(0x5e) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) @@ -1472,6 +1704,7 @@ const ( EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) + EPROTO = syscall.Errno(0x5f) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) @@ -1568,7 +1801,7 @@ var errorList = [...]struct { {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, - {35, "EWOULDBLOCK", "resource temporarily unavailable"}, + {35, "EAGAIN", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, @@ -1624,7 +1857,11 @@ var errorList = [...]struct { {88, "ECANCELED", "operation canceled"}, {89, "EIDRM", "identifier removed"}, {90, "ENOMSG", "no message of desired type"}, - {91, "ELAST", "not supported"}, + {91, "ENOTSUP", "not supported"}, + {92, "EBADMSG", "bad message"}, + {93, "ENOTRECOVERABLE", "state not recoverable"}, + {94, "EOWNERDEAD", "previous owner died"}, + {95, "ELAST", "protocol error"}, } // Signal table @@ -1638,7 +1875,7 @@ var signalList = [...]struct { {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, - {6, "SIGABRT", "abort trap"}, + {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, @@ -1665,4 +1902,5 @@ var signalList = [...]struct { {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "thread AST"}, + {28672, "SIGSTKSZ", "unknown signal"}, } diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go index 25cb6094813..6015fcb2bf6 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go @@ -109,6 +109,15 @@ const ( BPF_DIRECTION_IN = 0x1 BPF_DIRECTION_OUT = 0x2 BPF_DIV = 0x30 + BPF_FILDROP_CAPTURE = 0x1 + BPF_FILDROP_DROP = 0x2 + BPF_FILDROP_PASS = 0x0 + BPF_F_DIR_IN = 0x10 + BPF_F_DIR_MASK = 0x30 + BPF_F_DIR_OUT = 0x20 + BPF_F_DIR_SHIFT = 0x4 + BPF_F_FLOWID = 0x8 + BPF_F_PRI_MASK = 0x7 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 @@ -137,6 +146,7 @@ const ( BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 + BPF_RND = 0xc0 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 @@ -177,7 +187,65 @@ const ( CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 + DIOCADDQUEUE = 0xc110445d + DIOCADDRULE = 0xcd604404 + DIOCADDSTATE = 0xc1084425 + DIOCCHANGERULE = 0xcd60441a + DIOCCLRIFFLAG = 0xc028445a + DIOCCLRSRCNODES = 0x20004455 + DIOCCLRSTATES = 0xc0e04412 + DIOCCLRSTATUS = 0xc0284416 + DIOCGETLIMIT = 0xc0084427 + DIOCGETQSTATS = 0xc1204460 + DIOCGETQUEUE = 0xc110445f + DIOCGETQUEUES = 0xc110445e + DIOCGETRULE = 0xcd604407 + DIOCGETRULES = 0xcd604406 + DIOCGETRULESET = 0xc444443b + DIOCGETRULESETS = 0xc444443a + DIOCGETSRCNODES = 0xc0104454 + DIOCGETSTATE = 0xc1084413 + DIOCGETSTATES = 0xc0104419 + DIOCGETSTATUS = 0xc1e84415 + DIOCGETSYNFLWATS = 0xc0084463 + DIOCGETTIMEOUT = 0xc008441e + DIOCIGETIFACES = 0xc0284457 + DIOCKILLSRCNODES = 0xc080445b + DIOCKILLSTATES = 0xc0e04429 + DIOCNATLOOK = 0xc0504417 + DIOCOSFPADD = 0xc088444f DIOCOSFPFLUSH = 0x2000444e + DIOCOSFPGET = 0xc0884450 + DIOCRADDADDRS = 0xc4504443 + DIOCRADDTABLES = 0xc450443d + DIOCRCLRADDRS = 0xc4504442 + DIOCRCLRASTATS = 0xc4504448 + DIOCRCLRTABLES = 0xc450443c + DIOCRCLRTSTATS = 0xc4504441 + DIOCRDELADDRS = 0xc4504444 + DIOCRDELTABLES = 0xc450443e + DIOCRGETADDRS = 0xc4504446 + DIOCRGETASTATS = 0xc4504447 + DIOCRGETTABLES = 0xc450443f + DIOCRGETTSTATS = 0xc4504440 + DIOCRINADEFINE = 0xc450444d + DIOCRSETADDRS = 0xc4504445 + DIOCRSETTFLAGS = 0xc450444a + DIOCRTSTADDRS = 0xc4504449 + DIOCSETDEBUG = 0xc0044418 + DIOCSETHOSTID = 0xc0044456 + DIOCSETIFFLAG = 0xc0284459 + DIOCSETLIMIT = 0xc0084428 + DIOCSETREASS = 0xc004445c + DIOCSETSTATUSIF = 0xc0284414 + DIOCSETSYNCOOKIES = 0xc0014462 + DIOCSETSYNFLWATS = 0xc0084461 + DIOCSETTIMEOUT = 0xc008441d + DIOCSTART = 0x20004401 + DIOCSTOP = 0x20004402 + DIOCXBEGIN = 0xc0104451 + DIOCXCOMMIT = 0xc0104452 + DIOCXROLLBACK = 0xc0104453 DLT_ARCNET = 0x7 DLT_ATM_RFC1483 = 0xb DLT_AX25 = 0x3 @@ -240,6 +308,8 @@ const ( EMUL_ENABLED = 0x1 EMUL_NATIVE = 0x2 ENDRUNDISC = 0x9 + ETH64_8021_RSVD_MASK = 0xfffffffffff0 + ETH64_8021_RSVD_PREFIX = 0x180c2000000 ETHERMIN = 0x2e ETHERMTU = 0x5dc ETHERTYPE_8023 = 0x4 @@ -292,6 +362,7 @@ const ( ETHERTYPE_DN = 0x6003 ETHERTYPE_DOGFIGHT = 0x1989 ETHERTYPE_DSMD = 0x8039 + ETHERTYPE_EAPOL = 0x888e ETHERTYPE_ECMA = 0x803 ETHERTYPE_ENCRYPT = 0x803d ETHERTYPE_ES = 0x805d @@ -323,6 +394,7 @@ const ( ETHERTYPE_LLDP = 0x88cc ETHERTYPE_LOGICRAFT = 0x8148 ETHERTYPE_LOOPBACK = 0x9000 + ETHERTYPE_MACSEC = 0x88e5 ETHERTYPE_MATRA = 0x807a ETHERTYPE_MAX = 0xffff ETHERTYPE_MERIT = 0x807c @@ -351,15 +423,17 @@ const ( ETHERTYPE_NCD = 0x8149 ETHERTYPE_NESTAR = 0x8006 ETHERTYPE_NETBEUI = 0x8191 + ETHERTYPE_NHRP = 0x2001 ETHERTYPE_NOVELL = 0x8138 ETHERTYPE_NS = 0x600 ETHERTYPE_NSAT = 0x601 ETHERTYPE_NSCOMPAT = 0x807 + ETHERTYPE_NSH = 0x984f ETHERTYPE_NTRAILER = 0x10 ETHERTYPE_OS9 = 0x7007 ETHERTYPE_OS9NET = 0x7009 ETHERTYPE_PACER = 0x80c6 - ETHERTYPE_PAE = 0x888e + ETHERTYPE_PBB = 0x88e7 ETHERTYPE_PCS = 0x4242 ETHERTYPE_PLANNING = 0x8044 ETHERTYPE_PPP = 0x880b @@ -441,10 +515,11 @@ const ( ETHER_VLAN_ENCAP_LEN = 0x4 EVFILT_AIO = -0x3 EVFILT_DEVICE = -0x8 + EVFILT_EXCEPT = -0x9 EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 - EVFILT_SYSCOUNT = 0x8 + EVFILT_SYSCOUNT = 0x9 EVFILT_TIMER = -0x7 EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 @@ -466,7 +541,7 @@ const ( EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 - EV_SYSFLAGS = 0xf000 + EV_SYSFLAGS = 0xf800 EXTA = 0x4b00 EXTB = 0x9600 EXTPROC = 0x800 @@ -732,6 +807,7 @@ const ( IFT_VOICEOVERCABLE = 0xc6 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 + IFT_WIREGUARD = 0xfb IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 @@ -797,9 +873,11 @@ const ( IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e + IPPROTO_SCTP = 0x84 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 + IPPROTO_UDPLITE = 0x88 IPV6_AUTH_LEVEL = 0x35 IPV6_AUTOFLOWLABEL = 0x3b IPV6_CHECKSUM = 0x1a @@ -906,6 +984,9 @@ const ( IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 + ITIMER_PROF = 0x2 + ITIMER_REAL = 0x0 + ITIMER_VIRTUAL = 0x1 IUCLC = 0x1000 IXANY = 0x800 IXOFF = 0x400 @@ -970,12 +1051,26 @@ const ( MNT_ROOTFS = 0x4000 MNT_SOFTDEP = 0x4000000 MNT_STALLED = 0x100000 + MNT_SWAPPABLE = 0x200000 MNT_SYNCHRONOUS = 0x2 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0x400ffff MNT_WAIT = 0x1 MNT_WANTRDWR = 0x2000000 MNT_WXALLOWED = 0x800 + MOUNT_AFS = "afs" + MOUNT_CD9660 = "cd9660" + MOUNT_EXT2FS = "ext2fs" + MOUNT_FFS = "ffs" + MOUNT_FUSEFS = "fuse" + MOUNT_MFS = "mfs" + MOUNT_MSDOS = "msdos" + MOUNT_NCPFS = "ncpfs" + MOUNT_NFS = "nfs" + MOUNT_NTFS = "ntfs" + MOUNT_TMPFS = "tmpfs" + MOUNT_UDF = "udf" + MOUNT_UFS = "ffs" MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CTRUNC = 0x20 @@ -988,6 +1083,7 @@ const ( MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 + MSG_WAITFORONE = 0x1000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x4 MS_SYNC = 0x2 @@ -996,7 +1092,8 @@ const ( NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFNAMES = 0x6 - NET_RT_MAXID = 0x7 + NET_RT_MAXID = 0x8 + NET_RT_SOURCE = 0x7 NET_RT_STATS = 0x4 NET_RT_TABLE = 0x5 NFDBITS = 0x20 @@ -1013,6 +1110,7 @@ const ( NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 + NOTE_OOB = 0x4 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 @@ -1130,9 +1228,11 @@ const ( RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_USETRAILERS = 0x8000 + RTM_80211INFO = 0x15 RTM_ADD = 0x1 RTM_BFD = 0x12 RTM_CHANGE = 0x3 + RTM_CHGADDRATTR = 0x14 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DESYNC = 0x10 @@ -1140,7 +1240,6 @@ const ( RTM_IFANNOUNCE = 0xf RTM_IFINFO = 0xe RTM_INVALIDATE = 0x11 - RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MAXSIZE = 0x800 RTM_MISS = 0x7 @@ -1148,7 +1247,7 @@ const ( RTM_PROPOSAL = 0x13 RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb - RTM_RTTUNIT = 0xf4240 + RTM_SOURCE = 0x16 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 @@ -1166,6 +1265,9 @@ const ( RUSAGE_THREAD = 0x1 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x4 + SEEK_CUR = 0x1 + SEEK_END = 0x2 + SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 @@ -1182,35 +1284,37 @@ const ( SIOCBRDGDELS = 0x80606942 SIOCBRDGFLUSH = 0x80606948 SIOCBRDGFRL = 0x808c694e - SIOCBRDGGCACHE = 0xc0186941 - SIOCBRDGGFD = 0xc0186952 - SIOCBRDGGHT = 0xc0186951 + SIOCBRDGGCACHE = 0xc0146941 + SIOCBRDGGFD = 0xc0146952 + SIOCBRDGGHT = 0xc0146951 SIOCBRDGGIFFLGS = 0xc060693e - SIOCBRDGGMA = 0xc0186953 + SIOCBRDGGMA = 0xc0146953 SIOCBRDGGPARAM = 0xc0406958 - SIOCBRDGGPRI = 0xc0186950 + SIOCBRDGGPRI = 0xc0146950 SIOCBRDGGRL = 0xc030694f - SIOCBRDGGTO = 0xc0186946 + SIOCBRDGGTO = 0xc0146946 SIOCBRDGIFS = 0xc0606942 SIOCBRDGRTS = 0xc0206943 SIOCBRDGSADDR = 0xc1286944 - SIOCBRDGSCACHE = 0x80186940 - SIOCBRDGSFD = 0x80186952 - SIOCBRDGSHT = 0x80186951 + SIOCBRDGSCACHE = 0x80146940 + SIOCBRDGSFD = 0x80146952 + SIOCBRDGSHT = 0x80146951 SIOCBRDGSIFCOST = 0x80606955 SIOCBRDGSIFFLGS = 0x8060693f SIOCBRDGSIFPRIO = 0x80606954 SIOCBRDGSIFPROT = 0x8060694a - SIOCBRDGSMA = 0x80186953 - SIOCBRDGSPRI = 0x80186950 - SIOCBRDGSPROTO = 0x8018695a - SIOCBRDGSTO = 0x80186945 - SIOCBRDGSTXHC = 0x80186959 + SIOCBRDGSMA = 0x80146953 + SIOCBRDGSPRI = 0x80146950 + SIOCBRDGSPROTO = 0x8014695a + SIOCBRDGSTO = 0x80146945 + SIOCBRDGSTXHC = 0x80146959 + SIOCDELLABEL = 0x80206997 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80286989 SIOCDIFPARENT = 0x802069b4 SIOCDIFPHYADDR = 0x80206949 + SIOCDPWE3NEIGHBOR = 0x802069de SIOCDVNETID = 0x802069af SIOCGETKALIVE = 0xc01869a4 SIOCGETLABEL = 0x8020699a @@ -1229,6 +1333,7 @@ const ( SIOCGIFFLAGS = 0xc0206911 SIOCGIFGATTR = 0xc028698b SIOCGIFGENERIC = 0xc020693a + SIOCGIFGLIST = 0xc028698d SIOCGIFGMEMB = 0xc028698a SIOCGIFGROUP = 0xc0286988 SIOCGIFHARDMTU = 0xc02069a5 @@ -1243,13 +1348,21 @@ const ( SIOCGIFRDOMAIN = 0xc02069a0 SIOCGIFRTLABEL = 0xc0206983 SIOCGIFRXR = 0x802069aa + SIOCGIFSFFPAGE = 0xc1126939 SIOCGIFXFLAGS = 0xc020699e SIOCGLIFPHYADDR = 0xc218694b SIOCGLIFPHYDF = 0xc02069c2 + SIOCGLIFPHYECN = 0xc02069c8 SIOCGLIFPHYRTABLE = 0xc02069a2 SIOCGLIFPHYTTL = 0xc02069a9 SIOCGPGRP = 0x40047309 + SIOCGPWE3 = 0xc0206998 + SIOCGPWE3CTRLWORD = 0xc02069dc + SIOCGPWE3FAT = 0xc02069dd + SIOCGPWE3NEIGHBOR = 0xc21869de + SIOCGRXHPRIO = 0xc02069db SIOCGSPPPPARAMS = 0xc0206994 + SIOCGTXHPRIO = 0xc02069c6 SIOCGUMBINFO = 0xc02069be SIOCGUMBPARAM = 0xc02069c0 SIOCGVH = 0xc02069f6 @@ -1287,19 +1400,20 @@ const ( SIOCSIFXFLAGS = 0x8020699d SIOCSLIFPHYADDR = 0x8218694a SIOCSLIFPHYDF = 0x802069c1 + SIOCSLIFPHYECN = 0x802069c7 SIOCSLIFPHYRTABLE = 0x802069a1 SIOCSLIFPHYTTL = 0x802069a8 SIOCSPGRP = 0x80047308 + SIOCSPWE3CTRLWORD = 0x802069dc + SIOCSPWE3FAT = 0x802069dd + SIOCSPWE3NEIGHBOR = 0x821869de + SIOCSRXHPRIO = 0x802069db SIOCSSPPPPARAMS = 0x80206993 + SIOCSTXHPRIO = 0x802069c5 SIOCSUMBPARAM = 0x802069bf SIOCSVH = 0xc02069f5 SIOCSVNETFLOWID = 0x802069c3 SIOCSVNETID = 0x802069a6 - SIOCSWGDPID = 0xc018695b - SIOCSWGMAXFLOW = 0xc0186960 - SIOCSWGMAXGROUP = 0xc018695d - SIOCSWSDPID = 0x8018695c - SIOCSWSPORTNO = 0xc060695f SOCK_CLOEXEC = 0x8000 SOCK_DGRAM = 0x2 SOCK_DNS = 0x1000 @@ -1314,6 +1428,7 @@ const ( SO_BINDANY = 0x1000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 + SO_DOMAIN = 0x1024 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 @@ -1321,6 +1436,7 @@ const ( SO_NETPROC = 0x1020 SO_OOBINLINE = 0x100 SO_PEERCRED = 0x1022 + SO_PROTOCOL = 0x1025 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 @@ -1370,7 +1486,18 @@ const ( TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 - TCP_MAXBURST = 0x4 + TCPOPT_EOL = 0x0 + TCPOPT_MAXSEG = 0x2 + TCPOPT_NOP = 0x1 + TCPOPT_SACK = 0x5 + TCPOPT_SACK_HDR = 0x1010500 + TCPOPT_SACK_PERMITTED = 0x4 + TCPOPT_SACK_PERMIT_HDR = 0x1010402 + TCPOPT_SIGNATURE = 0x13 + TCPOPT_TIMESTAMP = 0x8 + TCPOPT_TSTAMP_HDR = 0x101080a + TCPOPT_WINDOW = 0x3 + TCP_INFO = 0x9 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x3 @@ -1379,8 +1506,11 @@ const ( TCP_MSS = 0x200 TCP_NODELAY = 0x1 TCP_NOPUSH = 0x10 + TCP_SACKHOLE_LIMIT = 0x80 TCP_SACK_ENABLE = 0x8 TCSAFLUSH = 0x2 + TIMER_ABSTIME = 0x1 + TIMER_RELTIME = 0x0 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCHKVERAUTH = 0x2000741e @@ -1445,7 +1575,6 @@ const ( TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 - TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSTSTAMP = 0x8008745a TIOCSWINSZ = 0x80087467 @@ -1467,7 +1596,8 @@ const ( VMIN = 0x10 VM_ANONMIN = 0x7 VM_LOADAVG = 0x2 - VM_MAXID = 0xc + VM_MALLOC_CONF = 0xc + VM_MAXID = 0xd VM_MAXSLP = 0xa VM_METER = 0x1 VM_NKMEMPAGES = 0x6 @@ -1745,7 +1875,7 @@ var signalList = [...]struct { {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, - {6, "SIGABRT", "abort trap"}, + {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, @@ -1772,4 +1902,5 @@ var signalList = [...]struct { {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "thread AST"}, + {28672, "SIGSTKSZ", "unknown signal"}, } diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go index aef6c085609..8d44955e44d 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go @@ -46,6 +46,7 @@ const ( AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 + ALTWERASE = 0x200 ARPHRD_ETHER = 0x1 ARPHRD_FRELAY = 0xf ARPHRD_IEEE1394 = 0x18 @@ -82,7 +83,7 @@ const ( BIOCGFILDROP = 0x40044278 BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044273 - BIOCGRTIMEOUT = 0x400c426e + BIOCGRTIMEOUT = 0x4010426e BIOCGSTATS = 0x4008426f BIOCIMMEDIATE = 0x80044270 BIOCLOCK = 0x20004276 @@ -96,7 +97,7 @@ const ( BIOCSFILDROP = 0x80044279 BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044272 - BIOCSRTIMEOUT = 0x800c426d + BIOCSRTIMEOUT = 0x8010426d BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 @@ -108,6 +109,15 @@ const ( BPF_DIRECTION_IN = 0x1 BPF_DIRECTION_OUT = 0x2 BPF_DIV = 0x30 + BPF_FILDROP_CAPTURE = 0x1 + BPF_FILDROP_DROP = 0x2 + BPF_FILDROP_PASS = 0x0 + BPF_F_DIR_IN = 0x10 + BPF_F_DIR_MASK = 0x30 + BPF_F_DIR_OUT = 0x20 + BPF_F_DIR_SHIFT = 0x4 + BPF_F_FLOWID = 0x8 + BPF_F_PRI_MASK = 0x7 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 @@ -136,6 +146,7 @@ const ( BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 + BPF_RND = 0xc0 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 @@ -147,6 +158,12 @@ const ( BRKINT = 0x2 CFLUSH = 0xf CLOCAL = 0x8000 + CLOCK_BOOTTIME = 0x6 + CLOCK_MONOTONIC = 0x3 + CLOCK_PROCESS_CPUTIME_ID = 0x2 + CLOCK_REALTIME = 0x0 + CLOCK_THREAD_CPUTIME_ID = 0x4 + CLOCK_UPTIME = 0x5 CPUSTATES = 0x6 CP_IDLE = 0x5 CP_INTR = 0x4 @@ -170,7 +187,65 @@ const ( CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 + DIOCADDQUEUE = 0xc100445d + DIOCADDRULE = 0xcce04404 + DIOCADDSTATE = 0xc1084425 + DIOCCHANGERULE = 0xcce0441a + DIOCCLRIFFLAG = 0xc024445a + DIOCCLRSRCNODES = 0x20004455 + DIOCCLRSTATES = 0xc0d04412 + DIOCCLRSTATUS = 0xc0244416 + DIOCGETLIMIT = 0xc0084427 + DIOCGETQSTATS = 0xc1084460 + DIOCGETQUEUE = 0xc100445f + DIOCGETQUEUES = 0xc100445e + DIOCGETRULE = 0xcce04407 + DIOCGETRULES = 0xcce04406 + DIOCGETRULESET = 0xc444443b + DIOCGETRULESETS = 0xc444443a + DIOCGETSRCNODES = 0xc0084454 + DIOCGETSTATE = 0xc1084413 + DIOCGETSTATES = 0xc0084419 + DIOCGETSTATUS = 0xc1e84415 + DIOCGETSYNFLWATS = 0xc0084463 + DIOCGETTIMEOUT = 0xc008441e + DIOCIGETIFACES = 0xc0244457 + DIOCKILLSRCNODES = 0xc068445b + DIOCKILLSTATES = 0xc0d04429 + DIOCNATLOOK = 0xc0504417 + DIOCOSFPADD = 0xc088444f DIOCOSFPFLUSH = 0x2000444e + DIOCOSFPGET = 0xc0884450 + DIOCRADDADDRS = 0xc44c4443 + DIOCRADDTABLES = 0xc44c443d + DIOCRCLRADDRS = 0xc44c4442 + DIOCRCLRASTATS = 0xc44c4448 + DIOCRCLRTABLES = 0xc44c443c + DIOCRCLRTSTATS = 0xc44c4441 + DIOCRDELADDRS = 0xc44c4444 + DIOCRDELTABLES = 0xc44c443e + DIOCRGETADDRS = 0xc44c4446 + DIOCRGETASTATS = 0xc44c4447 + DIOCRGETTABLES = 0xc44c443f + DIOCRGETTSTATS = 0xc44c4440 + DIOCRINADEFINE = 0xc44c444d + DIOCRSETADDRS = 0xc44c4445 + DIOCRSETTFLAGS = 0xc44c444a + DIOCRTSTADDRS = 0xc44c4449 + DIOCSETDEBUG = 0xc0044418 + DIOCSETHOSTID = 0xc0044456 + DIOCSETIFFLAG = 0xc0244459 + DIOCSETLIMIT = 0xc0084428 + DIOCSETREASS = 0xc004445c + DIOCSETSTATUSIF = 0xc0244414 + DIOCSETSYNCOOKIES = 0xc0014462 + DIOCSETSYNFLWATS = 0xc0084461 + DIOCSETTIMEOUT = 0xc008441d + DIOCSTART = 0x20004401 + DIOCSTOP = 0x20004402 + DIOCXBEGIN = 0xc00c4451 + DIOCXCOMMIT = 0xc00c4452 + DIOCXROLLBACK = 0xc00c4453 DLT_ARCNET = 0x7 DLT_ATM_RFC1483 = 0xb DLT_AX25 = 0x3 @@ -186,6 +261,7 @@ const ( DLT_LOOP = 0xc DLT_MPLS = 0xdb DLT_NULL = 0x0 + DLT_OPENFLOW = 0x10b DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPP = 0x9 @@ -196,6 +272,23 @@ const ( DLT_RAW = 0xe DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xf + DLT_USBPCAP = 0xf9 + DLT_USER0 = 0x93 + DLT_USER1 = 0x94 + DLT_USER10 = 0x9d + DLT_USER11 = 0x9e + DLT_USER12 = 0x9f + DLT_USER13 = 0xa0 + DLT_USER14 = 0xa1 + DLT_USER15 = 0xa2 + DLT_USER2 = 0x95 + DLT_USER3 = 0x96 + DLT_USER4 = 0x97 + DLT_USER5 = 0x98 + DLT_USER6 = 0x99 + DLT_USER7 = 0x9a + DLT_USER8 = 0x9b + DLT_USER9 = 0x9c DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 @@ -215,6 +308,8 @@ const ( EMUL_ENABLED = 0x1 EMUL_NATIVE = 0x2 ENDRUNDISC = 0x9 + ETH64_8021_RSVD_MASK = 0xfffffffffff0 + ETH64_8021_RSVD_PREFIX = 0x180c2000000 ETHERMIN = 0x2e ETHERMTU = 0x5dc ETHERTYPE_8023 = 0x4 @@ -267,6 +362,7 @@ const ( ETHERTYPE_DN = 0x6003 ETHERTYPE_DOGFIGHT = 0x1989 ETHERTYPE_DSMD = 0x8039 + ETHERTYPE_EAPOL = 0x888e ETHERTYPE_ECMA = 0x803 ETHERTYPE_ENCRYPT = 0x803d ETHERTYPE_ES = 0x805d @@ -298,6 +394,7 @@ const ( ETHERTYPE_LLDP = 0x88cc ETHERTYPE_LOGICRAFT = 0x8148 ETHERTYPE_LOOPBACK = 0x9000 + ETHERTYPE_MACSEC = 0x88e5 ETHERTYPE_MATRA = 0x807a ETHERTYPE_MAX = 0xffff ETHERTYPE_MERIT = 0x807c @@ -326,15 +423,17 @@ const ( ETHERTYPE_NCD = 0x8149 ETHERTYPE_NESTAR = 0x8006 ETHERTYPE_NETBEUI = 0x8191 + ETHERTYPE_NHRP = 0x2001 ETHERTYPE_NOVELL = 0x8138 ETHERTYPE_NS = 0x600 ETHERTYPE_NSAT = 0x601 ETHERTYPE_NSCOMPAT = 0x807 + ETHERTYPE_NSH = 0x984f ETHERTYPE_NTRAILER = 0x10 ETHERTYPE_OS9 = 0x7007 ETHERTYPE_OS9NET = 0x7009 ETHERTYPE_PACER = 0x80c6 - ETHERTYPE_PAE = 0x888e + ETHERTYPE_PBB = 0x88e7 ETHERTYPE_PCS = 0x4242 ETHERTYPE_PLANNING = 0x8044 ETHERTYPE_PPP = 0x880b @@ -409,28 +508,40 @@ const ( ETHER_CRC_POLY_LE = 0xedb88320 ETHER_HDR_LEN = 0xe ETHER_MAX_DIX_LEN = 0x600 + ETHER_MAX_HARDMTU_LEN = 0xff9b ETHER_MAX_LEN = 0x5ee ETHER_MIN_LEN = 0x40 ETHER_TYPE_LEN = 0x2 ETHER_VLAN_ENCAP_LEN = 0x4 EVFILT_AIO = -0x3 + EVFILT_DEVICE = -0x8 + EVFILT_EXCEPT = -0x9 EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 - EVFILT_SYSCOUNT = 0x7 + EVFILT_SYSCOUNT = 0x9 EVFILT_TIMER = -0x7 EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 + EVL_ENCAPLEN = 0x4 + EVL_PRIO_BITS = 0xd + EVL_PRIO_MAX = 0x7 + EVL_VLID_MASK = 0xfff + EVL_VLID_MAX = 0xffe + EVL_VLID_MIN = 0x1 + EVL_VLID_NULL = 0x0 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 + EV_DISPATCH = 0x80 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 - EV_SYSFLAGS = 0xf000 + EV_RECEIPT = 0x40 + EV_SYSFLAGS = 0xf800 EXTA = 0x4b00 EXTB = 0x9600 EXTPROC = 0x800 @@ -443,6 +554,8 @@ const ( F_GETFL = 0x3 F_GETLK = 0x7 F_GETOWN = 0x5 + F_ISATTY = 0xb + F_OK = 0x0 F_RDLCK = 0x1 F_SETFD = 0x2 F_SETFL = 0x4 @@ -459,7 +572,6 @@ const ( IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 - IFA_ROUTE = 0x1 IFF_ALLMULTI = 0x200 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x8e52 @@ -470,12 +582,12 @@ const ( IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 - IFF_NOTRAILERS = 0x20 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 + IFF_STATICARP = 0x20 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 @@ -604,6 +716,7 @@ const ( IFT_LINEGROUP = 0xd2 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 + IFT_MBIM = 0xfa IFT_MEDIAMAILOVERIP = 0x8b IFT_MFSIGLINK = 0xa7 IFT_MIOX25 = 0x26 @@ -694,6 +807,7 @@ const ( IFT_VOICEOVERCABLE = 0xc6 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 + IFT_WIREGUARD = 0xfb IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 @@ -728,8 +842,6 @@ const ( IPPROTO_AH = 0x33 IPPROTO_CARP = 0x70 IPPROTO_DIVERT = 0x102 - IPPROTO_DIVERT_INIT = 0x2 - IPPROTO_DIVERT_RESP = 0x1 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 @@ -761,9 +873,11 @@ const ( IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e + IPPROTO_SCTP = 0x84 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 + IPPROTO_UDPLITE = 0x88 IPV6_AUTH_LEVEL = 0x35 IPV6_AUTOFLOWLABEL = 0x3b IPV6_CHECKSUM = 0x1a @@ -786,6 +900,7 @@ const ( IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXPACKET = 0xffff + IPV6_MINHOPCOUNT = 0x41 IPV6_MMTU = 0x500 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 @@ -825,12 +940,12 @@ const ( IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 - IP_DIVERTFL = 0x1022 IP_DROP_MEMBERSHIP = 0xd IP_ESP_NETWORK_LEVEL = 0x16 IP_ESP_TRANS_LEVEL = 0x15 IP_HDRINCL = 0x2 IP_IPCOMP_LEVEL = 0x1d + IP_IPDEFTTL = 0x25 IP_IPSECFLOWINFO = 0x24 IP_IPSEC_LOCAL_AUTH = 0x1b IP_IPSEC_LOCAL_CRED = 0x19 @@ -864,10 +979,15 @@ const ( IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RTABLE = 0x1021 + IP_SENDSRCADDR = 0x7 IP_TOS = 0x3 IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 + ITIMER_PROF = 0x2 + ITIMER_REAL = 0x0 + ITIMER_VIRTUAL = 0x1 + IUCLC = 0x1000 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 @@ -922,6 +1042,7 @@ const ( MNT_NOATIME = 0x8000 MNT_NODEV = 0x10 MNT_NOEXEC = 0x4 + MNT_NOPERM = 0x20 MNT_NOSUID = 0x8 MNT_NOWAIT = 0x2 MNT_QUOTA = 0x2000 @@ -929,12 +1050,27 @@ const ( MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SOFTDEP = 0x4000000 + MNT_STALLED = 0x100000 + MNT_SWAPPABLE = 0x200000 MNT_SYNCHRONOUS = 0x2 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0x400ffff MNT_WAIT = 0x1 MNT_WANTRDWR = 0x2000000 MNT_WXALLOWED = 0x800 + MOUNT_AFS = "afs" + MOUNT_CD9660 = "cd9660" + MOUNT_EXT2FS = "ext2fs" + MOUNT_FFS = "ffs" + MOUNT_FUSEFS = "fuse" + MOUNT_MFS = "mfs" + MOUNT_MSDOS = "msdos" + MOUNT_NCPFS = "ncpfs" + MOUNT_NFS = "nfs" + MOUNT_NTFS = "ntfs" + MOUNT_TMPFS = "tmpfs" + MOUNT_UDF = "udf" + MOUNT_UFS = "ffs" MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CTRUNC = 0x20 @@ -947,6 +1083,7 @@ const ( MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 + MSG_WAITFORONE = 0x1000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x4 MS_SYNC = 0x2 @@ -954,12 +1091,16 @@ const ( NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 - NET_RT_MAXID = 0x6 + NET_RT_IFNAMES = 0x6 + NET_RT_MAXID = 0x8 + NET_RT_SOURCE = 0x7 NET_RT_STATS = 0x4 NET_RT_TABLE = 0x5 NFDBITS = 0x20 NOFLSH = 0x80000000 + NOKERNINFO = 0x2000000 NOTE_ATTRIB = 0x8 + NOTE_CHANGE = 0x1 NOTE_CHILD = 0x4 NOTE_DELETE = 0x1 NOTE_EOF = 0x2 @@ -969,6 +1110,7 @@ const ( NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 + NOTE_OOB = 0x4 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 @@ -978,11 +1120,13 @@ const ( NOTE_TRUNCATE = 0x80 NOTE_WRITE = 0x2 OCRNL = 0x10 + OLCUC = 0x20 ONLCR = 0x2 ONLRET = 0x80 ONOCR = 0x40 ONOEOT = 0x8 OPOST = 0x1 + OXTABS = 0x4 O_ACCMODE = 0x3 O_APPEND = 0x8 O_ASYNC = 0x40 @@ -1027,19 +1171,25 @@ const ( RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 + RTAX_BFD = 0xb RTAX_BRD = 0x7 + RTAX_DNS = 0xc RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_LABEL = 0xa - RTAX_MAX = 0xb + RTAX_MAX = 0xf RTAX_NETMASK = 0x2 + RTAX_SEARCH = 0xe RTAX_SRC = 0x8 RTAX_SRCMASK = 0x9 + RTAX_STATIC = 0xd RTA_AUTHOR = 0x40 + RTA_BFD = 0x800 RTA_BRD = 0x80 + RTA_DNS = 0x1000 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 @@ -1047,24 +1197,29 @@ const ( RTA_IFP = 0x10 RTA_LABEL = 0x400 RTA_NETMASK = 0x4 + RTA_SEARCH = 0x4000 RTA_SRC = 0x100 RTA_SRCMASK = 0x200 + RTA_STATIC = 0x2000 RTF_ANNOUNCE = 0x4000 + RTF_BFD = 0x1000000 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 + RTF_CACHED = 0x20000 RTF_CLONED = 0x10000 RTF_CLONING = 0x100 + RTF_CONNECTED = 0x800000 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 - RTF_FMASK = 0x70f808 + RTF_FMASK = 0x110fc08 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 - RTF_MASK = 0x80 RTF_MODIFIED = 0x20 RTF_MPATH = 0x40000 RTF_MPLS = 0x100000 + RTF_MULTICAST = 0x200 RTF_PERMANENT_ARP = 0x2000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 @@ -1073,23 +1228,26 @@ const ( RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_USETRAILERS = 0x8000 - RTF_XRESOLVE = 0x200 + RTM_80211INFO = 0x15 RTM_ADD = 0x1 + RTM_BFD = 0x12 RTM_CHANGE = 0x3 + RTM_CHGADDRATTR = 0x14 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DESYNC = 0x10 RTM_GET = 0x4 RTM_IFANNOUNCE = 0xf RTM_IFINFO = 0xe - RTM_LOCK = 0x8 + RTM_INVALIDATE = 0x11 RTM_LOSING = 0x5 RTM_MAXSIZE = 0x800 RTM_MISS = 0x7 RTM_NEWADDR = 0xc + RTM_PROPOSAL = 0x13 RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb - RTM_RTTUNIT = 0xf4240 + RTM_SOURCE = 0x16 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 @@ -1099,67 +1257,74 @@ const ( RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 + RT_TABLEID_BITS = 0x8 + RT_TABLEID_MASK = 0xff RT_TABLEID_MAX = 0xff RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x4 + SEEK_CUR = 0x1 + SEEK_END = 0x2 + SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCAIFGROUP = 0x80246987 - SIOCALIFADDR = 0x8218691c SIOCATMARK = 0x40047307 - SIOCBRDGADD = 0x8054693c - SIOCBRDGADDS = 0x80546941 - SIOCBRDGARL = 0x806e694d + SIOCBRDGADD = 0x8060693c + SIOCBRDGADDL = 0x80606949 + SIOCBRDGADDS = 0x80606941 + SIOCBRDGARL = 0x808c694d SIOCBRDGDADDR = 0x81286947 - SIOCBRDGDEL = 0x8054693d - SIOCBRDGDELS = 0x80546942 - SIOCBRDGFLUSH = 0x80546948 - SIOCBRDGFRL = 0x806e694e + SIOCBRDGDEL = 0x8060693d + SIOCBRDGDELS = 0x80606942 + SIOCBRDGFLUSH = 0x80606948 + SIOCBRDGFRL = 0x808c694e SIOCBRDGGCACHE = 0xc0146941 SIOCBRDGGFD = 0xc0146952 SIOCBRDGGHT = 0xc0146951 - SIOCBRDGGIFFLGS = 0xc054693e + SIOCBRDGGIFFLGS = 0xc060693e SIOCBRDGGMA = 0xc0146953 - SIOCBRDGGPARAM = 0xc03c6958 + SIOCBRDGGPARAM = 0xc0406958 SIOCBRDGGPRI = 0xc0146950 SIOCBRDGGRL = 0xc028694f - SIOCBRDGGSIFS = 0xc054693c SIOCBRDGGTO = 0xc0146946 - SIOCBRDGIFS = 0xc0546942 + SIOCBRDGIFS = 0xc0606942 SIOCBRDGRTS = 0xc0186943 SIOCBRDGSADDR = 0xc1286944 SIOCBRDGSCACHE = 0x80146940 SIOCBRDGSFD = 0x80146952 SIOCBRDGSHT = 0x80146951 - SIOCBRDGSIFCOST = 0x80546955 - SIOCBRDGSIFFLGS = 0x8054693f - SIOCBRDGSIFPRIO = 0x80546954 + SIOCBRDGSIFCOST = 0x80606955 + SIOCBRDGSIFFLGS = 0x8060693f + SIOCBRDGSIFPRIO = 0x80606954 + SIOCBRDGSIFPROT = 0x8060694a SIOCBRDGSMA = 0x80146953 SIOCBRDGSPRI = 0x80146950 SIOCBRDGSPROTO = 0x8014695a SIOCBRDGSTO = 0x80146945 SIOCBRDGSTXHC = 0x80146959 + SIOCDELLABEL = 0x80206997 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80246989 + SIOCDIFPARENT = 0x802069b4 SIOCDIFPHYADDR = 0x80206949 - SIOCDLIFADDR = 0x8218691e + SIOCDPWE3NEIGHBOR = 0x802069de + SIOCDVNETID = 0x802069af SIOCGETKALIVE = 0xc01869a4 SIOCGETLABEL = 0x8020699a + SIOCGETMPWCFG = 0xc02069ae SIOCGETPFLOW = 0xc02069fe SIOCGETPFSYNC = 0xc02069f8 SIOCGETSGCNT = 0xc0147534 SIOCGETVIFCNT = 0xc0147533 SIOCGETVLAN = 0xc0206990 - SIOCGHIWAT = 0x40047301 SIOCGIFADDR = 0xc0206921 - SIOCGIFASYNCMAP = 0xc020697c SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCONF = 0xc0086924 SIOCGIFDATA = 0xc020691b @@ -1168,41 +1333,53 @@ const ( SIOCGIFFLAGS = 0xc0206911 SIOCGIFGATTR = 0xc024698b SIOCGIFGENERIC = 0xc020693a + SIOCGIFGLIST = 0xc024698d SIOCGIFGMEMB = 0xc024698a SIOCGIFGROUP = 0xc0246988 SIOCGIFHARDMTU = 0xc02069a5 - SIOCGIFMEDIA = 0xc0286936 + SIOCGIFLLPRIO = 0xc02069b6 + SIOCGIFMEDIA = 0xc0386938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc020697e SIOCGIFNETMASK = 0xc0206925 - SIOCGIFPDSTADDR = 0xc0206948 + SIOCGIFPAIR = 0xc02069b1 + SIOCGIFPARENT = 0xc02069b3 SIOCGIFPRIORITY = 0xc020699c - SIOCGIFPSRCADDR = 0xc0206947 SIOCGIFRDOMAIN = 0xc02069a0 SIOCGIFRTLABEL = 0xc0206983 SIOCGIFRXR = 0x802069aa - SIOCGIFTIMESLOT = 0xc0206986 + SIOCGIFSFFPAGE = 0xc1126939 SIOCGIFXFLAGS = 0xc020699e - SIOCGLIFADDR = 0xc218691d SIOCGLIFPHYADDR = 0xc218694b + SIOCGLIFPHYDF = 0xc02069c2 + SIOCGLIFPHYECN = 0xc02069c8 SIOCGLIFPHYRTABLE = 0xc02069a2 SIOCGLIFPHYTTL = 0xc02069a9 - SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 + SIOCGPWE3 = 0xc0206998 + SIOCGPWE3CTRLWORD = 0xc02069dc + SIOCGPWE3FAT = 0xc02069dd + SIOCGPWE3NEIGHBOR = 0xc21869de + SIOCGRXHPRIO = 0xc02069db SIOCGSPPPPARAMS = 0xc0206994 + SIOCGTXHPRIO = 0xc02069c6 + SIOCGUMBINFO = 0xc02069be + SIOCGUMBPARAM = 0xc02069c0 SIOCGVH = 0xc02069f6 + SIOCGVNETFLOWID = 0xc02069c4 SIOCGVNETID = 0xc02069a7 + SIOCIFAFATTACH = 0x801169ab + SIOCIFAFDETACH = 0x801169ac SIOCIFCREATE = 0x8020697a SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc00c6978 SIOCSETKALIVE = 0x801869a3 SIOCSETLABEL = 0x80206999 + SIOCSETMPWCFG = 0x802069ad SIOCSETPFLOW = 0x802069fd SIOCSETPFSYNC = 0x802069f7 SIOCSETVLAN = 0x8020698f - SIOCSHIWAT = 0x80047300 SIOCSIFADDR = 0x8020690c - SIOCSIFASYNCMAP = 0x8020697d SIOCSIFBRDADDR = 0x80206913 SIOCSIFDESCR = 0x80206980 SIOCSIFDSTADDR = 0x8020690e @@ -1210,26 +1387,36 @@ const ( SIOCSIFGATTR = 0x8024698c SIOCSIFGENERIC = 0x80206939 SIOCSIFLLADDR = 0x8020691f - SIOCSIFMEDIA = 0xc0206935 + SIOCSIFLLPRIO = 0x802069b5 + SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x8020697f SIOCSIFNETMASK = 0x80206916 - SIOCSIFPHYADDR = 0x80406946 + SIOCSIFPAIR = 0x802069b0 + SIOCSIFPARENT = 0x802069b2 SIOCSIFPRIORITY = 0x8020699b SIOCSIFRDOMAIN = 0x8020699f SIOCSIFRTLABEL = 0x80206982 - SIOCSIFTIMESLOT = 0x80206985 SIOCSIFXFLAGS = 0x8020699d SIOCSLIFPHYADDR = 0x8218694a + SIOCSLIFPHYDF = 0x802069c1 + SIOCSLIFPHYECN = 0x802069c7 SIOCSLIFPHYRTABLE = 0x802069a1 SIOCSLIFPHYTTL = 0x802069a8 - SIOCSLOWAT = 0x80047302 SIOCSPGRP = 0x80047308 + SIOCSPWE3CTRLWORD = 0x802069dc + SIOCSPWE3FAT = 0x802069dd + SIOCSPWE3NEIGHBOR = 0x821869de + SIOCSRXHPRIO = 0x802069db SIOCSSPPPPARAMS = 0x80206993 + SIOCSTXHPRIO = 0x802069c5 + SIOCSUMBPARAM = 0x802069bf SIOCSVH = 0xc02069f5 + SIOCSVNETFLOWID = 0x802069c3 SIOCSVNETID = 0x802069a6 SOCK_CLOEXEC = 0x8000 SOCK_DGRAM = 0x2 + SOCK_DNS = 0x1000 SOCK_NONBLOCK = 0x4000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 @@ -1241,6 +1428,7 @@ const ( SO_BINDANY = 0x1000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 + SO_DOMAIN = 0x1024 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 @@ -1248,6 +1436,7 @@ const ( SO_NETPROC = 0x1020 SO_OOBINLINE = 0x100 SO_PEERCRED = 0x1022 + SO_PROTOCOL = 0x1025 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 @@ -1261,6 +1450,7 @@ const ( SO_TIMESTAMP = 0x800 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 + SO_ZEROIZE = 0x2000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 @@ -1290,9 +1480,24 @@ const ( S_IXOTH = 0x1 S_IXUSR = 0x40 TCIFLUSH = 0x1 + TCIOFF = 0x3 TCIOFLUSH = 0x3 + TCION = 0x4 TCOFLUSH = 0x2 - TCP_MAXBURST = 0x4 + TCOOFF = 0x1 + TCOON = 0x2 + TCPOPT_EOL = 0x0 + TCPOPT_MAXSEG = 0x2 + TCPOPT_NOP = 0x1 + TCPOPT_SACK = 0x5 + TCPOPT_SACK_HDR = 0x1010500 + TCPOPT_SACK_PERMITTED = 0x4 + TCPOPT_SACK_PERMIT_HDR = 0x1010402 + TCPOPT_SIGNATURE = 0x13 + TCPOPT_TIMESTAMP = 0x8 + TCPOPT_TSTAMP_HDR = 0x101080a + TCPOPT_WINDOW = 0x3 + TCP_INFO = 0x9 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x3 @@ -1301,11 +1506,15 @@ const ( TCP_MSS = 0x200 TCP_NODELAY = 0x1 TCP_NOPUSH = 0x10 - TCP_NSTATES = 0xb + TCP_SACKHOLE_LIMIT = 0x80 TCP_SACK_ENABLE = 0x8 TCSAFLUSH = 0x2 + TIMER_ABSTIME = 0x1 + TIMER_RELTIME = 0x0 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 + TIOCCHKVERAUTH = 0x2000741e + TIOCCLRVERAUTH = 0x2000741d TIOCCONS = 0x80047462 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d @@ -1321,7 +1530,7 @@ const ( TIOCGFLAGS = 0x4004745d TIOCGPGRP = 0x40047477 TIOCGSID = 0x40047463 - TIOCGTSTAMP = 0x400c745b + TIOCGTSTAMP = 0x4010745b TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c @@ -1360,17 +1569,21 @@ const ( TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b + TIOCSETVERAUTH = 0x8004741c TIOCSFLAGS = 0x8004745c TIOCSIG = 0x8004745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e - TIOCSTAT = 0x80047465 - TIOCSTI = 0x80017472 + TIOCSTAT = 0x20007465 TIOCSTOP = 0x2000746f TIOCSTSTAMP = 0x8008745a TIOCSWINSZ = 0x80087467 TIOCUCNTL = 0x80047466 + TIOCUCNTL_CBRK = 0x7a + TIOCUCNTL_SBRK = 0x7b TOSTOP = 0x400000 + UTIME_NOW = -0x2 + UTIME_OMIT = -0x1 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 @@ -1381,6 +1594,19 @@ const ( VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 + VM_ANONMIN = 0x7 + VM_LOADAVG = 0x2 + VM_MALLOC_CONF = 0xc + VM_MAXID = 0xd + VM_MAXSLP = 0xa + VM_METER = 0x1 + VM_NKMEMPAGES = 0x6 + VM_PSSTRINGS = 0x3 + VM_SWAPENCRYPT = 0x5 + VM_USPACE = 0xb + VM_UVMEXP = 0x4 + VM_VNODEMIN = 0x9 + VM_VTEXTMIN = 0x8 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc @@ -1394,6 +1620,7 @@ const ( WCOREFLAG = 0x80 WNOHANG = 0x1 WUNTRACED = 0x2 + XCASE = 0x1000000 ) // Errors @@ -1407,6 +1634,7 @@ const ( EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) + EBADMSG = syscall.Errno(0x5c) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x58) @@ -1433,7 +1661,7 @@ const ( EIPSEC = syscall.Errno(0x52) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) - ELAST = syscall.Errno(0x5b) + ELAST = syscall.Errno(0x5f) ELOOP = syscall.Errno(0x3e) EMEDIUMTYPE = syscall.Errno(0x56) EMFILE = syscall.Errno(0x18) @@ -1461,12 +1689,14 @@ const ( ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) + ENOTRECOVERABLE = syscall.Errno(0x5d) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x5b) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x57) + EOWNERDEAD = syscall.Errno(0x5e) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) @@ -1474,6 +1704,7 @@ const ( EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) + EPROTO = syscall.Errno(0x5f) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) @@ -1570,7 +1801,7 @@ var errorList = [...]struct { {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, - {35, "EWOULDBLOCK", "resource temporarily unavailable"}, + {35, "EAGAIN", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, @@ -1626,7 +1857,11 @@ var errorList = [...]struct { {88, "ECANCELED", "operation canceled"}, {89, "EIDRM", "identifier removed"}, {90, "ENOMSG", "no message of desired type"}, - {91, "ELAST", "not supported"}, + {91, "ENOTSUP", "not supported"}, + {92, "EBADMSG", "bad message"}, + {93, "ENOTRECOVERABLE", "state not recoverable"}, + {94, "EOWNERDEAD", "previous owner died"}, + {95, "ELAST", "protocol error"}, } // Signal table @@ -1640,7 +1875,7 @@ var signalList = [...]struct { {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, - {6, "SIGABRT", "abort trap"}, + {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, @@ -1667,4 +1902,5 @@ var signalList = [...]struct { {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "thread AST"}, + {28672, "SIGSTKSZ", "unknown signal"}, } diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go index 90de7dfc33a..ae16fe7542a 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go @@ -112,6 +112,12 @@ const ( BPF_FILDROP_CAPTURE = 0x1 BPF_FILDROP_DROP = 0x2 BPF_FILDROP_PASS = 0x0 + BPF_F_DIR_IN = 0x10 + BPF_F_DIR_MASK = 0x30 + BPF_F_DIR_OUT = 0x20 + BPF_F_DIR_SHIFT = 0x4 + BPF_F_FLOWID = 0x8 + BPF_F_PRI_MASK = 0x7 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 @@ -140,6 +146,7 @@ const ( BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 + BPF_RND = 0xc0 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 @@ -180,7 +187,65 @@ const ( CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 + DIOCADDQUEUE = 0xc110445d + DIOCADDRULE = 0xcd604404 + DIOCADDSTATE = 0xc1084425 + DIOCCHANGERULE = 0xcd60441a + DIOCCLRIFFLAG = 0xc028445a + DIOCCLRSRCNODES = 0x20004455 + DIOCCLRSTATES = 0xc0e04412 + DIOCCLRSTATUS = 0xc0284416 + DIOCGETLIMIT = 0xc0084427 + DIOCGETQSTATS = 0xc1204460 + DIOCGETQUEUE = 0xc110445f + DIOCGETQUEUES = 0xc110445e + DIOCGETRULE = 0xcd604407 + DIOCGETRULES = 0xcd604406 + DIOCGETRULESET = 0xc444443b + DIOCGETRULESETS = 0xc444443a + DIOCGETSRCNODES = 0xc0104454 + DIOCGETSTATE = 0xc1084413 + DIOCGETSTATES = 0xc0104419 + DIOCGETSTATUS = 0xc1e84415 + DIOCGETSYNFLWATS = 0xc0084463 + DIOCGETTIMEOUT = 0xc008441e + DIOCIGETIFACES = 0xc0284457 + DIOCKILLSRCNODES = 0xc080445b + DIOCKILLSTATES = 0xc0e04429 + DIOCNATLOOK = 0xc0504417 + DIOCOSFPADD = 0xc088444f DIOCOSFPFLUSH = 0x2000444e + DIOCOSFPGET = 0xc0884450 + DIOCRADDADDRS = 0xc4504443 + DIOCRADDTABLES = 0xc450443d + DIOCRCLRADDRS = 0xc4504442 + DIOCRCLRASTATS = 0xc4504448 + DIOCRCLRTABLES = 0xc450443c + DIOCRCLRTSTATS = 0xc4504441 + DIOCRDELADDRS = 0xc4504444 + DIOCRDELTABLES = 0xc450443e + DIOCRGETADDRS = 0xc4504446 + DIOCRGETASTATS = 0xc4504447 + DIOCRGETTABLES = 0xc450443f + DIOCRGETTSTATS = 0xc4504440 + DIOCRINADEFINE = 0xc450444d + DIOCRSETADDRS = 0xc4504445 + DIOCRSETTFLAGS = 0xc450444a + DIOCRTSTADDRS = 0xc4504449 + DIOCSETDEBUG = 0xc0044418 + DIOCSETHOSTID = 0xc0044456 + DIOCSETIFFLAG = 0xc0284459 + DIOCSETLIMIT = 0xc0084428 + DIOCSETREASS = 0xc004445c + DIOCSETSTATUSIF = 0xc0284414 + DIOCSETSYNCOOKIES = 0xc0014462 + DIOCSETSYNFLWATS = 0xc0084461 + DIOCSETTIMEOUT = 0xc008441d + DIOCSTART = 0x20004401 + DIOCSTOP = 0x20004402 + DIOCXBEGIN = 0xc0104451 + DIOCXCOMMIT = 0xc0104452 + DIOCXROLLBACK = 0xc0104453 DLT_ARCNET = 0x7 DLT_ATM_RFC1483 = 0xb DLT_AX25 = 0x3 @@ -243,6 +308,8 @@ const ( EMUL_ENABLED = 0x1 EMUL_NATIVE = 0x2 ENDRUNDISC = 0x9 + ETH64_8021_RSVD_MASK = 0xfffffffffff0 + ETH64_8021_RSVD_PREFIX = 0x180c2000000 ETHERMIN = 0x2e ETHERMTU = 0x5dc ETHERTYPE_8023 = 0x4 @@ -295,6 +362,7 @@ const ( ETHERTYPE_DN = 0x6003 ETHERTYPE_DOGFIGHT = 0x1989 ETHERTYPE_DSMD = 0x8039 + ETHERTYPE_EAPOL = 0x888e ETHERTYPE_ECMA = 0x803 ETHERTYPE_ENCRYPT = 0x803d ETHERTYPE_ES = 0x805d @@ -326,6 +394,7 @@ const ( ETHERTYPE_LLDP = 0x88cc ETHERTYPE_LOGICRAFT = 0x8148 ETHERTYPE_LOOPBACK = 0x9000 + ETHERTYPE_MACSEC = 0x88e5 ETHERTYPE_MATRA = 0x807a ETHERTYPE_MAX = 0xffff ETHERTYPE_MERIT = 0x807c @@ -354,15 +423,16 @@ const ( ETHERTYPE_NCD = 0x8149 ETHERTYPE_NESTAR = 0x8006 ETHERTYPE_NETBEUI = 0x8191 + ETHERTYPE_NHRP = 0x2001 ETHERTYPE_NOVELL = 0x8138 ETHERTYPE_NS = 0x600 ETHERTYPE_NSAT = 0x601 ETHERTYPE_NSCOMPAT = 0x807 + ETHERTYPE_NSH = 0x984f ETHERTYPE_NTRAILER = 0x10 ETHERTYPE_OS9 = 0x7007 ETHERTYPE_OS9NET = 0x7009 ETHERTYPE_PACER = 0x80c6 - ETHERTYPE_PAE = 0x888e ETHERTYPE_PBB = 0x88e7 ETHERTYPE_PCS = 0x4242 ETHERTYPE_PLANNING = 0x8044 @@ -445,10 +515,11 @@ const ( ETHER_VLAN_ENCAP_LEN = 0x4 EVFILT_AIO = -0x3 EVFILT_DEVICE = -0x8 + EVFILT_EXCEPT = -0x9 EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 - EVFILT_SYSCOUNT = 0x8 + EVFILT_SYSCOUNT = 0x9 EVFILT_TIMER = -0x7 EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 @@ -470,7 +541,7 @@ const ( EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 - EV_SYSFLAGS = 0xf000 + EV_SYSFLAGS = 0xf800 EXTA = 0x4b00 EXTB = 0x9600 EXTPROC = 0x800 @@ -736,6 +807,7 @@ const ( IFT_VOICEOVERCABLE = 0xc6 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 + IFT_WIREGUARD = 0xfb IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 @@ -801,9 +873,11 @@ const ( IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e + IPPROTO_SCTP = 0x84 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 + IPPROTO_UDPLITE = 0x88 IPV6_AUTH_LEVEL = 0x35 IPV6_AUTOFLOWLABEL = 0x3b IPV6_CHECKSUM = 0x1a @@ -910,6 +984,9 @@ const ( IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 + ITIMER_PROF = 0x2 + ITIMER_REAL = 0x0 + ITIMER_VIRTUAL = 0x1 IUCLC = 0x1000 IXANY = 0x800 IXOFF = 0x400 @@ -981,6 +1058,19 @@ const ( MNT_WAIT = 0x1 MNT_WANTRDWR = 0x2000000 MNT_WXALLOWED = 0x800 + MOUNT_AFS = "afs" + MOUNT_CD9660 = "cd9660" + MOUNT_EXT2FS = "ext2fs" + MOUNT_FFS = "ffs" + MOUNT_FUSEFS = "fuse" + MOUNT_MFS = "mfs" + MOUNT_MSDOS = "msdos" + MOUNT_NCPFS = "ncpfs" + MOUNT_NFS = "nfs" + MOUNT_NTFS = "ntfs" + MOUNT_TMPFS = "tmpfs" + MOUNT_UDF = "udf" + MOUNT_UFS = "ffs" MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CTRUNC = 0x20 @@ -993,6 +1083,7 @@ const ( MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 + MSG_WAITFORONE = 0x1000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x4 MS_SYNC = 0x2 @@ -1001,7 +1092,8 @@ const ( NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFNAMES = 0x6 - NET_RT_MAXID = 0x7 + NET_RT_MAXID = 0x8 + NET_RT_SOURCE = 0x7 NET_RT_STATS = 0x4 NET_RT_TABLE = 0x5 NFDBITS = 0x20 @@ -1018,6 +1110,7 @@ const ( NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 + NOTE_OOB = 0x4 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 @@ -1154,7 +1247,7 @@ const ( RTM_PROPOSAL = 0x13 RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb - RTM_RTTUNIT = 0xf4240 + RTM_SOURCE = 0x16 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 @@ -1172,6 +1265,9 @@ const ( RUSAGE_THREAD = 0x1 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x4 + SEEK_CUR = 0x1 + SEEK_END = 0x2 + SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 @@ -1188,30 +1284,30 @@ const ( SIOCBRDGDELS = 0x80606942 SIOCBRDGFLUSH = 0x80606948 SIOCBRDGFRL = 0x808c694e - SIOCBRDGGCACHE = 0xc0186941 - SIOCBRDGGFD = 0xc0186952 - SIOCBRDGGHT = 0xc0186951 + SIOCBRDGGCACHE = 0xc0146941 + SIOCBRDGGFD = 0xc0146952 + SIOCBRDGGHT = 0xc0146951 SIOCBRDGGIFFLGS = 0xc060693e - SIOCBRDGGMA = 0xc0186953 + SIOCBRDGGMA = 0xc0146953 SIOCBRDGGPARAM = 0xc0406958 - SIOCBRDGGPRI = 0xc0186950 + SIOCBRDGGPRI = 0xc0146950 SIOCBRDGGRL = 0xc030694f - SIOCBRDGGTO = 0xc0186946 + SIOCBRDGGTO = 0xc0146946 SIOCBRDGIFS = 0xc0606942 SIOCBRDGRTS = 0xc0206943 SIOCBRDGSADDR = 0xc1286944 - SIOCBRDGSCACHE = 0x80186940 - SIOCBRDGSFD = 0x80186952 - SIOCBRDGSHT = 0x80186951 + SIOCBRDGSCACHE = 0x80146940 + SIOCBRDGSFD = 0x80146952 + SIOCBRDGSHT = 0x80146951 SIOCBRDGSIFCOST = 0x80606955 SIOCBRDGSIFFLGS = 0x8060693f SIOCBRDGSIFPRIO = 0x80606954 SIOCBRDGSIFPROT = 0x8060694a - SIOCBRDGSMA = 0x80186953 - SIOCBRDGSPRI = 0x80186950 - SIOCBRDGSPROTO = 0x8018695a - SIOCBRDGSTO = 0x80186945 - SIOCBRDGSTXHC = 0x80186959 + SIOCBRDGSMA = 0x80146953 + SIOCBRDGSPRI = 0x80146950 + SIOCBRDGSPROTO = 0x8014695a + SIOCBRDGSTO = 0x80146945 + SIOCBRDGSTXHC = 0x80146959 SIOCDELLABEL = 0x80206997 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 @@ -1264,6 +1360,7 @@ const ( SIOCGPWE3CTRLWORD = 0xc02069dc SIOCGPWE3FAT = 0xc02069dd SIOCGPWE3NEIGHBOR = 0xc21869de + SIOCGRXHPRIO = 0xc02069db SIOCGSPPPPARAMS = 0xc0206994 SIOCGTXHPRIO = 0xc02069c6 SIOCGUMBINFO = 0xc02069be @@ -1310,17 +1407,13 @@ const ( SIOCSPWE3CTRLWORD = 0x802069dc SIOCSPWE3FAT = 0x802069dd SIOCSPWE3NEIGHBOR = 0x821869de + SIOCSRXHPRIO = 0x802069db SIOCSSPPPPARAMS = 0x80206993 SIOCSTXHPRIO = 0x802069c5 SIOCSUMBPARAM = 0x802069bf SIOCSVH = 0xc02069f5 SIOCSVNETFLOWID = 0x802069c3 SIOCSVNETID = 0x802069a6 - SIOCSWGDPID = 0xc018695b - SIOCSWGMAXFLOW = 0xc0186960 - SIOCSWGMAXGROUP = 0xc018695d - SIOCSWSDPID = 0x8018695c - SIOCSWSPORTNO = 0xc060695f SOCK_CLOEXEC = 0x8000 SOCK_DGRAM = 0x2 SOCK_DNS = 0x1000 @@ -1335,6 +1428,7 @@ const ( SO_BINDANY = 0x1000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 + SO_DOMAIN = 0x1024 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 @@ -1342,6 +1436,7 @@ const ( SO_NETPROC = 0x1020 SO_OOBINLINE = 0x100 SO_PEERCRED = 0x1022 + SO_PROTOCOL = 0x1025 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 @@ -1391,7 +1486,18 @@ const ( TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 - TCP_MAXBURST = 0x4 + TCPOPT_EOL = 0x0 + TCPOPT_MAXSEG = 0x2 + TCPOPT_NOP = 0x1 + TCPOPT_SACK = 0x5 + TCPOPT_SACK_HDR = 0x1010500 + TCPOPT_SACK_PERMITTED = 0x4 + TCPOPT_SACK_PERMIT_HDR = 0x1010402 + TCPOPT_SIGNATURE = 0x13 + TCPOPT_TIMESTAMP = 0x8 + TCPOPT_TSTAMP_HDR = 0x101080a + TCPOPT_WINDOW = 0x3 + TCP_INFO = 0x9 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x3 @@ -1400,6 +1506,7 @@ const ( TCP_MSS = 0x200 TCP_NODELAY = 0x1 TCP_NOPUSH = 0x10 + TCP_SACKHOLE_LIMIT = 0x80 TCP_SACK_ENABLE = 0x8 TCSAFLUSH = 0x2 TIMER_ABSTIME = 0x1 @@ -1768,7 +1875,7 @@ var signalList = [...]struct { {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, - {6, "SIGABRT", "abort trap"}, + {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, @@ -1795,4 +1902,5 @@ var signalList = [...]struct { {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "thread AST"}, + {28672, "SIGSTKSZ", "unknown signal"}, } diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go index f1154ff56f6..03d90fe3550 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go @@ -112,6 +112,12 @@ const ( BPF_FILDROP_CAPTURE = 0x1 BPF_FILDROP_DROP = 0x2 BPF_FILDROP_PASS = 0x0 + BPF_F_DIR_IN = 0x10 + BPF_F_DIR_MASK = 0x30 + BPF_F_DIR_OUT = 0x20 + BPF_F_DIR_SHIFT = 0x4 + BPF_F_FLOWID = 0x8 + BPF_F_PRI_MASK = 0x7 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 @@ -140,6 +146,7 @@ const ( BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 + BPF_RND = 0xc0 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 @@ -301,6 +308,8 @@ const ( EMUL_ENABLED = 0x1 EMUL_NATIVE = 0x2 ENDRUNDISC = 0x9 + ETH64_8021_RSVD_MASK = 0xfffffffffff0 + ETH64_8021_RSVD_PREFIX = 0x180c2000000 ETHERMIN = 0x2e ETHERMTU = 0x5dc ETHERTYPE_8023 = 0x4 @@ -353,6 +362,7 @@ const ( ETHERTYPE_DN = 0x6003 ETHERTYPE_DOGFIGHT = 0x1989 ETHERTYPE_DSMD = 0x8039 + ETHERTYPE_EAPOL = 0x888e ETHERTYPE_ECMA = 0x803 ETHERTYPE_ENCRYPT = 0x803d ETHERTYPE_ES = 0x805d @@ -413,15 +423,16 @@ const ( ETHERTYPE_NCD = 0x8149 ETHERTYPE_NESTAR = 0x8006 ETHERTYPE_NETBEUI = 0x8191 + ETHERTYPE_NHRP = 0x2001 ETHERTYPE_NOVELL = 0x8138 ETHERTYPE_NS = 0x600 ETHERTYPE_NSAT = 0x601 ETHERTYPE_NSCOMPAT = 0x807 + ETHERTYPE_NSH = 0x984f ETHERTYPE_NTRAILER = 0x10 ETHERTYPE_OS9 = 0x7007 ETHERTYPE_OS9NET = 0x7009 ETHERTYPE_PACER = 0x80c6 - ETHERTYPE_PAE = 0x888e ETHERTYPE_PBB = 0x88e7 ETHERTYPE_PCS = 0x4242 ETHERTYPE_PLANNING = 0x8044 @@ -504,10 +515,11 @@ const ( ETHER_VLAN_ENCAP_LEN = 0x4 EVFILT_AIO = -0x3 EVFILT_DEVICE = -0x8 + EVFILT_EXCEPT = -0x9 EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 - EVFILT_SYSCOUNT = 0x8 + EVFILT_SYSCOUNT = 0x9 EVFILT_TIMER = -0x7 EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 @@ -529,7 +541,7 @@ const ( EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 - EV_SYSFLAGS = 0xf000 + EV_SYSFLAGS = 0xf800 EXTA = 0x4b00 EXTB = 0x9600 EXTPROC = 0x800 @@ -795,6 +807,7 @@ const ( IFT_VOICEOVERCABLE = 0xc6 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 + IFT_WIREGUARD = 0xfb IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 @@ -860,6 +873,7 @@ const ( IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e + IPPROTO_SCTP = 0x84 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 @@ -970,6 +984,9 @@ const ( IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 + ITIMER_PROF = 0x2 + ITIMER_REAL = 0x0 + ITIMER_VIRTUAL = 0x1 IUCLC = 0x1000 IXANY = 0x800 IXOFF = 0x400 @@ -1041,6 +1058,19 @@ const ( MNT_WAIT = 0x1 MNT_WANTRDWR = 0x2000000 MNT_WXALLOWED = 0x800 + MOUNT_AFS = "afs" + MOUNT_CD9660 = "cd9660" + MOUNT_EXT2FS = "ext2fs" + MOUNT_FFS = "ffs" + MOUNT_FUSEFS = "fuse" + MOUNT_MFS = "mfs" + MOUNT_MSDOS = "msdos" + MOUNT_NCPFS = "ncpfs" + MOUNT_NFS = "nfs" + MOUNT_NTFS = "ntfs" + MOUNT_TMPFS = "tmpfs" + MOUNT_UDF = "udf" + MOUNT_UFS = "ffs" MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CTRUNC = 0x20 @@ -1053,6 +1083,7 @@ const ( MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 + MSG_WAITFORONE = 0x1000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x4 MS_SYNC = 0x2 @@ -1061,7 +1092,8 @@ const ( NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFNAMES = 0x6 - NET_RT_MAXID = 0x7 + NET_RT_MAXID = 0x8 + NET_RT_SOURCE = 0x7 NET_RT_STATS = 0x4 NET_RT_TABLE = 0x5 NFDBITS = 0x20 @@ -1078,6 +1110,7 @@ const ( NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 + NOTE_OOB = 0x4 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 @@ -1214,7 +1247,7 @@ const ( RTM_PROPOSAL = 0x13 RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb - RTM_RTTUNIT = 0xf4240 + RTM_SOURCE = 0x16 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 @@ -1232,6 +1265,9 @@ const ( RUSAGE_THREAD = 0x1 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x4 + SEEK_CUR = 0x1 + SEEK_END = 0x2 + SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 @@ -1248,30 +1284,30 @@ const ( SIOCBRDGDELS = 0x80606942 SIOCBRDGFLUSH = 0x80606948 SIOCBRDGFRL = 0x808c694e - SIOCBRDGGCACHE = 0xc0186941 - SIOCBRDGGFD = 0xc0186952 - SIOCBRDGGHT = 0xc0186951 + SIOCBRDGGCACHE = 0xc0146941 + SIOCBRDGGFD = 0xc0146952 + SIOCBRDGGHT = 0xc0146951 SIOCBRDGGIFFLGS = 0xc060693e - SIOCBRDGGMA = 0xc0186953 + SIOCBRDGGMA = 0xc0146953 SIOCBRDGGPARAM = 0xc0406958 - SIOCBRDGGPRI = 0xc0186950 + SIOCBRDGGPRI = 0xc0146950 SIOCBRDGGRL = 0xc030694f - SIOCBRDGGTO = 0xc0186946 + SIOCBRDGGTO = 0xc0146946 SIOCBRDGIFS = 0xc0606942 SIOCBRDGRTS = 0xc0206943 SIOCBRDGSADDR = 0xc1286944 - SIOCBRDGSCACHE = 0x80186940 - SIOCBRDGSFD = 0x80186952 - SIOCBRDGSHT = 0x80186951 + SIOCBRDGSCACHE = 0x80146940 + SIOCBRDGSFD = 0x80146952 + SIOCBRDGSHT = 0x80146951 SIOCBRDGSIFCOST = 0x80606955 SIOCBRDGSIFFLGS = 0x8060693f SIOCBRDGSIFPRIO = 0x80606954 SIOCBRDGSIFPROT = 0x8060694a - SIOCBRDGSMA = 0x80186953 - SIOCBRDGSPRI = 0x80186950 - SIOCBRDGSPROTO = 0x8018695a - SIOCBRDGSTO = 0x80186945 - SIOCBRDGSTXHC = 0x80186959 + SIOCBRDGSMA = 0x80146953 + SIOCBRDGSPRI = 0x80146950 + SIOCBRDGSPROTO = 0x8014695a + SIOCBRDGSTO = 0x80146945 + SIOCBRDGSTXHC = 0x80146959 SIOCDELLABEL = 0x80206997 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 @@ -1378,11 +1414,6 @@ const ( SIOCSVH = 0xc02069f5 SIOCSVNETFLOWID = 0x802069c3 SIOCSVNETID = 0x802069a6 - SIOCSWGDPID = 0xc018695b - SIOCSWGMAXFLOW = 0xc0186960 - SIOCSWGMAXGROUP = 0xc018695d - SIOCSWSDPID = 0x8018695c - SIOCSWSPORTNO = 0xc060695f SOCK_CLOEXEC = 0x8000 SOCK_DGRAM = 0x2 SOCK_DNS = 0x1000 @@ -1455,7 +1486,18 @@ const ( TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 - TCP_MAXBURST = 0x4 + TCPOPT_EOL = 0x0 + TCPOPT_MAXSEG = 0x2 + TCPOPT_NOP = 0x1 + TCPOPT_SACK = 0x5 + TCPOPT_SACK_HDR = 0x1010500 + TCPOPT_SACK_PERMITTED = 0x4 + TCPOPT_SACK_PERMIT_HDR = 0x1010402 + TCPOPT_SIGNATURE = 0x13 + TCPOPT_TIMESTAMP = 0x8 + TCPOPT_TSTAMP_HDR = 0x101080a + TCPOPT_WINDOW = 0x3 + TCP_INFO = 0x9 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x3 @@ -1833,7 +1875,7 @@ var signalList = [...]struct { {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, - {6, "SIGABRT", "abort trap"}, + {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, @@ -1860,4 +1902,5 @@ var signalList = [...]struct { {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "thread AST"}, + {81920, "SIGSTKSZ", "unknown signal"}, } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go index 1b6eedfa611..54749f9c5ed 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go @@ -552,6 +552,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go index 039c4aa06c2..77479d45815 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go @@ -544,6 +544,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go index 0535d3cfdf2..2e966d4d7a6 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go @@ -544,6 +544,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go index 1018b522170..d65a7c0fa6e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go @@ -544,6 +544,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go index 3802f4b379a..6f0b97c6db3 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go @@ -544,6 +544,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go index 8a2db7da9f3..e1c23b52723 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go @@ -544,6 +544,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go index 4af561a48d8..79f7389963e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go @@ -521,6 +521,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go index 3b90e9448ad..fb161f3a263 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go @@ -521,6 +521,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go index 890f4ccd131..4c8ac993a88 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go @@ -521,6 +521,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go index c79f071fc6a..76dd8ec4fdb 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go @@ -521,6 +521,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index 2925fe0a7b7..caeb807bd4e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -696,6 +696,20 @@ var libc_chroot_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_clock_gettime_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_clock_gettime clock_gettime "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s index 75eb2f5f3f7..087444250c9 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s @@ -5,792 +5,665 @@ TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgroups(SB) - GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $4 DATA ·libc_getgroups_trampoline_addr(SB)/4, $libc_getgroups_trampoline<>(SB) TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgroups(SB) - GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $4 DATA ·libc_setgroups_trampoline_addr(SB)/4, $libc_setgroups_trampoline<>(SB) TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_wait4(SB) - GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $4 DATA ·libc_wait4_trampoline_addr(SB)/4, $libc_wait4_trampoline<>(SB) TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_accept(SB) - GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $4 DATA ·libc_accept_trampoline_addr(SB)/4, $libc_accept_trampoline<>(SB) TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_bind(SB) - GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $4 DATA ·libc_bind_trampoline_addr(SB)/4, $libc_bind_trampoline<>(SB) TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_connect(SB) - GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $4 DATA ·libc_connect_trampoline_addr(SB)/4, $libc_connect_trampoline<>(SB) TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socket(SB) - GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $4 DATA ·libc_socket_trampoline_addr(SB)/4, $libc_socket_trampoline<>(SB) TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockopt(SB) - GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $4 DATA ·libc_getsockopt_trampoline_addr(SB)/4, $libc_getsockopt_trampoline<>(SB) TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsockopt(SB) - GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $4 DATA ·libc_setsockopt_trampoline_addr(SB)/4, $libc_setsockopt_trampoline<>(SB) TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpeername(SB) - GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpeername_trampoline_addr(SB)/4, $libc_getpeername_trampoline<>(SB) TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockname(SB) - GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $4 DATA ·libc_getsockname_trampoline_addr(SB)/4, $libc_getsockname_trampoline<>(SB) TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shutdown(SB) - GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $4 DATA ·libc_shutdown_trampoline_addr(SB)/4, $libc_shutdown_trampoline<>(SB) TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socketpair(SB) - GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $4 DATA ·libc_socketpair_trampoline_addr(SB)/4, $libc_socketpair_trampoline<>(SB) TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvfrom(SB) - GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $4 DATA ·libc_recvfrom_trampoline_addr(SB)/4, $libc_recvfrom_trampoline<>(SB) TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendto(SB) - GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $4 DATA ·libc_sendto_trampoline_addr(SB)/4, $libc_sendto_trampoline<>(SB) TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvmsg(SB) - GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $4 DATA ·libc_recvmsg_trampoline_addr(SB)/4, $libc_recvmsg_trampoline<>(SB) TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendmsg(SB) - GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $4 DATA ·libc_sendmsg_trampoline_addr(SB)/4, $libc_sendmsg_trampoline<>(SB) TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kevent(SB) - GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $4 DATA ·libc_kevent_trampoline_addr(SB)/4, $libc_kevent_trampoline<>(SB) TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) - GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $4 DATA ·libc_utimes_trampoline_addr(SB)/4, $libc_utimes_trampoline<>(SB) TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) - GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $4 DATA ·libc_futimes_trampoline_addr(SB)/4, $libc_futimes_trampoline<>(SB) TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_poll(SB) - GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $4 DATA ·libc_poll_trampoline_addr(SB)/4, $libc_poll_trampoline<>(SB) TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_madvise(SB) - GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $4 DATA ·libc_madvise_trampoline_addr(SB)/4, $libc_madvise_trampoline<>(SB) TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlock(SB) - GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $4 DATA ·libc_mlock_trampoline_addr(SB)/4, $libc_mlock_trampoline<>(SB) TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlockall(SB) - GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $4 DATA ·libc_mlockall_trampoline_addr(SB)/4, $libc_mlockall_trampoline<>(SB) TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mprotect(SB) - GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $4 DATA ·libc_mprotect_trampoline_addr(SB)/4, $libc_mprotect_trampoline<>(SB) TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_msync(SB) - GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $4 DATA ·libc_msync_trampoline_addr(SB)/4, $libc_msync_trampoline<>(SB) TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlock(SB) - GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $4 DATA ·libc_munlock_trampoline_addr(SB)/4, $libc_munlock_trampoline<>(SB) TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlockall(SB) - GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $4 DATA ·libc_munlockall_trampoline_addr(SB)/4, $libc_munlockall_trampoline<>(SB) TEXT libc_pipe2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pipe2(SB) - GLOBL ·libc_pipe2_trampoline_addr(SB), RODATA, $4 DATA ·libc_pipe2_trampoline_addr(SB)/4, $libc_pipe2_trampoline<>(SB) TEXT libc_getdents_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getdents(SB) - GLOBL ·libc_getdents_trampoline_addr(SB), RODATA, $4 DATA ·libc_getdents_trampoline_addr(SB)/4, $libc_getdents_trampoline<>(SB) TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getcwd(SB) - GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $4 DATA ·libc_getcwd_trampoline_addr(SB)/4, $libc_getcwd_trampoline<>(SB) TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) - GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $4 DATA ·libc_ioctl_trampoline_addr(SB)/4, $libc_ioctl_trampoline<>(SB) TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) - GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $4 DATA ·libc_sysctl_trampoline_addr(SB)/4, $libc_sysctl_trampoline<>(SB) TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) - GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $4 DATA ·libc_ppoll_trampoline_addr(SB)/4, $libc_ppoll_trampoline<>(SB) TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_access(SB) - GLOBL ·libc_access_trampoline_addr(SB), RODATA, $4 DATA ·libc_access_trampoline_addr(SB)/4, $libc_access_trampoline<>(SB) TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_adjtime(SB) - GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $4 DATA ·libc_adjtime_trampoline_addr(SB)/4, $libc_adjtime_trampoline<>(SB) TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chdir(SB) - GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $4 DATA ·libc_chdir_trampoline_addr(SB)/4, $libc_chdir_trampoline<>(SB) TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chflags(SB) - GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $4 DATA ·libc_chflags_trampoline_addr(SB)/4, $libc_chflags_trampoline<>(SB) TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chmod(SB) - GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $4 DATA ·libc_chmod_trampoline_addr(SB)/4, $libc_chmod_trampoline<>(SB) TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chown(SB) - GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $4 DATA ·libc_chown_trampoline_addr(SB)/4, $libc_chown_trampoline<>(SB) TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) - GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $4 DATA ·libc_chroot_trampoline_addr(SB)/4, $libc_chroot_trampoline<>(SB) +TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_clock_gettime(SB) +GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $4 +DATA ·libc_clock_gettime_trampoline_addr(SB)/4, $libc_clock_gettime_trampoline<>(SB) + TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_close(SB) - GLOBL ·libc_close_trampoline_addr(SB), RODATA, $4 DATA ·libc_close_trampoline_addr(SB)/4, $libc_close_trampoline<>(SB) TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup(SB) - GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $4 DATA ·libc_dup_trampoline_addr(SB)/4, $libc_dup_trampoline<>(SB) TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup2(SB) - GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $4 DATA ·libc_dup2_trampoline_addr(SB)/4, $libc_dup2_trampoline<>(SB) TEXT libc_dup3_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup3(SB) - GLOBL ·libc_dup3_trampoline_addr(SB), RODATA, $4 DATA ·libc_dup3_trampoline_addr(SB)/4, $libc_dup3_trampoline<>(SB) TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_exit(SB) - GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $4 DATA ·libc_exit_trampoline_addr(SB)/4, $libc_exit_trampoline<>(SB) TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_faccessat(SB) - GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $4 DATA ·libc_faccessat_trampoline_addr(SB)/4, $libc_faccessat_trampoline<>(SB) TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchdir(SB) - GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchdir_trampoline_addr(SB)/4, $libc_fchdir_trampoline<>(SB) TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchflags(SB) - GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchflags_trampoline_addr(SB)/4, $libc_fchflags_trampoline<>(SB) TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmod(SB) - GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchmod_trampoline_addr(SB)/4, $libc_fchmod_trampoline<>(SB) TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmodat(SB) - GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchmodat_trampoline_addr(SB)/4, $libc_fchmodat_trampoline<>(SB) TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchown(SB) - GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchown_trampoline_addr(SB)/4, $libc_fchown_trampoline<>(SB) TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchownat(SB) - GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchownat_trampoline_addr(SB)/4, $libc_fchownat_trampoline<>(SB) TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_flock(SB) - GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $4 DATA ·libc_flock_trampoline_addr(SB)/4, $libc_flock_trampoline<>(SB) TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) - GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $4 DATA ·libc_fpathconf_trampoline_addr(SB)/4, $libc_fpathconf_trampoline<>(SB) TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) - GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $4 DATA ·libc_fstat_trampoline_addr(SB)/4, $libc_fstat_trampoline<>(SB) TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatat(SB) - GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $4 DATA ·libc_fstatat_trampoline_addr(SB)/4, $libc_fstatat_trampoline<>(SB) TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatfs(SB) - GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $4 DATA ·libc_fstatfs_trampoline_addr(SB)/4, $libc_fstatfs_trampoline<>(SB) TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) - GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $4 DATA ·libc_fsync_trampoline_addr(SB)/4, $libc_fsync_trampoline<>(SB) TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) - GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $4 DATA ·libc_ftruncate_trampoline_addr(SB)/4, $libc_ftruncate_trampoline<>(SB) TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getegid(SB) - GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getegid_trampoline_addr(SB)/4, $libc_getegid_trampoline<>(SB) TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_geteuid(SB) - GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_geteuid_trampoline_addr(SB)/4, $libc_geteuid_trampoline<>(SB) TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgid(SB) - GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getgid_trampoline_addr(SB)/4, $libc_getgid_trampoline<>(SB) TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgid(SB) - GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpgid_trampoline_addr(SB)/4, $libc_getpgid_trampoline<>(SB) TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgrp(SB) - GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpgrp_trampoline_addr(SB)/4, $libc_getpgrp_trampoline<>(SB) TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpid(SB) - GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpid_trampoline_addr(SB)/4, $libc_getpid_trampoline<>(SB) TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getppid(SB) - GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getppid_trampoline_addr(SB)/4, $libc_getppid_trampoline<>(SB) TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpriority(SB) - GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpriority_trampoline_addr(SB)/4, $libc_getpriority_trampoline<>(SB) TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrlimit(SB) - GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $4 DATA ·libc_getrlimit_trampoline_addr(SB)/4, $libc_getrlimit_trampoline<>(SB) TEXT libc_getrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrtable(SB) - GLOBL ·libc_getrtable_trampoline_addr(SB), RODATA, $4 DATA ·libc_getrtable_trampoline_addr(SB)/4, $libc_getrtable_trampoline<>(SB) TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrusage(SB) - GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $4 DATA ·libc_getrusage_trampoline_addr(SB)/4, $libc_getrusage_trampoline<>(SB) TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsid(SB) - GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getsid_trampoline_addr(SB)/4, $libc_getsid_trampoline<>(SB) TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) - GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $4 DATA ·libc_gettimeofday_trampoline_addr(SB)/4, $libc_gettimeofday_trampoline<>(SB) TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getuid(SB) - GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getuid_trampoline_addr(SB)/4, $libc_getuid_trampoline<>(SB) TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_issetugid(SB) - GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $4 DATA ·libc_issetugid_trampoline_addr(SB)/4, $libc_issetugid_trampoline<>(SB) TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kill(SB) - GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $4 DATA ·libc_kill_trampoline_addr(SB)/4, $libc_kill_trampoline<>(SB) TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kqueue(SB) - GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $4 DATA ·libc_kqueue_trampoline_addr(SB)/4, $libc_kqueue_trampoline<>(SB) TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lchown(SB) - GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $4 DATA ·libc_lchown_trampoline_addr(SB)/4, $libc_lchown_trampoline<>(SB) TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_link(SB) - GLOBL ·libc_link_trampoline_addr(SB), RODATA, $4 DATA ·libc_link_trampoline_addr(SB)/4, $libc_link_trampoline<>(SB) TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_linkat(SB) - GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $4 DATA ·libc_linkat_trampoline_addr(SB)/4, $libc_linkat_trampoline<>(SB) TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_listen(SB) - GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $4 DATA ·libc_listen_trampoline_addr(SB)/4, $libc_listen_trampoline<>(SB) TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lstat(SB) - GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $4 DATA ·libc_lstat_trampoline_addr(SB)/4, $libc_lstat_trampoline<>(SB) TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) - GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $4 DATA ·libc_mkdir_trampoline_addr(SB)/4, $libc_mkdir_trampoline<>(SB) TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdirat(SB) - GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mkdirat_trampoline_addr(SB)/4, $libc_mkdirat_trampoline<>(SB) TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifo(SB) - GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $4 DATA ·libc_mkfifo_trampoline_addr(SB)/4, $libc_mkfifo_trampoline<>(SB) TEXT libc_mkfifoat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifoat(SB) - GLOBL ·libc_mkfifoat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mkfifoat_trampoline_addr(SB)/4, $libc_mkfifoat_trampoline<>(SB) TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknod(SB) - GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $4 DATA ·libc_mknod_trampoline_addr(SB)/4, $libc_mknod_trampoline<>(SB) TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknodat(SB) - GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mknodat_trampoline_addr(SB)/4, $libc_mknodat_trampoline<>(SB) TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) - GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $4 DATA ·libc_nanosleep_trampoline_addr(SB)/4, $libc_nanosleep_trampoline<>(SB) TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_open(SB) - GLOBL ·libc_open_trampoline_addr(SB), RODATA, $4 DATA ·libc_open_trampoline_addr(SB)/4, $libc_open_trampoline<>(SB) TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_openat(SB) - GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $4 DATA ·libc_openat_trampoline_addr(SB)/4, $libc_openat_trampoline<>(SB) TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pathconf(SB) - GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $4 DATA ·libc_pathconf_trampoline_addr(SB)/4, $libc_pathconf_trampoline<>(SB) TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pread(SB) - GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $4 DATA ·libc_pread_trampoline_addr(SB)/4, $libc_pread_trampoline<>(SB) TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pwrite(SB) - GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $4 DATA ·libc_pwrite_trampoline_addr(SB)/4, $libc_pwrite_trampoline<>(SB) TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) - GLOBL ·libc_read_trampoline_addr(SB), RODATA, $4 DATA ·libc_read_trampoline_addr(SB)/4, $libc_read_trampoline<>(SB) TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlink(SB) - GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $4 DATA ·libc_readlink_trampoline_addr(SB)/4, $libc_readlink_trampoline<>(SB) TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlinkat(SB) - GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $4 DATA ·libc_readlinkat_trampoline_addr(SB)/4, $libc_readlinkat_trampoline<>(SB) TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rename(SB) - GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $4 DATA ·libc_rename_trampoline_addr(SB)/4, $libc_rename_trampoline<>(SB) TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renameat(SB) - GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $4 DATA ·libc_renameat_trampoline_addr(SB)/4, $libc_renameat_trampoline<>(SB) TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_revoke(SB) - GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $4 DATA ·libc_revoke_trampoline_addr(SB)/4, $libc_revoke_trampoline<>(SB) TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rmdir(SB) - GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $4 DATA ·libc_rmdir_trampoline_addr(SB)/4, $libc_rmdir_trampoline<>(SB) TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lseek(SB) - GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $4 DATA ·libc_lseek_trampoline_addr(SB)/4, $libc_lseek_trampoline<>(SB) TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_select(SB) - GLOBL ·libc_select_trampoline_addr(SB), RODATA, $4 DATA ·libc_select_trampoline_addr(SB)/4, $libc_select_trampoline<>(SB) TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setegid(SB) - GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setegid_trampoline_addr(SB)/4, $libc_setegid_trampoline<>(SB) TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_seteuid(SB) - GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_seteuid_trampoline_addr(SB)/4, $libc_seteuid_trampoline<>(SB) TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgid(SB) - GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setgid_trampoline_addr(SB)/4, $libc_setgid_trampoline<>(SB) TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setlogin(SB) - GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $4 DATA ·libc_setlogin_trampoline_addr(SB)/4, $libc_setlogin_trampoline<>(SB) TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpgid(SB) - GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setpgid_trampoline_addr(SB)/4, $libc_setpgid_trampoline<>(SB) TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpriority(SB) - GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $4 DATA ·libc_setpriority_trampoline_addr(SB)/4, $libc_setpriority_trampoline<>(SB) TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setregid(SB) - GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setregid_trampoline_addr(SB)/4, $libc_setregid_trampoline<>(SB) TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setreuid(SB) - GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setreuid_trampoline_addr(SB)/4, $libc_setreuid_trampoline<>(SB) TEXT libc_setresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresgid(SB) - GLOBL ·libc_setresgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setresgid_trampoline_addr(SB)/4, $libc_setresgid_trampoline<>(SB) TEXT libc_setresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresuid(SB) - GLOBL ·libc_setresuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setresuid_trampoline_addr(SB)/4, $libc_setresuid_trampoline<>(SB) TEXT libc_setrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setrlimit(SB) - GLOBL ·libc_setrlimit_trampoline_addr(SB), RODATA, $4 DATA ·libc_setrlimit_trampoline_addr(SB)/4, $libc_setrlimit_trampoline<>(SB) TEXT libc_setrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setrtable(SB) - GLOBL ·libc_setrtable_trampoline_addr(SB), RODATA, $4 DATA ·libc_setrtable_trampoline_addr(SB)/4, $libc_setrtable_trampoline<>(SB) TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsid(SB) - GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setsid_trampoline_addr(SB)/4, $libc_setsid_trampoline<>(SB) TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) - GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $4 DATA ·libc_settimeofday_trampoline_addr(SB)/4, $libc_settimeofday_trampoline<>(SB) TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) - GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setuid_trampoline_addr(SB)/4, $libc_setuid_trampoline<>(SB) TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_stat(SB) - GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $4 DATA ·libc_stat_trampoline_addr(SB)/4, $libc_stat_trampoline<>(SB) TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_statfs(SB) - GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $4 DATA ·libc_statfs_trampoline_addr(SB)/4, $libc_statfs_trampoline<>(SB) TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) - GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $4 DATA ·libc_symlink_trampoline_addr(SB)/4, $libc_symlink_trampoline<>(SB) TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlinkat(SB) - GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $4 DATA ·libc_symlinkat_trampoline_addr(SB)/4, $libc_symlinkat_trampoline<>(SB) TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sync(SB) - GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $4 DATA ·libc_sync_trampoline_addr(SB)/4, $libc_sync_trampoline<>(SB) TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_truncate(SB) - GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $4 DATA ·libc_truncate_trampoline_addr(SB)/4, $libc_truncate_trampoline<>(SB) TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_umask(SB) - GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $4 DATA ·libc_umask_trampoline_addr(SB)/4, $libc_umask_trampoline<>(SB) TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlink(SB) - GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $4 DATA ·libc_unlink_trampoline_addr(SB)/4, $libc_unlink_trampoline<>(SB) TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) - GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $4 DATA ·libc_unlinkat_trampoline_addr(SB)/4, $libc_unlinkat_trampoline<>(SB) TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unmount(SB) - GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $4 DATA ·libc_unmount_trampoline_addr(SB)/4, $libc_unmount_trampoline<>(SB) TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_write(SB) - GLOBL ·libc_write_trampoline_addr(SB), RODATA, $4 DATA ·libc_write_trampoline_addr(SB)/4, $libc_write_trampoline<>(SB) TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mmap(SB) - GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $4 DATA ·libc_mmap_trampoline_addr(SB)/4, $libc_mmap_trampoline<>(SB) TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munmap(SB) - GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $4 DATA ·libc_munmap_trampoline_addr(SB)/4, $libc_munmap_trampoline<>(SB) TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) - GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $4 DATA ·libc_utimensat_trampoline_addr(SB)/4, $libc_utimensat_trampoline<>(SB) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index 98446d2b954..a05e5f4fff6 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -696,6 +696,20 @@ var libc_chroot_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_clock_gettime_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_clock_gettime clock_gettime "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s index 243a6663ce6..5782cd10844 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s @@ -5,792 +5,665 @@ TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgroups(SB) - GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgroups_trampoline_addr(SB)/8, $libc_getgroups_trampoline<>(SB) TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgroups(SB) - GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgroups_trampoline_addr(SB)/8, $libc_setgroups_trampoline<>(SB) TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_wait4(SB) - GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $8 DATA ·libc_wait4_trampoline_addr(SB)/8, $libc_wait4_trampoline<>(SB) TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_accept(SB) - GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $8 DATA ·libc_accept_trampoline_addr(SB)/8, $libc_accept_trampoline<>(SB) TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_bind(SB) - GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $8 DATA ·libc_bind_trampoline_addr(SB)/8, $libc_bind_trampoline<>(SB) TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_connect(SB) - GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $8 DATA ·libc_connect_trampoline_addr(SB)/8, $libc_connect_trampoline<>(SB) TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socket(SB) - GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $8 DATA ·libc_socket_trampoline_addr(SB)/8, $libc_socket_trampoline<>(SB) TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockopt(SB) - GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockopt_trampoline_addr(SB)/8, $libc_getsockopt_trampoline<>(SB) TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsockopt(SB) - GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsockopt_trampoline_addr(SB)/8, $libc_setsockopt_trampoline<>(SB) TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpeername(SB) - GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpeername_trampoline_addr(SB)/8, $libc_getpeername_trampoline<>(SB) TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockname(SB) - GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockname_trampoline_addr(SB)/8, $libc_getsockname_trampoline<>(SB) TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shutdown(SB) - GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $8 DATA ·libc_shutdown_trampoline_addr(SB)/8, $libc_shutdown_trampoline<>(SB) TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socketpair(SB) - GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $8 DATA ·libc_socketpair_trampoline_addr(SB)/8, $libc_socketpair_trampoline<>(SB) TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvfrom(SB) - GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvfrom_trampoline_addr(SB)/8, $libc_recvfrom_trampoline<>(SB) TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendto(SB) - GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendto_trampoline_addr(SB)/8, $libc_sendto_trampoline<>(SB) TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvmsg(SB) - GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvmsg_trampoline_addr(SB)/8, $libc_recvmsg_trampoline<>(SB) TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendmsg(SB) - GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendmsg_trampoline_addr(SB)/8, $libc_sendmsg_trampoline<>(SB) TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kevent(SB) - GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $8 DATA ·libc_kevent_trampoline_addr(SB)/8, $libc_kevent_trampoline<>(SB) TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) - GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimes_trampoline_addr(SB)/8, $libc_utimes_trampoline<>(SB) TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) - GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_futimes_trampoline_addr(SB)/8, $libc_futimes_trampoline<>(SB) TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_poll(SB) - GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $8 DATA ·libc_poll_trampoline_addr(SB)/8, $libc_poll_trampoline<>(SB) TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_madvise(SB) - GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $8 DATA ·libc_madvise_trampoline_addr(SB)/8, $libc_madvise_trampoline<>(SB) TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlock(SB) - GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlock_trampoline_addr(SB)/8, $libc_mlock_trampoline<>(SB) TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlockall(SB) - GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlockall_trampoline_addr(SB)/8, $libc_mlockall_trampoline<>(SB) TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mprotect(SB) - GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $8 DATA ·libc_mprotect_trampoline_addr(SB)/8, $libc_mprotect_trampoline<>(SB) TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_msync(SB) - GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $8 DATA ·libc_msync_trampoline_addr(SB)/8, $libc_msync_trampoline<>(SB) TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlock(SB) - GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlock_trampoline_addr(SB)/8, $libc_munlock_trampoline<>(SB) TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlockall(SB) - GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlockall_trampoline_addr(SB)/8, $libc_munlockall_trampoline<>(SB) TEXT libc_pipe2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pipe2(SB) - GLOBL ·libc_pipe2_trampoline_addr(SB), RODATA, $8 DATA ·libc_pipe2_trampoline_addr(SB)/8, $libc_pipe2_trampoline<>(SB) TEXT libc_getdents_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getdents(SB) - GLOBL ·libc_getdents_trampoline_addr(SB), RODATA, $8 DATA ·libc_getdents_trampoline_addr(SB)/8, $libc_getdents_trampoline<>(SB) TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getcwd(SB) - GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) - GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) - GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) - GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $8 DATA ·libc_ppoll_trampoline_addr(SB)/8, $libc_ppoll_trampoline<>(SB) TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_access(SB) - GLOBL ·libc_access_trampoline_addr(SB), RODATA, $8 DATA ·libc_access_trampoline_addr(SB)/8, $libc_access_trampoline<>(SB) TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_adjtime(SB) - GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $8 DATA ·libc_adjtime_trampoline_addr(SB)/8, $libc_adjtime_trampoline<>(SB) TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chdir(SB) - GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_chdir_trampoline_addr(SB)/8, $libc_chdir_trampoline<>(SB) TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chflags(SB) - GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_chflags_trampoline_addr(SB)/8, $libc_chflags_trampoline<>(SB) TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chmod(SB) - GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_chmod_trampoline_addr(SB)/8, $libc_chmod_trampoline<>(SB) TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chown(SB) - GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $8 DATA ·libc_chown_trampoline_addr(SB)/8, $libc_chown_trampoline<>(SB) TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) - GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $8 DATA ·libc_chroot_trampoline_addr(SB)/8, $libc_chroot_trampoline<>(SB) +TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_clock_gettime(SB) +GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $8 +DATA ·libc_clock_gettime_trampoline_addr(SB)/8, $libc_clock_gettime_trampoline<>(SB) + TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_close(SB) - GLOBL ·libc_close_trampoline_addr(SB), RODATA, $8 DATA ·libc_close_trampoline_addr(SB)/8, $libc_close_trampoline<>(SB) TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup(SB) - GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup_trampoline_addr(SB)/8, $libc_dup_trampoline<>(SB) TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup2(SB) - GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup2_trampoline_addr(SB)/8, $libc_dup2_trampoline<>(SB) TEXT libc_dup3_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup3(SB) - GLOBL ·libc_dup3_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup3_trampoline_addr(SB)/8, $libc_dup3_trampoline<>(SB) TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_exit(SB) - GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $8 DATA ·libc_exit_trampoline_addr(SB)/8, $libc_exit_trampoline<>(SB) TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_faccessat(SB) - GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $8 DATA ·libc_faccessat_trampoline_addr(SB)/8, $libc_faccessat_trampoline<>(SB) TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchdir(SB) - GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchdir_trampoline_addr(SB)/8, $libc_fchdir_trampoline<>(SB) TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchflags(SB) - GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchflags_trampoline_addr(SB)/8, $libc_fchflags_trampoline<>(SB) TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmod(SB) - GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmod_trampoline_addr(SB)/8, $libc_fchmod_trampoline<>(SB) TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmodat(SB) - GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmodat_trampoline_addr(SB)/8, $libc_fchmodat_trampoline<>(SB) TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchown(SB) - GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchown_trampoline_addr(SB)/8, $libc_fchown_trampoline<>(SB) TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchownat(SB) - GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchownat_trampoline_addr(SB)/8, $libc_fchownat_trampoline<>(SB) TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_flock(SB) - GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $8 DATA ·libc_flock_trampoline_addr(SB)/8, $libc_flock_trampoline<>(SB) TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) - GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_fpathconf_trampoline_addr(SB)/8, $libc_fpathconf_trampoline<>(SB) TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) - GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstat_trampoline_addr(SB)/8, $libc_fstat_trampoline<>(SB) TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatat(SB) - GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatat_trampoline_addr(SB)/8, $libc_fstatat_trampoline<>(SB) TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatfs(SB) - GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatfs_trampoline_addr(SB)/8, $libc_fstatfs_trampoline<>(SB) TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) - GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $8 DATA ·libc_fsync_trampoline_addr(SB)/8, $libc_fsync_trampoline<>(SB) TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) - GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_ftruncate_trampoline_addr(SB)/8, $libc_ftruncate_trampoline<>(SB) TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getegid(SB) - GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getegid_trampoline_addr(SB)/8, $libc_getegid_trampoline<>(SB) TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_geteuid(SB) - GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_geteuid_trampoline_addr(SB)/8, $libc_geteuid_trampoline<>(SB) TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgid(SB) - GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgid_trampoline_addr(SB)/8, $libc_getgid_trampoline<>(SB) TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgid(SB) - GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgid_trampoline_addr(SB)/8, $libc_getpgid_trampoline<>(SB) TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgrp(SB) - GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgrp_trampoline_addr(SB)/8, $libc_getpgrp_trampoline<>(SB) TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpid(SB) - GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpid_trampoline_addr(SB)/8, $libc_getpid_trampoline<>(SB) TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getppid(SB) - GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getppid_trampoline_addr(SB)/8, $libc_getppid_trampoline<>(SB) TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpriority(SB) - GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpriority_trampoline_addr(SB)/8, $libc_getpriority_trampoline<>(SB) TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrlimit(SB) - GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrlimit_trampoline_addr(SB)/8, $libc_getrlimit_trampoline<>(SB) TEXT libc_getrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrtable(SB) - GLOBL ·libc_getrtable_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrtable_trampoline_addr(SB)/8, $libc_getrtable_trampoline<>(SB) TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrusage(SB) - GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrusage_trampoline_addr(SB)/8, $libc_getrusage_trampoline<>(SB) TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsid(SB) - GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsid_trampoline_addr(SB)/8, $libc_getsid_trampoline<>(SB) TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) - GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_gettimeofday_trampoline_addr(SB)/8, $libc_gettimeofday_trampoline<>(SB) TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getuid(SB) - GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getuid_trampoline_addr(SB)/8, $libc_getuid_trampoline<>(SB) TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_issetugid(SB) - GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $8 DATA ·libc_issetugid_trampoline_addr(SB)/8, $libc_issetugid_trampoline<>(SB) TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kill(SB) - GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $8 DATA ·libc_kill_trampoline_addr(SB)/8, $libc_kill_trampoline<>(SB) TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kqueue(SB) - GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $8 DATA ·libc_kqueue_trampoline_addr(SB)/8, $libc_kqueue_trampoline<>(SB) TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lchown(SB) - GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_lchown_trampoline_addr(SB)/8, $libc_lchown_trampoline<>(SB) TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_link(SB) - GLOBL ·libc_link_trampoline_addr(SB), RODATA, $8 DATA ·libc_link_trampoline_addr(SB)/8, $libc_link_trampoline<>(SB) TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_linkat(SB) - GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_linkat_trampoline_addr(SB)/8, $libc_linkat_trampoline<>(SB) TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_listen(SB) - GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $8 DATA ·libc_listen_trampoline_addr(SB)/8, $libc_listen_trampoline<>(SB) TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lstat(SB) - GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_lstat_trampoline_addr(SB)/8, $libc_lstat_trampoline<>(SB) TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) - GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdir_trampoline_addr(SB)/8, $libc_mkdir_trampoline<>(SB) TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdirat(SB) - GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdirat_trampoline_addr(SB)/8, $libc_mkdirat_trampoline<>(SB) TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifo(SB) - GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifo_trampoline_addr(SB)/8, $libc_mkfifo_trampoline<>(SB) TEXT libc_mkfifoat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifoat(SB) - GLOBL ·libc_mkfifoat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifoat_trampoline_addr(SB)/8, $libc_mkfifoat_trampoline<>(SB) TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknod(SB) - GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB) TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknodat(SB) - GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) - GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 DATA ·libc_nanosleep_trampoline_addr(SB)/8, $libc_nanosleep_trampoline<>(SB) TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_open(SB) - GLOBL ·libc_open_trampoline_addr(SB), RODATA, $8 DATA ·libc_open_trampoline_addr(SB)/8, $libc_open_trampoline<>(SB) TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_openat(SB) - GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $8 DATA ·libc_openat_trampoline_addr(SB)/8, $libc_openat_trampoline<>(SB) TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pathconf(SB) - GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_pathconf_trampoline_addr(SB)/8, $libc_pathconf_trampoline<>(SB) TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pread(SB) - GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $8 DATA ·libc_pread_trampoline_addr(SB)/8, $libc_pread_trampoline<>(SB) TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pwrite(SB) - GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) - GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 DATA ·libc_read_trampoline_addr(SB)/8, $libc_read_trampoline<>(SB) TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlink(SB) - GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlink_trampoline_addr(SB)/8, $libc_readlink_trampoline<>(SB) TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlinkat(SB) - GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlinkat_trampoline_addr(SB)/8, $libc_readlinkat_trampoline<>(SB) TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rename(SB) - GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $8 DATA ·libc_rename_trampoline_addr(SB)/8, $libc_rename_trampoline<>(SB) TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renameat(SB) - GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $8 DATA ·libc_renameat_trampoline_addr(SB)/8, $libc_renameat_trampoline<>(SB) TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_revoke(SB) - GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $8 DATA ·libc_revoke_trampoline_addr(SB)/8, $libc_revoke_trampoline<>(SB) TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rmdir(SB) - GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_rmdir_trampoline_addr(SB)/8, $libc_rmdir_trampoline<>(SB) TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lseek(SB) - GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $8 DATA ·libc_lseek_trampoline_addr(SB)/8, $libc_lseek_trampoline<>(SB) TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_select(SB) - GLOBL ·libc_select_trampoline_addr(SB), RODATA, $8 DATA ·libc_select_trampoline_addr(SB)/8, $libc_select_trampoline<>(SB) TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setegid(SB) - GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setegid_trampoline_addr(SB)/8, $libc_setegid_trampoline<>(SB) TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_seteuid(SB) - GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_seteuid_trampoline_addr(SB)/8, $libc_seteuid_trampoline<>(SB) TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgid(SB) - GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgid_trampoline_addr(SB)/8, $libc_setgid_trampoline<>(SB) TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setlogin(SB) - GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $8 DATA ·libc_setlogin_trampoline_addr(SB)/8, $libc_setlogin_trampoline<>(SB) TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpgid(SB) - GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpgid_trampoline_addr(SB)/8, $libc_setpgid_trampoline<>(SB) TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpriority(SB) - GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpriority_trampoline_addr(SB)/8, $libc_setpriority_trampoline<>(SB) TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setregid(SB) - GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setregid_trampoline_addr(SB)/8, $libc_setregid_trampoline<>(SB) TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setreuid(SB) - GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setreuid_trampoline_addr(SB)/8, $libc_setreuid_trampoline<>(SB) TEXT libc_setresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresgid(SB) - GLOBL ·libc_setresgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setresgid_trampoline_addr(SB)/8, $libc_setresgid_trampoline<>(SB) TEXT libc_setresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresuid(SB) - GLOBL ·libc_setresuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setresuid_trampoline_addr(SB)/8, $libc_setresuid_trampoline<>(SB) TEXT libc_setrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setrlimit(SB) - GLOBL ·libc_setrlimit_trampoline_addr(SB), RODATA, $8 DATA ·libc_setrlimit_trampoline_addr(SB)/8, $libc_setrlimit_trampoline<>(SB) TEXT libc_setrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setrtable(SB) - GLOBL ·libc_setrtable_trampoline_addr(SB), RODATA, $8 DATA ·libc_setrtable_trampoline_addr(SB)/8, $libc_setrtable_trampoline<>(SB) TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsid(SB) - GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsid_trampoline_addr(SB)/8, $libc_setsid_trampoline<>(SB) TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) - GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_settimeofday_trampoline_addr(SB)/8, $libc_settimeofday_trampoline<>(SB) TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) - GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setuid_trampoline_addr(SB)/8, $libc_setuid_trampoline<>(SB) TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_stat(SB) - GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $8 DATA ·libc_stat_trampoline_addr(SB)/8, $libc_stat_trampoline<>(SB) TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_statfs(SB) - GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_statfs_trampoline_addr(SB)/8, $libc_statfs_trampoline<>(SB) TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) - GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlink_trampoline_addr(SB)/8, $libc_symlink_trampoline<>(SB) TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlinkat(SB) - GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlinkat_trampoline_addr(SB)/8, $libc_symlinkat_trampoline<>(SB) TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sync(SB) - GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $8 DATA ·libc_sync_trampoline_addr(SB)/8, $libc_sync_trampoline<>(SB) TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_truncate(SB) - GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_truncate_trampoline_addr(SB)/8, $libc_truncate_trampoline<>(SB) TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_umask(SB) - GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $8 DATA ·libc_umask_trampoline_addr(SB)/8, $libc_umask_trampoline<>(SB) TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlink(SB) - GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlink_trampoline_addr(SB)/8, $libc_unlink_trampoline<>(SB) TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) - GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlinkat_trampoline_addr(SB)/8, $libc_unlinkat_trampoline<>(SB) TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unmount(SB) - GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $8 DATA ·libc_unmount_trampoline_addr(SB)/8, $libc_unmount_trampoline<>(SB) TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_write(SB) - GLOBL ·libc_write_trampoline_addr(SB), RODATA, $8 DATA ·libc_write_trampoline_addr(SB)/8, $libc_write_trampoline<>(SB) TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mmap(SB) - GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_mmap_trampoline_addr(SB)/8, $libc_mmap_trampoline<>(SB) TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munmap(SB) - GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) - GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index 8da6791d1e3..b2da8e50cc7 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -696,6 +696,20 @@ var libc_chroot_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_clock_gettime_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_clock_gettime clock_gettime "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s index 9ad116d9fbd..cf310420c94 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s @@ -5,792 +5,665 @@ TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgroups(SB) - GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $4 DATA ·libc_getgroups_trampoline_addr(SB)/4, $libc_getgroups_trampoline<>(SB) TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgroups(SB) - GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $4 DATA ·libc_setgroups_trampoline_addr(SB)/4, $libc_setgroups_trampoline<>(SB) TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_wait4(SB) - GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $4 DATA ·libc_wait4_trampoline_addr(SB)/4, $libc_wait4_trampoline<>(SB) TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_accept(SB) - GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $4 DATA ·libc_accept_trampoline_addr(SB)/4, $libc_accept_trampoline<>(SB) TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_bind(SB) - GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $4 DATA ·libc_bind_trampoline_addr(SB)/4, $libc_bind_trampoline<>(SB) TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_connect(SB) - GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $4 DATA ·libc_connect_trampoline_addr(SB)/4, $libc_connect_trampoline<>(SB) TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socket(SB) - GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $4 DATA ·libc_socket_trampoline_addr(SB)/4, $libc_socket_trampoline<>(SB) TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockopt(SB) - GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $4 DATA ·libc_getsockopt_trampoline_addr(SB)/4, $libc_getsockopt_trampoline<>(SB) TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsockopt(SB) - GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $4 DATA ·libc_setsockopt_trampoline_addr(SB)/4, $libc_setsockopt_trampoline<>(SB) TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpeername(SB) - GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpeername_trampoline_addr(SB)/4, $libc_getpeername_trampoline<>(SB) TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockname(SB) - GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $4 DATA ·libc_getsockname_trampoline_addr(SB)/4, $libc_getsockname_trampoline<>(SB) TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shutdown(SB) - GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $4 DATA ·libc_shutdown_trampoline_addr(SB)/4, $libc_shutdown_trampoline<>(SB) TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socketpair(SB) - GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $4 DATA ·libc_socketpair_trampoline_addr(SB)/4, $libc_socketpair_trampoline<>(SB) TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvfrom(SB) - GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $4 DATA ·libc_recvfrom_trampoline_addr(SB)/4, $libc_recvfrom_trampoline<>(SB) TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendto(SB) - GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $4 DATA ·libc_sendto_trampoline_addr(SB)/4, $libc_sendto_trampoline<>(SB) TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvmsg(SB) - GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $4 DATA ·libc_recvmsg_trampoline_addr(SB)/4, $libc_recvmsg_trampoline<>(SB) TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendmsg(SB) - GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $4 DATA ·libc_sendmsg_trampoline_addr(SB)/4, $libc_sendmsg_trampoline<>(SB) TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kevent(SB) - GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $4 DATA ·libc_kevent_trampoline_addr(SB)/4, $libc_kevent_trampoline<>(SB) TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) - GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $4 DATA ·libc_utimes_trampoline_addr(SB)/4, $libc_utimes_trampoline<>(SB) TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) - GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $4 DATA ·libc_futimes_trampoline_addr(SB)/4, $libc_futimes_trampoline<>(SB) TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_poll(SB) - GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $4 DATA ·libc_poll_trampoline_addr(SB)/4, $libc_poll_trampoline<>(SB) TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_madvise(SB) - GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $4 DATA ·libc_madvise_trampoline_addr(SB)/4, $libc_madvise_trampoline<>(SB) TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlock(SB) - GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $4 DATA ·libc_mlock_trampoline_addr(SB)/4, $libc_mlock_trampoline<>(SB) TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlockall(SB) - GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $4 DATA ·libc_mlockall_trampoline_addr(SB)/4, $libc_mlockall_trampoline<>(SB) TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mprotect(SB) - GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $4 DATA ·libc_mprotect_trampoline_addr(SB)/4, $libc_mprotect_trampoline<>(SB) TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_msync(SB) - GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $4 DATA ·libc_msync_trampoline_addr(SB)/4, $libc_msync_trampoline<>(SB) TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlock(SB) - GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $4 DATA ·libc_munlock_trampoline_addr(SB)/4, $libc_munlock_trampoline<>(SB) TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlockall(SB) - GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $4 DATA ·libc_munlockall_trampoline_addr(SB)/4, $libc_munlockall_trampoline<>(SB) TEXT libc_pipe2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pipe2(SB) - GLOBL ·libc_pipe2_trampoline_addr(SB), RODATA, $4 DATA ·libc_pipe2_trampoline_addr(SB)/4, $libc_pipe2_trampoline<>(SB) TEXT libc_getdents_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getdents(SB) - GLOBL ·libc_getdents_trampoline_addr(SB), RODATA, $4 DATA ·libc_getdents_trampoline_addr(SB)/4, $libc_getdents_trampoline<>(SB) TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getcwd(SB) - GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $4 DATA ·libc_getcwd_trampoline_addr(SB)/4, $libc_getcwd_trampoline<>(SB) TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) - GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $4 DATA ·libc_ioctl_trampoline_addr(SB)/4, $libc_ioctl_trampoline<>(SB) TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) - GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $4 DATA ·libc_sysctl_trampoline_addr(SB)/4, $libc_sysctl_trampoline<>(SB) TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) - GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $4 DATA ·libc_ppoll_trampoline_addr(SB)/4, $libc_ppoll_trampoline<>(SB) TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_access(SB) - GLOBL ·libc_access_trampoline_addr(SB), RODATA, $4 DATA ·libc_access_trampoline_addr(SB)/4, $libc_access_trampoline<>(SB) TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_adjtime(SB) - GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $4 DATA ·libc_adjtime_trampoline_addr(SB)/4, $libc_adjtime_trampoline<>(SB) TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chdir(SB) - GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $4 DATA ·libc_chdir_trampoline_addr(SB)/4, $libc_chdir_trampoline<>(SB) TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chflags(SB) - GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $4 DATA ·libc_chflags_trampoline_addr(SB)/4, $libc_chflags_trampoline<>(SB) TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chmod(SB) - GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $4 DATA ·libc_chmod_trampoline_addr(SB)/4, $libc_chmod_trampoline<>(SB) TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chown(SB) - GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $4 DATA ·libc_chown_trampoline_addr(SB)/4, $libc_chown_trampoline<>(SB) TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) - GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $4 DATA ·libc_chroot_trampoline_addr(SB)/4, $libc_chroot_trampoline<>(SB) +TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_clock_gettime(SB) +GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $4 +DATA ·libc_clock_gettime_trampoline_addr(SB)/4, $libc_clock_gettime_trampoline<>(SB) + TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_close(SB) - GLOBL ·libc_close_trampoline_addr(SB), RODATA, $4 DATA ·libc_close_trampoline_addr(SB)/4, $libc_close_trampoline<>(SB) TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup(SB) - GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $4 DATA ·libc_dup_trampoline_addr(SB)/4, $libc_dup_trampoline<>(SB) TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup2(SB) - GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $4 DATA ·libc_dup2_trampoline_addr(SB)/4, $libc_dup2_trampoline<>(SB) TEXT libc_dup3_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup3(SB) - GLOBL ·libc_dup3_trampoline_addr(SB), RODATA, $4 DATA ·libc_dup3_trampoline_addr(SB)/4, $libc_dup3_trampoline<>(SB) TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_exit(SB) - GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $4 DATA ·libc_exit_trampoline_addr(SB)/4, $libc_exit_trampoline<>(SB) TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_faccessat(SB) - GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $4 DATA ·libc_faccessat_trampoline_addr(SB)/4, $libc_faccessat_trampoline<>(SB) TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchdir(SB) - GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchdir_trampoline_addr(SB)/4, $libc_fchdir_trampoline<>(SB) TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchflags(SB) - GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchflags_trampoline_addr(SB)/4, $libc_fchflags_trampoline<>(SB) TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmod(SB) - GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchmod_trampoline_addr(SB)/4, $libc_fchmod_trampoline<>(SB) TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmodat(SB) - GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchmodat_trampoline_addr(SB)/4, $libc_fchmodat_trampoline<>(SB) TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchown(SB) - GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchown_trampoline_addr(SB)/4, $libc_fchown_trampoline<>(SB) TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchownat(SB) - GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchownat_trampoline_addr(SB)/4, $libc_fchownat_trampoline<>(SB) TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_flock(SB) - GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $4 DATA ·libc_flock_trampoline_addr(SB)/4, $libc_flock_trampoline<>(SB) TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) - GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $4 DATA ·libc_fpathconf_trampoline_addr(SB)/4, $libc_fpathconf_trampoline<>(SB) TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) - GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $4 DATA ·libc_fstat_trampoline_addr(SB)/4, $libc_fstat_trampoline<>(SB) TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatat(SB) - GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $4 DATA ·libc_fstatat_trampoline_addr(SB)/4, $libc_fstatat_trampoline<>(SB) TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatfs(SB) - GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $4 DATA ·libc_fstatfs_trampoline_addr(SB)/4, $libc_fstatfs_trampoline<>(SB) TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) - GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $4 DATA ·libc_fsync_trampoline_addr(SB)/4, $libc_fsync_trampoline<>(SB) TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) - GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $4 DATA ·libc_ftruncate_trampoline_addr(SB)/4, $libc_ftruncate_trampoline<>(SB) TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getegid(SB) - GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getegid_trampoline_addr(SB)/4, $libc_getegid_trampoline<>(SB) TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_geteuid(SB) - GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_geteuid_trampoline_addr(SB)/4, $libc_geteuid_trampoline<>(SB) TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgid(SB) - GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getgid_trampoline_addr(SB)/4, $libc_getgid_trampoline<>(SB) TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgid(SB) - GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpgid_trampoline_addr(SB)/4, $libc_getpgid_trampoline<>(SB) TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgrp(SB) - GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpgrp_trampoline_addr(SB)/4, $libc_getpgrp_trampoline<>(SB) TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpid(SB) - GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpid_trampoline_addr(SB)/4, $libc_getpid_trampoline<>(SB) TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getppid(SB) - GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getppid_trampoline_addr(SB)/4, $libc_getppid_trampoline<>(SB) TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpriority(SB) - GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpriority_trampoline_addr(SB)/4, $libc_getpriority_trampoline<>(SB) TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrlimit(SB) - GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $4 DATA ·libc_getrlimit_trampoline_addr(SB)/4, $libc_getrlimit_trampoline<>(SB) TEXT libc_getrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrtable(SB) - GLOBL ·libc_getrtable_trampoline_addr(SB), RODATA, $4 DATA ·libc_getrtable_trampoline_addr(SB)/4, $libc_getrtable_trampoline<>(SB) TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrusage(SB) - GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $4 DATA ·libc_getrusage_trampoline_addr(SB)/4, $libc_getrusage_trampoline<>(SB) TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsid(SB) - GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getsid_trampoline_addr(SB)/4, $libc_getsid_trampoline<>(SB) TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) - GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $4 DATA ·libc_gettimeofday_trampoline_addr(SB)/4, $libc_gettimeofday_trampoline<>(SB) TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getuid(SB) - GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getuid_trampoline_addr(SB)/4, $libc_getuid_trampoline<>(SB) TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_issetugid(SB) - GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $4 DATA ·libc_issetugid_trampoline_addr(SB)/4, $libc_issetugid_trampoline<>(SB) TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kill(SB) - GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $4 DATA ·libc_kill_trampoline_addr(SB)/4, $libc_kill_trampoline<>(SB) TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kqueue(SB) - GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $4 DATA ·libc_kqueue_trampoline_addr(SB)/4, $libc_kqueue_trampoline<>(SB) TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lchown(SB) - GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $4 DATA ·libc_lchown_trampoline_addr(SB)/4, $libc_lchown_trampoline<>(SB) TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_link(SB) - GLOBL ·libc_link_trampoline_addr(SB), RODATA, $4 DATA ·libc_link_trampoline_addr(SB)/4, $libc_link_trampoline<>(SB) TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_linkat(SB) - GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $4 DATA ·libc_linkat_trampoline_addr(SB)/4, $libc_linkat_trampoline<>(SB) TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_listen(SB) - GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $4 DATA ·libc_listen_trampoline_addr(SB)/4, $libc_listen_trampoline<>(SB) TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lstat(SB) - GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $4 DATA ·libc_lstat_trampoline_addr(SB)/4, $libc_lstat_trampoline<>(SB) TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) - GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $4 DATA ·libc_mkdir_trampoline_addr(SB)/4, $libc_mkdir_trampoline<>(SB) TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdirat(SB) - GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mkdirat_trampoline_addr(SB)/4, $libc_mkdirat_trampoline<>(SB) TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifo(SB) - GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $4 DATA ·libc_mkfifo_trampoline_addr(SB)/4, $libc_mkfifo_trampoline<>(SB) TEXT libc_mkfifoat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifoat(SB) - GLOBL ·libc_mkfifoat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mkfifoat_trampoline_addr(SB)/4, $libc_mkfifoat_trampoline<>(SB) TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknod(SB) - GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $4 DATA ·libc_mknod_trampoline_addr(SB)/4, $libc_mknod_trampoline<>(SB) TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknodat(SB) - GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mknodat_trampoline_addr(SB)/4, $libc_mknodat_trampoline<>(SB) TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) - GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $4 DATA ·libc_nanosleep_trampoline_addr(SB)/4, $libc_nanosleep_trampoline<>(SB) TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_open(SB) - GLOBL ·libc_open_trampoline_addr(SB), RODATA, $4 DATA ·libc_open_trampoline_addr(SB)/4, $libc_open_trampoline<>(SB) TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_openat(SB) - GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $4 DATA ·libc_openat_trampoline_addr(SB)/4, $libc_openat_trampoline<>(SB) TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pathconf(SB) - GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $4 DATA ·libc_pathconf_trampoline_addr(SB)/4, $libc_pathconf_trampoline<>(SB) TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pread(SB) - GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $4 DATA ·libc_pread_trampoline_addr(SB)/4, $libc_pread_trampoline<>(SB) TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pwrite(SB) - GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $4 DATA ·libc_pwrite_trampoline_addr(SB)/4, $libc_pwrite_trampoline<>(SB) TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) - GLOBL ·libc_read_trampoline_addr(SB), RODATA, $4 DATA ·libc_read_trampoline_addr(SB)/4, $libc_read_trampoline<>(SB) TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlink(SB) - GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $4 DATA ·libc_readlink_trampoline_addr(SB)/4, $libc_readlink_trampoline<>(SB) TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlinkat(SB) - GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $4 DATA ·libc_readlinkat_trampoline_addr(SB)/4, $libc_readlinkat_trampoline<>(SB) TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rename(SB) - GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $4 DATA ·libc_rename_trampoline_addr(SB)/4, $libc_rename_trampoline<>(SB) TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renameat(SB) - GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $4 DATA ·libc_renameat_trampoline_addr(SB)/4, $libc_renameat_trampoline<>(SB) TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_revoke(SB) - GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $4 DATA ·libc_revoke_trampoline_addr(SB)/4, $libc_revoke_trampoline<>(SB) TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rmdir(SB) - GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $4 DATA ·libc_rmdir_trampoline_addr(SB)/4, $libc_rmdir_trampoline<>(SB) TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lseek(SB) - GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $4 DATA ·libc_lseek_trampoline_addr(SB)/4, $libc_lseek_trampoline<>(SB) TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_select(SB) - GLOBL ·libc_select_trampoline_addr(SB), RODATA, $4 DATA ·libc_select_trampoline_addr(SB)/4, $libc_select_trampoline<>(SB) TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setegid(SB) - GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setegid_trampoline_addr(SB)/4, $libc_setegid_trampoline<>(SB) TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_seteuid(SB) - GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_seteuid_trampoline_addr(SB)/4, $libc_seteuid_trampoline<>(SB) TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgid(SB) - GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setgid_trampoline_addr(SB)/4, $libc_setgid_trampoline<>(SB) TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setlogin(SB) - GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $4 DATA ·libc_setlogin_trampoline_addr(SB)/4, $libc_setlogin_trampoline<>(SB) TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpgid(SB) - GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setpgid_trampoline_addr(SB)/4, $libc_setpgid_trampoline<>(SB) TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpriority(SB) - GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $4 DATA ·libc_setpriority_trampoline_addr(SB)/4, $libc_setpriority_trampoline<>(SB) TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setregid(SB) - GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setregid_trampoline_addr(SB)/4, $libc_setregid_trampoline<>(SB) TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setreuid(SB) - GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setreuid_trampoline_addr(SB)/4, $libc_setreuid_trampoline<>(SB) TEXT libc_setresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresgid(SB) - GLOBL ·libc_setresgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setresgid_trampoline_addr(SB)/4, $libc_setresgid_trampoline<>(SB) TEXT libc_setresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresuid(SB) - GLOBL ·libc_setresuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setresuid_trampoline_addr(SB)/4, $libc_setresuid_trampoline<>(SB) TEXT libc_setrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setrlimit(SB) - GLOBL ·libc_setrlimit_trampoline_addr(SB), RODATA, $4 DATA ·libc_setrlimit_trampoline_addr(SB)/4, $libc_setrlimit_trampoline<>(SB) TEXT libc_setrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setrtable(SB) - GLOBL ·libc_setrtable_trampoline_addr(SB), RODATA, $4 DATA ·libc_setrtable_trampoline_addr(SB)/4, $libc_setrtable_trampoline<>(SB) TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsid(SB) - GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setsid_trampoline_addr(SB)/4, $libc_setsid_trampoline<>(SB) TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) - GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $4 DATA ·libc_settimeofday_trampoline_addr(SB)/4, $libc_settimeofday_trampoline<>(SB) TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) - GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setuid_trampoline_addr(SB)/4, $libc_setuid_trampoline<>(SB) TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_stat(SB) - GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $4 DATA ·libc_stat_trampoline_addr(SB)/4, $libc_stat_trampoline<>(SB) TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_statfs(SB) - GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $4 DATA ·libc_statfs_trampoline_addr(SB)/4, $libc_statfs_trampoline<>(SB) TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) - GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $4 DATA ·libc_symlink_trampoline_addr(SB)/4, $libc_symlink_trampoline<>(SB) TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlinkat(SB) - GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $4 DATA ·libc_symlinkat_trampoline_addr(SB)/4, $libc_symlinkat_trampoline<>(SB) TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sync(SB) - GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $4 DATA ·libc_sync_trampoline_addr(SB)/4, $libc_sync_trampoline<>(SB) TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_truncate(SB) - GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $4 DATA ·libc_truncate_trampoline_addr(SB)/4, $libc_truncate_trampoline<>(SB) TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_umask(SB) - GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $4 DATA ·libc_umask_trampoline_addr(SB)/4, $libc_umask_trampoline<>(SB) TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlink(SB) - GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $4 DATA ·libc_unlink_trampoline_addr(SB)/4, $libc_unlink_trampoline<>(SB) TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) - GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $4 DATA ·libc_unlinkat_trampoline_addr(SB)/4, $libc_unlinkat_trampoline<>(SB) TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unmount(SB) - GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $4 DATA ·libc_unmount_trampoline_addr(SB)/4, $libc_unmount_trampoline<>(SB) TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_write(SB) - GLOBL ·libc_write_trampoline_addr(SB), RODATA, $4 DATA ·libc_write_trampoline_addr(SB)/4, $libc_write_trampoline<>(SB) TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mmap(SB) - GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $4 DATA ·libc_mmap_trampoline_addr(SB)/4, $libc_mmap_trampoline<>(SB) TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munmap(SB) - GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $4 DATA ·libc_munmap_trampoline_addr(SB)/4, $libc_munmap_trampoline<>(SB) TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) - GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $4 DATA ·libc_utimensat_trampoline_addr(SB)/4, $libc_utimensat_trampoline<>(SB) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index 800aab6e3e7..048b2655e6f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -696,6 +696,20 @@ var libc_chroot_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_clock_gettime_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_clock_gettime clock_gettime "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s index 4efeff9abbf..484bb42e0a8 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s @@ -5,792 +5,665 @@ TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgroups(SB) - GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgroups_trampoline_addr(SB)/8, $libc_getgroups_trampoline<>(SB) TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgroups(SB) - GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgroups_trampoline_addr(SB)/8, $libc_setgroups_trampoline<>(SB) TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_wait4(SB) - GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $8 DATA ·libc_wait4_trampoline_addr(SB)/8, $libc_wait4_trampoline<>(SB) TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_accept(SB) - GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $8 DATA ·libc_accept_trampoline_addr(SB)/8, $libc_accept_trampoline<>(SB) TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_bind(SB) - GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $8 DATA ·libc_bind_trampoline_addr(SB)/8, $libc_bind_trampoline<>(SB) TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_connect(SB) - GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $8 DATA ·libc_connect_trampoline_addr(SB)/8, $libc_connect_trampoline<>(SB) TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socket(SB) - GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $8 DATA ·libc_socket_trampoline_addr(SB)/8, $libc_socket_trampoline<>(SB) TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockopt(SB) - GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockopt_trampoline_addr(SB)/8, $libc_getsockopt_trampoline<>(SB) TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsockopt(SB) - GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsockopt_trampoline_addr(SB)/8, $libc_setsockopt_trampoline<>(SB) TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpeername(SB) - GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpeername_trampoline_addr(SB)/8, $libc_getpeername_trampoline<>(SB) TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockname(SB) - GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockname_trampoline_addr(SB)/8, $libc_getsockname_trampoline<>(SB) TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shutdown(SB) - GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $8 DATA ·libc_shutdown_trampoline_addr(SB)/8, $libc_shutdown_trampoline<>(SB) TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socketpair(SB) - GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $8 DATA ·libc_socketpair_trampoline_addr(SB)/8, $libc_socketpair_trampoline<>(SB) TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvfrom(SB) - GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvfrom_trampoline_addr(SB)/8, $libc_recvfrom_trampoline<>(SB) TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendto(SB) - GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendto_trampoline_addr(SB)/8, $libc_sendto_trampoline<>(SB) TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvmsg(SB) - GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvmsg_trampoline_addr(SB)/8, $libc_recvmsg_trampoline<>(SB) TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendmsg(SB) - GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendmsg_trampoline_addr(SB)/8, $libc_sendmsg_trampoline<>(SB) TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kevent(SB) - GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $8 DATA ·libc_kevent_trampoline_addr(SB)/8, $libc_kevent_trampoline<>(SB) TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) - GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimes_trampoline_addr(SB)/8, $libc_utimes_trampoline<>(SB) TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) - GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_futimes_trampoline_addr(SB)/8, $libc_futimes_trampoline<>(SB) TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_poll(SB) - GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $8 DATA ·libc_poll_trampoline_addr(SB)/8, $libc_poll_trampoline<>(SB) TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_madvise(SB) - GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $8 DATA ·libc_madvise_trampoline_addr(SB)/8, $libc_madvise_trampoline<>(SB) TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlock(SB) - GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlock_trampoline_addr(SB)/8, $libc_mlock_trampoline<>(SB) TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlockall(SB) - GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlockall_trampoline_addr(SB)/8, $libc_mlockall_trampoline<>(SB) TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mprotect(SB) - GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $8 DATA ·libc_mprotect_trampoline_addr(SB)/8, $libc_mprotect_trampoline<>(SB) TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_msync(SB) - GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $8 DATA ·libc_msync_trampoline_addr(SB)/8, $libc_msync_trampoline<>(SB) TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlock(SB) - GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlock_trampoline_addr(SB)/8, $libc_munlock_trampoline<>(SB) TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlockall(SB) - GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlockall_trampoline_addr(SB)/8, $libc_munlockall_trampoline<>(SB) TEXT libc_pipe2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pipe2(SB) - GLOBL ·libc_pipe2_trampoline_addr(SB), RODATA, $8 DATA ·libc_pipe2_trampoline_addr(SB)/8, $libc_pipe2_trampoline<>(SB) TEXT libc_getdents_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getdents(SB) - GLOBL ·libc_getdents_trampoline_addr(SB), RODATA, $8 DATA ·libc_getdents_trampoline_addr(SB)/8, $libc_getdents_trampoline<>(SB) TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getcwd(SB) - GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) - GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) - GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) - GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $8 DATA ·libc_ppoll_trampoline_addr(SB)/8, $libc_ppoll_trampoline<>(SB) TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_access(SB) - GLOBL ·libc_access_trampoline_addr(SB), RODATA, $8 DATA ·libc_access_trampoline_addr(SB)/8, $libc_access_trampoline<>(SB) TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_adjtime(SB) - GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $8 DATA ·libc_adjtime_trampoline_addr(SB)/8, $libc_adjtime_trampoline<>(SB) TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chdir(SB) - GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_chdir_trampoline_addr(SB)/8, $libc_chdir_trampoline<>(SB) TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chflags(SB) - GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_chflags_trampoline_addr(SB)/8, $libc_chflags_trampoline<>(SB) TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chmod(SB) - GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_chmod_trampoline_addr(SB)/8, $libc_chmod_trampoline<>(SB) TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chown(SB) - GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $8 DATA ·libc_chown_trampoline_addr(SB)/8, $libc_chown_trampoline<>(SB) TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) - GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $8 DATA ·libc_chroot_trampoline_addr(SB)/8, $libc_chroot_trampoline<>(SB) +TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_clock_gettime(SB) +GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $8 +DATA ·libc_clock_gettime_trampoline_addr(SB)/8, $libc_clock_gettime_trampoline<>(SB) + TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_close(SB) - GLOBL ·libc_close_trampoline_addr(SB), RODATA, $8 DATA ·libc_close_trampoline_addr(SB)/8, $libc_close_trampoline<>(SB) TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup(SB) - GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup_trampoline_addr(SB)/8, $libc_dup_trampoline<>(SB) TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup2(SB) - GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup2_trampoline_addr(SB)/8, $libc_dup2_trampoline<>(SB) TEXT libc_dup3_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup3(SB) - GLOBL ·libc_dup3_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup3_trampoline_addr(SB)/8, $libc_dup3_trampoline<>(SB) TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_exit(SB) - GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $8 DATA ·libc_exit_trampoline_addr(SB)/8, $libc_exit_trampoline<>(SB) TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_faccessat(SB) - GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $8 DATA ·libc_faccessat_trampoline_addr(SB)/8, $libc_faccessat_trampoline<>(SB) TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchdir(SB) - GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchdir_trampoline_addr(SB)/8, $libc_fchdir_trampoline<>(SB) TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchflags(SB) - GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchflags_trampoline_addr(SB)/8, $libc_fchflags_trampoline<>(SB) TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmod(SB) - GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmod_trampoline_addr(SB)/8, $libc_fchmod_trampoline<>(SB) TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmodat(SB) - GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmodat_trampoline_addr(SB)/8, $libc_fchmodat_trampoline<>(SB) TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchown(SB) - GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchown_trampoline_addr(SB)/8, $libc_fchown_trampoline<>(SB) TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchownat(SB) - GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchownat_trampoline_addr(SB)/8, $libc_fchownat_trampoline<>(SB) TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_flock(SB) - GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $8 DATA ·libc_flock_trampoline_addr(SB)/8, $libc_flock_trampoline<>(SB) TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) - GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_fpathconf_trampoline_addr(SB)/8, $libc_fpathconf_trampoline<>(SB) TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) - GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstat_trampoline_addr(SB)/8, $libc_fstat_trampoline<>(SB) TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatat(SB) - GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatat_trampoline_addr(SB)/8, $libc_fstatat_trampoline<>(SB) TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatfs(SB) - GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatfs_trampoline_addr(SB)/8, $libc_fstatfs_trampoline<>(SB) TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) - GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $8 DATA ·libc_fsync_trampoline_addr(SB)/8, $libc_fsync_trampoline<>(SB) TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) - GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_ftruncate_trampoline_addr(SB)/8, $libc_ftruncate_trampoline<>(SB) TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getegid(SB) - GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getegid_trampoline_addr(SB)/8, $libc_getegid_trampoline<>(SB) TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_geteuid(SB) - GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_geteuid_trampoline_addr(SB)/8, $libc_geteuid_trampoline<>(SB) TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgid(SB) - GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgid_trampoline_addr(SB)/8, $libc_getgid_trampoline<>(SB) TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgid(SB) - GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgid_trampoline_addr(SB)/8, $libc_getpgid_trampoline<>(SB) TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgrp(SB) - GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgrp_trampoline_addr(SB)/8, $libc_getpgrp_trampoline<>(SB) TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpid(SB) - GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpid_trampoline_addr(SB)/8, $libc_getpid_trampoline<>(SB) TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getppid(SB) - GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getppid_trampoline_addr(SB)/8, $libc_getppid_trampoline<>(SB) TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpriority(SB) - GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpriority_trampoline_addr(SB)/8, $libc_getpriority_trampoline<>(SB) TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrlimit(SB) - GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrlimit_trampoline_addr(SB)/8, $libc_getrlimit_trampoline<>(SB) TEXT libc_getrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrtable(SB) - GLOBL ·libc_getrtable_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrtable_trampoline_addr(SB)/8, $libc_getrtable_trampoline<>(SB) TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrusage(SB) - GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrusage_trampoline_addr(SB)/8, $libc_getrusage_trampoline<>(SB) TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsid(SB) - GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsid_trampoline_addr(SB)/8, $libc_getsid_trampoline<>(SB) TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) - GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_gettimeofday_trampoline_addr(SB)/8, $libc_gettimeofday_trampoline<>(SB) TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getuid(SB) - GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getuid_trampoline_addr(SB)/8, $libc_getuid_trampoline<>(SB) TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_issetugid(SB) - GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $8 DATA ·libc_issetugid_trampoline_addr(SB)/8, $libc_issetugid_trampoline<>(SB) TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kill(SB) - GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $8 DATA ·libc_kill_trampoline_addr(SB)/8, $libc_kill_trampoline<>(SB) TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kqueue(SB) - GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $8 DATA ·libc_kqueue_trampoline_addr(SB)/8, $libc_kqueue_trampoline<>(SB) TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lchown(SB) - GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_lchown_trampoline_addr(SB)/8, $libc_lchown_trampoline<>(SB) TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_link(SB) - GLOBL ·libc_link_trampoline_addr(SB), RODATA, $8 DATA ·libc_link_trampoline_addr(SB)/8, $libc_link_trampoline<>(SB) TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_linkat(SB) - GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_linkat_trampoline_addr(SB)/8, $libc_linkat_trampoline<>(SB) TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_listen(SB) - GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $8 DATA ·libc_listen_trampoline_addr(SB)/8, $libc_listen_trampoline<>(SB) TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lstat(SB) - GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_lstat_trampoline_addr(SB)/8, $libc_lstat_trampoline<>(SB) TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) - GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdir_trampoline_addr(SB)/8, $libc_mkdir_trampoline<>(SB) TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdirat(SB) - GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdirat_trampoline_addr(SB)/8, $libc_mkdirat_trampoline<>(SB) TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifo(SB) - GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifo_trampoline_addr(SB)/8, $libc_mkfifo_trampoline<>(SB) TEXT libc_mkfifoat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifoat(SB) - GLOBL ·libc_mkfifoat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifoat_trampoline_addr(SB)/8, $libc_mkfifoat_trampoline<>(SB) TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknod(SB) - GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB) TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknodat(SB) - GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) - GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 DATA ·libc_nanosleep_trampoline_addr(SB)/8, $libc_nanosleep_trampoline<>(SB) TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_open(SB) - GLOBL ·libc_open_trampoline_addr(SB), RODATA, $8 DATA ·libc_open_trampoline_addr(SB)/8, $libc_open_trampoline<>(SB) TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_openat(SB) - GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $8 DATA ·libc_openat_trampoline_addr(SB)/8, $libc_openat_trampoline<>(SB) TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pathconf(SB) - GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_pathconf_trampoline_addr(SB)/8, $libc_pathconf_trampoline<>(SB) TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pread(SB) - GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $8 DATA ·libc_pread_trampoline_addr(SB)/8, $libc_pread_trampoline<>(SB) TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pwrite(SB) - GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) - GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 DATA ·libc_read_trampoline_addr(SB)/8, $libc_read_trampoline<>(SB) TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlink(SB) - GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlink_trampoline_addr(SB)/8, $libc_readlink_trampoline<>(SB) TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlinkat(SB) - GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlinkat_trampoline_addr(SB)/8, $libc_readlinkat_trampoline<>(SB) TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rename(SB) - GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $8 DATA ·libc_rename_trampoline_addr(SB)/8, $libc_rename_trampoline<>(SB) TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renameat(SB) - GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $8 DATA ·libc_renameat_trampoline_addr(SB)/8, $libc_renameat_trampoline<>(SB) TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_revoke(SB) - GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $8 DATA ·libc_revoke_trampoline_addr(SB)/8, $libc_revoke_trampoline<>(SB) TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rmdir(SB) - GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_rmdir_trampoline_addr(SB)/8, $libc_rmdir_trampoline<>(SB) TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lseek(SB) - GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $8 DATA ·libc_lseek_trampoline_addr(SB)/8, $libc_lseek_trampoline<>(SB) TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_select(SB) - GLOBL ·libc_select_trampoline_addr(SB), RODATA, $8 DATA ·libc_select_trampoline_addr(SB)/8, $libc_select_trampoline<>(SB) TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setegid(SB) - GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setegid_trampoline_addr(SB)/8, $libc_setegid_trampoline<>(SB) TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_seteuid(SB) - GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_seteuid_trampoline_addr(SB)/8, $libc_seteuid_trampoline<>(SB) TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgid(SB) - GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgid_trampoline_addr(SB)/8, $libc_setgid_trampoline<>(SB) TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setlogin(SB) - GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $8 DATA ·libc_setlogin_trampoline_addr(SB)/8, $libc_setlogin_trampoline<>(SB) TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpgid(SB) - GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpgid_trampoline_addr(SB)/8, $libc_setpgid_trampoline<>(SB) TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpriority(SB) - GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpriority_trampoline_addr(SB)/8, $libc_setpriority_trampoline<>(SB) TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setregid(SB) - GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setregid_trampoline_addr(SB)/8, $libc_setregid_trampoline<>(SB) TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setreuid(SB) - GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setreuid_trampoline_addr(SB)/8, $libc_setreuid_trampoline<>(SB) TEXT libc_setresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresgid(SB) - GLOBL ·libc_setresgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setresgid_trampoline_addr(SB)/8, $libc_setresgid_trampoline<>(SB) TEXT libc_setresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresuid(SB) - GLOBL ·libc_setresuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setresuid_trampoline_addr(SB)/8, $libc_setresuid_trampoline<>(SB) TEXT libc_setrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setrlimit(SB) - GLOBL ·libc_setrlimit_trampoline_addr(SB), RODATA, $8 DATA ·libc_setrlimit_trampoline_addr(SB)/8, $libc_setrlimit_trampoline<>(SB) TEXT libc_setrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setrtable(SB) - GLOBL ·libc_setrtable_trampoline_addr(SB), RODATA, $8 DATA ·libc_setrtable_trampoline_addr(SB)/8, $libc_setrtable_trampoline<>(SB) TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsid(SB) - GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsid_trampoline_addr(SB)/8, $libc_setsid_trampoline<>(SB) TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) - GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_settimeofday_trampoline_addr(SB)/8, $libc_settimeofday_trampoline<>(SB) TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) - GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setuid_trampoline_addr(SB)/8, $libc_setuid_trampoline<>(SB) TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_stat(SB) - GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $8 DATA ·libc_stat_trampoline_addr(SB)/8, $libc_stat_trampoline<>(SB) TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_statfs(SB) - GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_statfs_trampoline_addr(SB)/8, $libc_statfs_trampoline<>(SB) TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) - GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlink_trampoline_addr(SB)/8, $libc_symlink_trampoline<>(SB) TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlinkat(SB) - GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlinkat_trampoline_addr(SB)/8, $libc_symlinkat_trampoline<>(SB) TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sync(SB) - GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $8 DATA ·libc_sync_trampoline_addr(SB)/8, $libc_sync_trampoline<>(SB) TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_truncate(SB) - GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_truncate_trampoline_addr(SB)/8, $libc_truncate_trampoline<>(SB) TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_umask(SB) - GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $8 DATA ·libc_umask_trampoline_addr(SB)/8, $libc_umask_trampoline<>(SB) TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlink(SB) - GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlink_trampoline_addr(SB)/8, $libc_unlink_trampoline<>(SB) TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) - GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlinkat_trampoline_addr(SB)/8, $libc_unlinkat_trampoline<>(SB) TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unmount(SB) - GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $8 DATA ·libc_unmount_trampoline_addr(SB)/8, $libc_unmount_trampoline<>(SB) TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_write(SB) - GLOBL ·libc_write_trampoline_addr(SB), RODATA, $8 DATA ·libc_write_trampoline_addr(SB)/8, $libc_write_trampoline<>(SB) TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mmap(SB) - GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_mmap_trampoline_addr(SB)/8, $libc_mmap_trampoline<>(SB) TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munmap(SB) - GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) - GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go index 016d959bc66..6f33e37e723 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go @@ -1,4 +1,4 @@ -// go run mksyscall.go -openbsd -tags openbsd,mips64 syscall_bsd.go syscall_openbsd.go syscall_openbsd_mips64.go +// go run mksyscall.go -openbsd -libc -tags openbsd,mips64 syscall_bsd.go syscall_openbsd.go syscall_openbsd_mips64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build openbsd && mips64 @@ -16,7 +16,7 @@ var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { - r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + r0, _, e1 := syscall_rawSyscall(libc_getgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -24,20 +24,28 @@ func getgroups(ngid int, gid *_Gid_t) (n int, err error) { return } +var libc_getgroups_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getgroups getgroups "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { - _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + _, _, e1 := syscall_rawSyscall(libc_setgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_setgroups_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_setgroups setgroups "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { - r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) + r0, _, e1 := syscall_syscall6(libc_wait4_trampoline_addr, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -45,10 +53,14 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err return } +var libc_wait4_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_wait4 wait4 "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { - r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + r0, _, e1 := syscall_syscall(libc_accept_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -56,30 +68,42 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { return } +var libc_accept_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_accept accept "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { - _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) + _, _, e1 := syscall_syscall(libc_bind_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_bind_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_bind bind "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { - _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) + _, _, e1 := syscall_syscall(libc_connect_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_connect_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_connect connect "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { - r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + r0, _, e1 := syscall_rawSyscall(libc_socket_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -87,66 +111,94 @@ func socket(domain int, typ int, proto int) (fd int, err error) { return } +var libc_socket_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_socket socket "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { - _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + _, _, e1 := syscall_syscall6(libc_getsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_getsockopt_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getsockopt getsockopt "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { - _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) + _, _, e1 := syscall_syscall6(libc_setsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_setsockopt_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_setsockopt setsockopt "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { - _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := syscall_rawSyscall(libc_getpeername_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } +var libc_getpeername_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getpeername getpeername "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { - _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := syscall_rawSyscall(libc_getsockname_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } +var libc_getsockname_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getsockname getsockname "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { - _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) + _, _, e1 := syscall_syscall(libc_shutdown_trampoline_addr, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_shutdown_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_shutdown shutdown "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { - _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + _, _, e1 := syscall_rawSyscall6(libc_socketpair_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_socketpair_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_socketpair socketpair "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { @@ -156,7 +208,7 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + r0, _, e1 := syscall_syscall6(libc_recvfrom_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -164,6 +216,10 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl return } +var libc_recvfrom_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_recvfrom recvfrom "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { @@ -173,17 +229,21 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) ( } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) + _, _, e1 := syscall_syscall6(libc_sendto_trampoline_addr, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_sendto_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_sendto sendto "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { - r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + r0, _, e1 := syscall_syscall(libc_recvmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -191,10 +251,14 @@ func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { return } +var libc_recvmsg_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_recvmsg recvmsg "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { - r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + r0, _, e1 := syscall_syscall(libc_sendmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -202,10 +266,14 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { return } +var libc_sendmsg_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_sendmsg sendmsg "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { - r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) + r0, _, e1 := syscall_syscall6(libc_kevent_trampoline_addr, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -213,6 +281,10 @@ func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, ne return } +var libc_kevent_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_kevent kevent "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { @@ -221,27 +293,35 @@ func utimes(path string, timeval *[2]Timeval) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) + _, _, e1 := syscall_syscall(libc_utimes_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_utimes_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_utimes utimes "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { - _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) + _, _, e1 := syscall_syscall(libc_futimes_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_futimes_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_futimes futimes "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { - r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) + r0, _, e1 := syscall_syscall(libc_poll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -249,6 +329,10 @@ func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { return } +var libc_poll_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_poll poll "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { @@ -258,13 +342,17 @@ func Madvise(b []byte, behav int) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) + _, _, e1 := syscall_syscall(libc_madvise_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_madvise_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_madvise madvise "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { @@ -274,23 +362,31 @@ func Mlock(b []byte) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) + _, _, e1 := syscall_syscall(libc_mlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_mlock_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mlock mlock "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { - _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall(libc_mlockall_trampoline_addr, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_mlockall_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mlockall mlockall "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { @@ -300,13 +396,17 @@ func Mprotect(b []byte, prot int) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) + _, _, e1 := syscall_syscall(libc_mprotect_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_mprotect_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mprotect mprotect "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { @@ -316,13 +416,17 @@ func Msync(b []byte, flags int) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + _, _, e1 := syscall_syscall(libc_msync_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_msync_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_msync msync "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { @@ -332,33 +436,45 @@ func Munlock(b []byte) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) + _, _, e1 := syscall_syscall(libc_munlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_munlock_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_munlock munlock "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { - _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) + _, _, e1 := syscall_syscall(libc_munlockall_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_munlockall_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_munlockall munlockall "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { - _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) + _, _, e1 := syscall_rawSyscall(libc_pipe2_trampoline_addr, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_pipe2_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { @@ -368,7 +484,7 @@ func Getdents(fd int, buf []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf))) + r0, _, e1 := syscall_syscall(libc_getdents_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -376,6 +492,10 @@ func Getdents(fd int, buf []byte) (n int, err error) { return } +var libc_getdents_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getdents getdents "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { @@ -385,7 +505,7 @@ func Getcwd(buf []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0) + r0, _, e1 := syscall_syscall(libc_getcwd_trampoline_addr, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -393,16 +513,24 @@ func Getcwd(buf []byte) (n int, err error) { return } +var libc_getcwd_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getcwd getcwd "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { - _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) + _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_ioctl_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_ioctl ioctl "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { @@ -412,17 +540,21 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + _, _, e1 := syscall_syscall6(libc_sysctl_trampoline_addr, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_sysctl_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_sysctl sysctl "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { - r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) + r0, _, e1 := syscall_syscall6(libc_ppoll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -430,6 +562,10 @@ func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, return } +var libc_ppoll_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_ppoll ppoll "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { @@ -438,23 +574,31 @@ func Access(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(libc_access_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_access_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_access access "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { - _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) + _, _, e1 := syscall_syscall(libc_adjtime_trampoline_addr, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_adjtime_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_adjtime adjtime "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { @@ -463,13 +607,17 @@ func Chdir(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(libc_chdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_chdir_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_chdir chdir "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { @@ -478,13 +626,17 @@ func Chflags(path string, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + _, _, e1 := syscall_syscall(libc_chflags_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_chflags_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_chflags chflags "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { @@ -493,13 +645,17 @@ func Chmod(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(libc_chmod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_chmod_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_chmod chmod "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { @@ -508,13 +664,17 @@ func Chown(path string, uid int, gid int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + _, _, e1 := syscall_syscall(libc_chown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_chown_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_chown chown "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { @@ -523,27 +683,49 @@ func Chroot(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(libc_chroot_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_chroot_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_chroot chroot "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_clock_gettime_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_clock_gettime clock_gettime "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { - _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) + _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_close_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_close close "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { - r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) + r0, _, e1 := syscall_syscall(libc_dup_trampoline_addr, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -551,33 +733,49 @@ func Dup(fd int) (nfd int, err error) { return } +var libc_dup_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_dup dup "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { - _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) + _, _, e1 := syscall_syscall(libc_dup2_trampoline_addr, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_dup2_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_dup2 dup2 "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(from int, to int, flags int) (err error) { - _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) + _, _, e1 := syscall_syscall(libc_dup3_trampoline_addr, uintptr(from), uintptr(to), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_dup3_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_dup3 dup3 "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { - Syscall(SYS_EXIT, uintptr(code), 0, 0) + syscall_syscall(libc_exit_trampoline_addr, uintptr(code), 0, 0) return } +var libc_exit_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_exit exit "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { @@ -586,43 +784,59 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall6(libc_faccessat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_faccessat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_faccessat faccessat "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { - _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) + _, _, e1 := syscall_syscall(libc_fchdir_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_fchdir_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fchdir fchdir "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { - _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) + _, _, e1 := syscall_syscall(libc_fchflags_trampoline_addr, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_fchflags_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fchflags fchflags "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { - _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) + _, _, e1 := syscall_syscall(libc_fchmod_trampoline_addr, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_fchmod_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fchmod fchmod "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { @@ -631,23 +845,31 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall6(libc_fchmodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_fchmodat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fchmodat fchmodat "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { - _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) + _, _, e1 := syscall_syscall(libc_fchown_trampoline_addr, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_fchown_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fchown fchown "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { @@ -656,27 +878,35 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + _, _, e1 := syscall_syscall6(libc_fchownat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_fchownat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fchownat fchownat "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { - _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) + _, _, e1 := syscall_syscall(libc_flock_trampoline_addr, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_flock_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_flock flock "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) + r0, _, e1 := syscall_syscall(libc_fpathconf_trampoline_addr, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -684,16 +914,24 @@ func Fpathconf(fd int, name int) (val int, err error) { return } +var libc_fpathconf_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fpathconf fpathconf "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { - _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + _, _, e1 := syscall_syscall(libc_fstat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_fstat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fstat fstat "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { @@ -702,71 +940,99 @@ func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall6(libc_fstatat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_fstatat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fstatat fstatat "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { - _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + _, _, e1 := syscall_syscall(libc_fstatfs_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_fstatfs_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fstatfs fstatfs "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { - _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) + _, _, e1 := syscall_syscall(libc_fsync_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_fsync_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fsync fsync "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { - _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length)) + _, _, e1 := syscall_syscall(libc_ftruncate_trampoline_addr, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_ftruncate_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_ftruncate ftruncate "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { - r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(libc_getegid_trampoline_addr, 0, 0, 0) egid = int(r0) return } +var libc_getegid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getegid getegid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { - r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(libc_geteuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } +var libc_geteuid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_geteuid geteuid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { - r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(libc_getgid_trampoline_addr, 0, 0, 0) gid = int(r0) return } +var libc_getgid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getgid getgid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { - r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) + r0, _, e1 := syscall_rawSyscall(libc_getpgid_trampoline_addr, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -774,34 +1040,50 @@ func Getpgid(pid int) (pgid int, err error) { return } +var libc_getpgid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getpgid getpgid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { - r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(libc_getpgrp_trampoline_addr, 0, 0, 0) pgrp = int(r0) return } +var libc_getpgrp_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getpgrp getpgrp "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { - r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(libc_getpid_trampoline_addr, 0, 0, 0) pid = int(r0) return } +var libc_getpid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getpid getpid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { - r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(libc_getppid_trampoline_addr, 0, 0, 0) ppid = int(r0) return } +var libc_getppid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getppid getppid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { - r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) + r0, _, e1 := syscall_syscall(libc_getpriority_trampoline_addr, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -809,20 +1091,28 @@ func Getpriority(which int, who int) (prio int, err error) { return } +var libc_getpriority_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getpriority getpriority "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { - _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := syscall_rawSyscall(libc_getrlimit_trampoline_addr, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_getrlimit_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getrlimit getrlimit "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrtable() (rtable int, err error) { - r0, _, e1 := RawSyscall(SYS_GETRTABLE, 0, 0, 0) + r0, _, e1 := syscall_rawSyscall(libc_getrtable_trampoline_addr, 0, 0, 0) rtable = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -830,20 +1120,28 @@ func Getrtable() (rtable int, err error) { return } +var libc_getrtable_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getrtable getrtable "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { - _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + _, _, e1 := syscall_rawSyscall(libc_getrusage_trampoline_addr, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_getrusage_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getrusage getrusage "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { - r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) + r0, _, e1 := syscall_rawSyscall(libc_getsid_trampoline_addr, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -851,46 +1149,66 @@ func Getsid(pid int) (sid int, err error) { return } +var libc_getsid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getsid getsid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { - _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) + _, _, e1 := syscall_rawSyscall(libc_gettimeofday_trampoline_addr, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_gettimeofday_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_gettimeofday gettimeofday "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { - r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(libc_getuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } +var libc_getuid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getuid getuid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { - r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) + r0, _, _ := syscall_syscall(libc_issetugid_trampoline_addr, 0, 0, 0) tainted = bool(r0 != 0) return } +var libc_issetugid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_issetugid issetugid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { - _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0) + _, _, e1 := syscall_syscall(libc_kill_trampoline_addr, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_kill_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_kill kill "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { - r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) + r0, _, e1 := syscall_syscall(libc_kqueue_trampoline_addr, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -898,6 +1216,10 @@ func Kqueue() (fd int, err error) { return } +var libc_kqueue_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_kqueue kqueue "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { @@ -906,13 +1228,17 @@ func Lchown(path string, uid int, gid int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + _, _, e1 := syscall_syscall(libc_lchown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_lchown_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_lchown lchown "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { @@ -926,13 +1252,17 @@ func Link(path string, link string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + _, _, e1 := syscall_syscall(libc_link_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_link_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_link link "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { @@ -946,23 +1276,31 @@ func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err er if err != nil { return } - _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + _, _, e1 := syscall_syscall6(libc_linkat_trampoline_addr, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_linkat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_linkat linkat "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { - _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) + _, _, e1 := syscall_syscall(libc_listen_trampoline_addr, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_listen_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_listen listen "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { @@ -971,13 +1309,17 @@ func Lstat(path string, stat *Stat_t) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + _, _, e1 := syscall_syscall(libc_lstat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_lstat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_lstat lstat "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { @@ -986,13 +1328,17 @@ func Mkdir(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(libc_mkdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_mkdir_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mkdir mkdir "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { @@ -1001,13 +1347,17 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + _, _, e1 := syscall_syscall(libc_mkdirat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_mkdirat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mkdirat mkdirat "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { @@ -1016,13 +1366,17 @@ func Mkfifo(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(libc_mkfifo_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_mkfifo_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mkfifo mkfifo "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifoat(dirfd int, path string, mode uint32) (err error) { @@ -1031,13 +1385,17 @@ func Mkfifoat(dirfd int, path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKFIFOAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + _, _, e1 := syscall_syscall(libc_mkfifoat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_mkfifoat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mkfifoat mkfifoat "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { @@ -1046,13 +1404,17 @@ func Mknod(path string, mode uint32, dev int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) + _, _, e1 := syscall_syscall(libc_mknod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_mknod_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mknod mknod "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { @@ -1061,23 +1423,31 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + _, _, e1 := syscall_syscall6(libc_mknodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_mknodat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mknodat mknodat "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { - _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) + _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_nanosleep_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_nanosleep nanosleep "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { @@ -1086,7 +1456,7 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { if err != nil { return } - r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) + r0, _, e1 := syscall_syscall(libc_open_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1094,6 +1464,10 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } +var libc_open_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_open open "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { @@ -1102,7 +1476,7 @@ func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { if err != nil { return } - r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + r0, _, e1 := syscall_syscall6(libc_openat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1110,6 +1484,10 @@ func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { return } +var libc_openat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_openat openat "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { @@ -1118,7 +1496,7 @@ func Pathconf(path string, name int) (val int, err error) { if err != nil { return } - r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) + r0, _, e1 := syscall_syscall(libc_pathconf_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1126,6 +1504,10 @@ func Pathconf(path string, name int) (val int, err error) { return } +var libc_pathconf_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pathconf pathconf "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { @@ -1135,7 +1517,7 @@ func pread(fd int, p []byte, offset int64) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0) + r0, _, e1 := syscall_syscall6(libc_pread_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1143,6 +1525,10 @@ func pread(fd int, p []byte, offset int64) (n int, err error) { return } +var libc_pread_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pread pread "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { @@ -1152,7 +1538,7 @@ func pwrite(fd int, p []byte, offset int64) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0) + r0, _, e1 := syscall_syscall6(libc_pwrite_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1160,6 +1546,10 @@ func pwrite(fd int, p []byte, offset int64) (n int, err error) { return } +var libc_pwrite_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwrite pwrite "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { @@ -1169,7 +1559,7 @@ func read(fd int, p []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) + r0, _, e1 := syscall_syscall(libc_read_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1177,6 +1567,10 @@ func read(fd int, p []byte) (n int, err error) { return } +var libc_read_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_read read "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { @@ -1191,7 +1585,7 @@ func Readlink(path string, buf []byte) (n int, err error) { } else { _p1 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) + r0, _, e1 := syscall_syscall(libc_readlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1199,6 +1593,10 @@ func Readlink(path string, buf []byte) (n int, err error) { return } +var libc_readlink_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readlink readlink "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { @@ -1213,7 +1611,7 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { } else { _p1 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) + r0, _, e1 := syscall_syscall6(libc_readlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1221,6 +1619,10 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { return } +var libc_readlinkat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readlinkat readlinkat "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { @@ -1234,13 +1636,17 @@ func Rename(from string, to string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + _, _, e1 := syscall_syscall(libc_rename_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_rename_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_rename rename "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { @@ -1254,13 +1660,17 @@ func Renameat(fromfd int, from string, tofd int, to string) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) + _, _, e1 := syscall_syscall6(libc_renameat_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_renameat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_renameat renameat "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { @@ -1269,13 +1679,17 @@ func Revoke(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(libc_revoke_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_revoke_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_revoke revoke "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { @@ -1284,17 +1698,21 @@ func Rmdir(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(libc_rmdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_rmdir_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_rmdir rmdir "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { - r0, _, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(whence), 0, 0) + r0, _, e1 := syscall_syscall(libc_lseek_trampoline_addr, uintptr(fd), uintptr(offset), uintptr(whence)) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) @@ -1302,10 +1720,14 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { return } +var libc_lseek_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_lseek lseek "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { - r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) + r0, _, e1 := syscall_syscall6(libc_select_trampoline_addr, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1313,36 +1735,52 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err return } +var libc_select_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_select select "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) + _, _, e1 := syscall_rawSyscall(libc_setegid_trampoline_addr, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_setegid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_setegid setegid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) + _, _, e1 := syscall_rawSyscall(libc_seteuid_trampoline_addr, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_seteuid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_seteuid seteuid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) + _, _, e1 := syscall_rawSyscall(libc_setgid_trampoline_addr, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_setgid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_setgid setgid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { @@ -1351,97 +1789,133 @@ func Setlogin(name string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(libc_setlogin_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_setlogin_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_setlogin setlogin "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + _, _, e1 := syscall_rawSyscall(libc_setpgid_trampoline_addr, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_setpgid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_setpgid setpgid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { - _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) + _, _, e1 := syscall_syscall(libc_setpriority_trampoline_addr, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_setpriority_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_setpriority setpriority "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + _, _, e1 := syscall_rawSyscall(libc_setregid_trampoline_addr, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_setregid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_setregid setregid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + _, _, e1 := syscall_rawSyscall(libc_setreuid_trampoline_addr, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_setreuid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_setreuid setreuid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) + _, _, e1 := syscall_rawSyscall(libc_setresgid_trampoline_addr, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_setresgid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_setresgid setresgid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) + _, _, e1 := syscall_rawSyscall(libc_setresuid_trampoline_addr, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_setresuid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_setresuid setresuid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(which int, lim *Rlimit) (err error) { - _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := syscall_rawSyscall(libc_setrlimit_trampoline_addr, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_setrlimit_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_setrlimit setrlimit "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrtable(rtable int) (err error) { - _, _, e1 := RawSyscall(SYS_SETRTABLE, uintptr(rtable), 0, 0) + _, _, e1 := syscall_rawSyscall(libc_setrtable_trampoline_addr, uintptr(rtable), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_setrtable_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_setrtable setrtable "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { - r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) + r0, _, e1 := syscall_rawSyscall(libc_setsid_trampoline_addr, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1449,26 +1923,38 @@ func Setsid() (pid int, err error) { return } +var libc_setsid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_setsid setsid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { - _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + _, _, e1 := syscall_rawSyscall(libc_settimeofday_trampoline_addr, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_settimeofday_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_settimeofday settimeofday "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) + _, _, e1 := syscall_rawSyscall(libc_setuid_trampoline_addr, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_setuid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_setuid setuid "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { @@ -1477,13 +1963,17 @@ func Stat(path string, stat *Stat_t) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + _, _, e1 := syscall_syscall(libc_stat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_stat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_stat stat "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { @@ -1492,13 +1982,17 @@ func Statfs(path string, stat *Statfs_t) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + _, _, e1 := syscall_syscall(libc_statfs_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_statfs_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_statfs statfs "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { @@ -1512,13 +2006,17 @@ func Symlink(path string, link string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + _, _, e1 := syscall_syscall(libc_symlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_symlink_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_symlink symlink "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { @@ -1532,23 +2030,31 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + _, _, e1 := syscall_syscall(libc_symlinkat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } +var libc_symlinkat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_symlinkat symlinkat "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { - _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) + _, _, e1 := syscall_syscall(libc_sync_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_sync_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_sync sync "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { @@ -1557,21 +2063,29 @@ func Truncate(path string, length int64) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length)) + _, _, e1 := syscall_syscall(libc_truncate_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_truncate_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_truncate truncate "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { - r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) + r0, _, _ := syscall_syscall(libc_umask_trampoline_addr, uintptr(newmask), 0, 0) oldmask = int(r0) return } +var libc_umask_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_umask umask "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { @@ -1580,13 +2094,17 @@ func Unlink(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(libc_unlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_unlink_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_unlink unlink "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { @@ -1595,13 +2113,17 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + _, _, e1 := syscall_syscall(libc_unlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } +var libc_unlinkat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_unlinkat unlinkat "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { @@ -1610,13 +2132,17 @@ func Unmount(path string, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + _, _, e1 := syscall_syscall(libc_unmount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_unmount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_unmount unmount "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { @@ -1626,7 +2152,7 @@ func write(fd int, p []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) + r0, _, e1 := syscall_syscall(libc_write_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1634,10 +2160,14 @@ func write(fd int, p []byte) (n int, err error) { return } +var libc_write_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_write write "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { - r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0) + r0, _, e1 := syscall_syscall6(libc_mmap_trampoline_addr, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) @@ -1645,20 +2175,28 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) ( return } +var libc_mmap_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mmap mmap "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { - _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + _, _, e1 := syscall_syscall(libc_munmap_trampoline_addr, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } +var libc_munmap_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_munmap munmap "libc.so" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readlen(fd int, buf *byte, nbuf int) (n int, err error) { - r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + r0, _, e1 := syscall_syscall(libc_read_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1669,7 +2207,7 @@ func readlen(fd int, buf *byte, nbuf int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writelen(fd int, buf *byte, nbuf int) (n int, err error) { - r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + r0, _, e1 := syscall_syscall(libc_write_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1685,9 +2223,13 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error if err != nil { return } - _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall6(libc_utimensat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } + +var libc_utimensat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_utimensat utimensat "libc.so" diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s new file mode 100644 index 00000000000..55af27263ad --- /dev/null +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s @@ -0,0 +1,669 @@ +// go run mkasm.go openbsd mips64 +// Code generated by the command above; DO NOT EDIT. + +#include "textflag.h" + +TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getgroups(SB) +GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getgroups_trampoline_addr(SB)/8, $libc_getgroups_trampoline<>(SB) + +TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_setgroups(SB) +GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $8 +DATA ·libc_setgroups_trampoline_addr(SB)/8, $libc_setgroups_trampoline<>(SB) + +TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_wait4(SB) +GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $8 +DATA ·libc_wait4_trampoline_addr(SB)/8, $libc_wait4_trampoline<>(SB) + +TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_accept(SB) +GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $8 +DATA ·libc_accept_trampoline_addr(SB)/8, $libc_accept_trampoline<>(SB) + +TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_bind(SB) +GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $8 +DATA ·libc_bind_trampoline_addr(SB)/8, $libc_bind_trampoline<>(SB) + +TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_connect(SB) +GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $8 +DATA ·libc_connect_trampoline_addr(SB)/8, $libc_connect_trampoline<>(SB) + +TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_socket(SB) +GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $8 +DATA ·libc_socket_trampoline_addr(SB)/8, $libc_socket_trampoline<>(SB) + +TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getsockopt(SB) +GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getsockopt_trampoline_addr(SB)/8, $libc_getsockopt_trampoline<>(SB) + +TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_setsockopt(SB) +GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $8 +DATA ·libc_setsockopt_trampoline_addr(SB)/8, $libc_setsockopt_trampoline<>(SB) + +TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getpeername(SB) +GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getpeername_trampoline_addr(SB)/8, $libc_getpeername_trampoline<>(SB) + +TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getsockname(SB) +GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getsockname_trampoline_addr(SB)/8, $libc_getsockname_trampoline<>(SB) + +TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_shutdown(SB) +GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $8 +DATA ·libc_shutdown_trampoline_addr(SB)/8, $libc_shutdown_trampoline<>(SB) + +TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_socketpair(SB) +GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $8 +DATA ·libc_socketpair_trampoline_addr(SB)/8, $libc_socketpair_trampoline<>(SB) + +TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_recvfrom(SB) +GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $8 +DATA ·libc_recvfrom_trampoline_addr(SB)/8, $libc_recvfrom_trampoline<>(SB) + +TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_sendto(SB) +GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $8 +DATA ·libc_sendto_trampoline_addr(SB)/8, $libc_sendto_trampoline<>(SB) + +TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_recvmsg(SB) +GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $8 +DATA ·libc_recvmsg_trampoline_addr(SB)/8, $libc_recvmsg_trampoline<>(SB) + +TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_sendmsg(SB) +GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $8 +DATA ·libc_sendmsg_trampoline_addr(SB)/8, $libc_sendmsg_trampoline<>(SB) + +TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_kevent(SB) +GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $8 +DATA ·libc_kevent_trampoline_addr(SB)/8, $libc_kevent_trampoline<>(SB) + +TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_utimes(SB) +GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $8 +DATA ·libc_utimes_trampoline_addr(SB)/8, $libc_utimes_trampoline<>(SB) + +TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_futimes(SB) +GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $8 +DATA ·libc_futimes_trampoline_addr(SB)/8, $libc_futimes_trampoline<>(SB) + +TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_poll(SB) +GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $8 +DATA ·libc_poll_trampoline_addr(SB)/8, $libc_poll_trampoline<>(SB) + +TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_madvise(SB) +GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $8 +DATA ·libc_madvise_trampoline_addr(SB)/8, $libc_madvise_trampoline<>(SB) + +TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mlock(SB) +GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mlock_trampoline_addr(SB)/8, $libc_mlock_trampoline<>(SB) + +TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mlockall(SB) +GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mlockall_trampoline_addr(SB)/8, $libc_mlockall_trampoline<>(SB) + +TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mprotect(SB) +GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mprotect_trampoline_addr(SB)/8, $libc_mprotect_trampoline<>(SB) + +TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_msync(SB) +GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $8 +DATA ·libc_msync_trampoline_addr(SB)/8, $libc_msync_trampoline<>(SB) + +TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_munlock(SB) +GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $8 +DATA ·libc_munlock_trampoline_addr(SB)/8, $libc_munlock_trampoline<>(SB) + +TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_munlockall(SB) +GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $8 +DATA ·libc_munlockall_trampoline_addr(SB)/8, $libc_munlockall_trampoline<>(SB) + +TEXT libc_pipe2_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pipe2(SB) +GLOBL ·libc_pipe2_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pipe2_trampoline_addr(SB)/8, $libc_pipe2_trampoline<>(SB) + +TEXT libc_getdents_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getdents(SB) +GLOBL ·libc_getdents_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getdents_trampoline_addr(SB)/8, $libc_getdents_trampoline<>(SB) + +TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getcwd(SB) +GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) + +TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_ioctl(SB) +GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 +DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) + +TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_sysctl(SB) +GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 +DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) + +TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_ppoll(SB) +GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $8 +DATA ·libc_ppoll_trampoline_addr(SB)/8, $libc_ppoll_trampoline<>(SB) + +TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_access(SB) +GLOBL ·libc_access_trampoline_addr(SB), RODATA, $8 +DATA ·libc_access_trampoline_addr(SB)/8, $libc_access_trampoline<>(SB) + +TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_adjtime(SB) +GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $8 +DATA ·libc_adjtime_trampoline_addr(SB)/8, $libc_adjtime_trampoline<>(SB) + +TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_chdir(SB) +GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $8 +DATA ·libc_chdir_trampoline_addr(SB)/8, $libc_chdir_trampoline<>(SB) + +TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_chflags(SB) +GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $8 +DATA ·libc_chflags_trampoline_addr(SB)/8, $libc_chflags_trampoline<>(SB) + +TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_chmod(SB) +GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $8 +DATA ·libc_chmod_trampoline_addr(SB)/8, $libc_chmod_trampoline<>(SB) + +TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_chown(SB) +GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $8 +DATA ·libc_chown_trampoline_addr(SB)/8, $libc_chown_trampoline<>(SB) + +TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_chroot(SB) +GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $8 +DATA ·libc_chroot_trampoline_addr(SB)/8, $libc_chroot_trampoline<>(SB) + +TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_clock_gettime(SB) +GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $8 +DATA ·libc_clock_gettime_trampoline_addr(SB)/8, $libc_clock_gettime_trampoline<>(SB) + +TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_close(SB) +GLOBL ·libc_close_trampoline_addr(SB), RODATA, $8 +DATA ·libc_close_trampoline_addr(SB)/8, $libc_close_trampoline<>(SB) + +TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_dup(SB) +GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $8 +DATA ·libc_dup_trampoline_addr(SB)/8, $libc_dup_trampoline<>(SB) + +TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_dup2(SB) +GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $8 +DATA ·libc_dup2_trampoline_addr(SB)/8, $libc_dup2_trampoline<>(SB) + +TEXT libc_dup3_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_dup3(SB) +GLOBL ·libc_dup3_trampoline_addr(SB), RODATA, $8 +DATA ·libc_dup3_trampoline_addr(SB)/8, $libc_dup3_trampoline<>(SB) + +TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_exit(SB) +GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $8 +DATA ·libc_exit_trampoline_addr(SB)/8, $libc_exit_trampoline<>(SB) + +TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_faccessat(SB) +GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_faccessat_trampoline_addr(SB)/8, $libc_faccessat_trampoline<>(SB) + +TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fchdir(SB) +GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $8 +DATA ·libc_fchdir_trampoline_addr(SB)/8, $libc_fchdir_trampoline<>(SB) + +TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fchflags(SB) +GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $8 +DATA ·libc_fchflags_trampoline_addr(SB)/8, $libc_fchflags_trampoline<>(SB) + +TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fchmod(SB) +GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $8 +DATA ·libc_fchmod_trampoline_addr(SB)/8, $libc_fchmod_trampoline<>(SB) + +TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fchmodat(SB) +GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_fchmodat_trampoline_addr(SB)/8, $libc_fchmodat_trampoline<>(SB) + +TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fchown(SB) +GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $8 +DATA ·libc_fchown_trampoline_addr(SB)/8, $libc_fchown_trampoline<>(SB) + +TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fchownat(SB) +GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_fchownat_trampoline_addr(SB)/8, $libc_fchownat_trampoline<>(SB) + +TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_flock(SB) +GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $8 +DATA ·libc_flock_trampoline_addr(SB)/8, $libc_flock_trampoline<>(SB) + +TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fpathconf(SB) +GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $8 +DATA ·libc_fpathconf_trampoline_addr(SB)/8, $libc_fpathconf_trampoline<>(SB) + +TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fstat(SB) +GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_fstat_trampoline_addr(SB)/8, $libc_fstat_trampoline<>(SB) + +TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fstatat(SB) +GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_fstatat_trampoline_addr(SB)/8, $libc_fstatat_trampoline<>(SB) + +TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fstatfs(SB) +GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $8 +DATA ·libc_fstatfs_trampoline_addr(SB)/8, $libc_fstatfs_trampoline<>(SB) + +TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fsync(SB) +GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $8 +DATA ·libc_fsync_trampoline_addr(SB)/8, $libc_fsync_trampoline<>(SB) + +TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_ftruncate(SB) +GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $8 +DATA ·libc_ftruncate_trampoline_addr(SB)/8, $libc_ftruncate_trampoline<>(SB) + +TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getegid(SB) +GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getegid_trampoline_addr(SB)/8, $libc_getegid_trampoline<>(SB) + +TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_geteuid(SB) +GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_geteuid_trampoline_addr(SB)/8, $libc_geteuid_trampoline<>(SB) + +TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getgid(SB) +GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getgid_trampoline_addr(SB)/8, $libc_getgid_trampoline<>(SB) + +TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getpgid(SB) +GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getpgid_trampoline_addr(SB)/8, $libc_getpgid_trampoline<>(SB) + +TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getpgrp(SB) +GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getpgrp_trampoline_addr(SB)/8, $libc_getpgrp_trampoline<>(SB) + +TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getpid(SB) +GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getpid_trampoline_addr(SB)/8, $libc_getpid_trampoline<>(SB) + +TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getppid(SB) +GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getppid_trampoline_addr(SB)/8, $libc_getppid_trampoline<>(SB) + +TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getpriority(SB) +GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getpriority_trampoline_addr(SB)/8, $libc_getpriority_trampoline<>(SB) + +TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getrlimit(SB) +GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getrlimit_trampoline_addr(SB)/8, $libc_getrlimit_trampoline<>(SB) + +TEXT libc_getrtable_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getrtable(SB) +GLOBL ·libc_getrtable_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getrtable_trampoline_addr(SB)/8, $libc_getrtable_trampoline<>(SB) + +TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getrusage(SB) +GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getrusage_trampoline_addr(SB)/8, $libc_getrusage_trampoline<>(SB) + +TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getsid(SB) +GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getsid_trampoline_addr(SB)/8, $libc_getsid_trampoline<>(SB) + +TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_gettimeofday(SB) +GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $8 +DATA ·libc_gettimeofday_trampoline_addr(SB)/8, $libc_gettimeofday_trampoline<>(SB) + +TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getuid(SB) +GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getuid_trampoline_addr(SB)/8, $libc_getuid_trampoline<>(SB) + +TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_issetugid(SB) +GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_issetugid_trampoline_addr(SB)/8, $libc_issetugid_trampoline<>(SB) + +TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_kill(SB) +GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $8 +DATA ·libc_kill_trampoline_addr(SB)/8, $libc_kill_trampoline<>(SB) + +TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_kqueue(SB) +GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $8 +DATA ·libc_kqueue_trampoline_addr(SB)/8, $libc_kqueue_trampoline<>(SB) + +TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_lchown(SB) +GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $8 +DATA ·libc_lchown_trampoline_addr(SB)/8, $libc_lchown_trampoline<>(SB) + +TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_link(SB) +GLOBL ·libc_link_trampoline_addr(SB), RODATA, $8 +DATA ·libc_link_trampoline_addr(SB)/8, $libc_link_trampoline<>(SB) + +TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_linkat(SB) +GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_linkat_trampoline_addr(SB)/8, $libc_linkat_trampoline<>(SB) + +TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_listen(SB) +GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $8 +DATA ·libc_listen_trampoline_addr(SB)/8, $libc_listen_trampoline<>(SB) + +TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_lstat(SB) +GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_lstat_trampoline_addr(SB)/8, $libc_lstat_trampoline<>(SB) + +TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mkdir(SB) +GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mkdir_trampoline_addr(SB)/8, $libc_mkdir_trampoline<>(SB) + +TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mkdirat(SB) +GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mkdirat_trampoline_addr(SB)/8, $libc_mkdirat_trampoline<>(SB) + +TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mkfifo(SB) +GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mkfifo_trampoline_addr(SB)/8, $libc_mkfifo_trampoline<>(SB) + +TEXT libc_mkfifoat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mkfifoat(SB) +GLOBL ·libc_mkfifoat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mkfifoat_trampoline_addr(SB)/8, $libc_mkfifoat_trampoline<>(SB) + +TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mknod(SB) +GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB) + +TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mknodat(SB) +GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) + +TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_nanosleep(SB) +GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 +DATA ·libc_nanosleep_trampoline_addr(SB)/8, $libc_nanosleep_trampoline<>(SB) + +TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_open(SB) +GLOBL ·libc_open_trampoline_addr(SB), RODATA, $8 +DATA ·libc_open_trampoline_addr(SB)/8, $libc_open_trampoline<>(SB) + +TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_openat(SB) +GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_openat_trampoline_addr(SB)/8, $libc_openat_trampoline<>(SB) + +TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pathconf(SB) +GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pathconf_trampoline_addr(SB)/8, $libc_pathconf_trampoline<>(SB) + +TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pread(SB) +GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pread_trampoline_addr(SB)/8, $libc_pread_trampoline<>(SB) + +TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwrite(SB) +GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) + +TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_read(SB) +GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 +DATA ·libc_read_trampoline_addr(SB)/8, $libc_read_trampoline<>(SB) + +TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readlink(SB) +GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readlink_trampoline_addr(SB)/8, $libc_readlink_trampoline<>(SB) + +TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readlinkat(SB) +GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readlinkat_trampoline_addr(SB)/8, $libc_readlinkat_trampoline<>(SB) + +TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_rename(SB) +GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $8 +DATA ·libc_rename_trampoline_addr(SB)/8, $libc_rename_trampoline<>(SB) + +TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_renameat(SB) +GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_renameat_trampoline_addr(SB)/8, $libc_renameat_trampoline<>(SB) + +TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_revoke(SB) +GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $8 +DATA ·libc_revoke_trampoline_addr(SB)/8, $libc_revoke_trampoline<>(SB) + +TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_rmdir(SB) +GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $8 +DATA ·libc_rmdir_trampoline_addr(SB)/8, $libc_rmdir_trampoline<>(SB) + +TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_lseek(SB) +GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $8 +DATA ·libc_lseek_trampoline_addr(SB)/8, $libc_lseek_trampoline<>(SB) + +TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_select(SB) +GLOBL ·libc_select_trampoline_addr(SB), RODATA, $8 +DATA ·libc_select_trampoline_addr(SB)/8, $libc_select_trampoline<>(SB) + +TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_setegid(SB) +GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_setegid_trampoline_addr(SB)/8, $libc_setegid_trampoline<>(SB) + +TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_seteuid(SB) +GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_seteuid_trampoline_addr(SB)/8, $libc_seteuid_trampoline<>(SB) + +TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_setgid(SB) +GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_setgid_trampoline_addr(SB)/8, $libc_setgid_trampoline<>(SB) + +TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_setlogin(SB) +GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $8 +DATA ·libc_setlogin_trampoline_addr(SB)/8, $libc_setlogin_trampoline<>(SB) + +TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_setpgid(SB) +GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_setpgid_trampoline_addr(SB)/8, $libc_setpgid_trampoline<>(SB) + +TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_setpriority(SB) +GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $8 +DATA ·libc_setpriority_trampoline_addr(SB)/8, $libc_setpriority_trampoline<>(SB) + +TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_setregid(SB) +GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_setregid_trampoline_addr(SB)/8, $libc_setregid_trampoline<>(SB) + +TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_setreuid(SB) +GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_setreuid_trampoline_addr(SB)/8, $libc_setreuid_trampoline<>(SB) + +TEXT libc_setresgid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_setresgid(SB) +GLOBL ·libc_setresgid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_setresgid_trampoline_addr(SB)/8, $libc_setresgid_trampoline<>(SB) + +TEXT libc_setresuid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_setresuid(SB) +GLOBL ·libc_setresuid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_setresuid_trampoline_addr(SB)/8, $libc_setresuid_trampoline<>(SB) + +TEXT libc_setrlimit_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_setrlimit(SB) +GLOBL ·libc_setrlimit_trampoline_addr(SB), RODATA, $8 +DATA ·libc_setrlimit_trampoline_addr(SB)/8, $libc_setrlimit_trampoline<>(SB) + +TEXT libc_setrtable_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_setrtable(SB) +GLOBL ·libc_setrtable_trampoline_addr(SB), RODATA, $8 +DATA ·libc_setrtable_trampoline_addr(SB)/8, $libc_setrtable_trampoline<>(SB) + +TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_setsid(SB) +GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_setsid_trampoline_addr(SB)/8, $libc_setsid_trampoline<>(SB) + +TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_settimeofday(SB) +GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $8 +DATA ·libc_settimeofday_trampoline_addr(SB)/8, $libc_settimeofday_trampoline<>(SB) + +TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_setuid(SB) +GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_setuid_trampoline_addr(SB)/8, $libc_setuid_trampoline<>(SB) + +TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_stat(SB) +GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_stat_trampoline_addr(SB)/8, $libc_stat_trampoline<>(SB) + +TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_statfs(SB) +GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $8 +DATA ·libc_statfs_trampoline_addr(SB)/8, $libc_statfs_trampoline<>(SB) + +TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_symlink(SB) +GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $8 +DATA ·libc_symlink_trampoline_addr(SB)/8, $libc_symlink_trampoline<>(SB) + +TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_symlinkat(SB) +GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_symlinkat_trampoline_addr(SB)/8, $libc_symlinkat_trampoline<>(SB) + +TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_sync(SB) +GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $8 +DATA ·libc_sync_trampoline_addr(SB)/8, $libc_sync_trampoline<>(SB) + +TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_truncate(SB) +GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $8 +DATA ·libc_truncate_trampoline_addr(SB)/8, $libc_truncate_trampoline<>(SB) + +TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_umask(SB) +GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $8 +DATA ·libc_umask_trampoline_addr(SB)/8, $libc_umask_trampoline<>(SB) + +TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_unlink(SB) +GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $8 +DATA ·libc_unlink_trampoline_addr(SB)/8, $libc_unlink_trampoline<>(SB) + +TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_unlinkat(SB) +GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_unlinkat_trampoline_addr(SB)/8, $libc_unlinkat_trampoline<>(SB) + +TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_unmount(SB) +GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_unmount_trampoline_addr(SB)/8, $libc_unmount_trampoline<>(SB) + +TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_write(SB) +GLOBL ·libc_write_trampoline_addr(SB), RODATA, $8 +DATA ·libc_write_trampoline_addr(SB)/8, $libc_write_trampoline<>(SB) + +TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mmap(SB) +GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mmap_trampoline_addr(SB)/8, $libc_mmap_trampoline<>(SB) + +TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_munmap(SB) +GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 +DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) + +TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_utimensat(SB) +GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go index c85de2d9766..330cf7f7ac6 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go @@ -696,6 +696,20 @@ var libc_chroot_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_clock_gettime_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_clock_gettime clock_gettime "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s index 7c9223b6418..4028255b0d5 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s @@ -249,6 +249,12 @@ TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $8 DATA ·libc_chroot_trampoline_addr(SB)/8, $libc_chroot_trampoline<>(SB) +TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_clock_gettime(SB) + RET +GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $8 +DATA ·libc_clock_gettime_trampoline_addr(SB)/8, $libc_clock_gettime_trampoline<>(SB) + TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_close(SB) RET diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go index 8e3e7873f89..5f24de0d9d7 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go @@ -696,6 +696,20 @@ var libc_chroot_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_clock_gettime_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_clock_gettime clock_gettime "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s index 7dba789271c..e1fbd4dfa8c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s @@ -5,792 +5,665 @@ TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgroups(SB) - GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgroups_trampoline_addr(SB)/8, $libc_getgroups_trampoline<>(SB) TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgroups(SB) - GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgroups_trampoline_addr(SB)/8, $libc_setgroups_trampoline<>(SB) TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_wait4(SB) - GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $8 DATA ·libc_wait4_trampoline_addr(SB)/8, $libc_wait4_trampoline<>(SB) TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_accept(SB) - GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $8 DATA ·libc_accept_trampoline_addr(SB)/8, $libc_accept_trampoline<>(SB) TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_bind(SB) - GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $8 DATA ·libc_bind_trampoline_addr(SB)/8, $libc_bind_trampoline<>(SB) TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_connect(SB) - GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $8 DATA ·libc_connect_trampoline_addr(SB)/8, $libc_connect_trampoline<>(SB) TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socket(SB) - GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $8 DATA ·libc_socket_trampoline_addr(SB)/8, $libc_socket_trampoline<>(SB) TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockopt(SB) - GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockopt_trampoline_addr(SB)/8, $libc_getsockopt_trampoline<>(SB) TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsockopt(SB) - GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsockopt_trampoline_addr(SB)/8, $libc_setsockopt_trampoline<>(SB) TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpeername(SB) - GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpeername_trampoline_addr(SB)/8, $libc_getpeername_trampoline<>(SB) TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockname(SB) - GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockname_trampoline_addr(SB)/8, $libc_getsockname_trampoline<>(SB) TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shutdown(SB) - GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $8 DATA ·libc_shutdown_trampoline_addr(SB)/8, $libc_shutdown_trampoline<>(SB) TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socketpair(SB) - GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $8 DATA ·libc_socketpair_trampoline_addr(SB)/8, $libc_socketpair_trampoline<>(SB) TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvfrom(SB) - GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvfrom_trampoline_addr(SB)/8, $libc_recvfrom_trampoline<>(SB) TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendto(SB) - GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendto_trampoline_addr(SB)/8, $libc_sendto_trampoline<>(SB) TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvmsg(SB) - GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvmsg_trampoline_addr(SB)/8, $libc_recvmsg_trampoline<>(SB) TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendmsg(SB) - GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendmsg_trampoline_addr(SB)/8, $libc_sendmsg_trampoline<>(SB) TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kevent(SB) - GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $8 DATA ·libc_kevent_trampoline_addr(SB)/8, $libc_kevent_trampoline<>(SB) TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) - GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimes_trampoline_addr(SB)/8, $libc_utimes_trampoline<>(SB) TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) - GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_futimes_trampoline_addr(SB)/8, $libc_futimes_trampoline<>(SB) TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_poll(SB) - GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $8 DATA ·libc_poll_trampoline_addr(SB)/8, $libc_poll_trampoline<>(SB) TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_madvise(SB) - GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $8 DATA ·libc_madvise_trampoline_addr(SB)/8, $libc_madvise_trampoline<>(SB) TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlock(SB) - GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlock_trampoline_addr(SB)/8, $libc_mlock_trampoline<>(SB) TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlockall(SB) - GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlockall_trampoline_addr(SB)/8, $libc_mlockall_trampoline<>(SB) TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mprotect(SB) - GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $8 DATA ·libc_mprotect_trampoline_addr(SB)/8, $libc_mprotect_trampoline<>(SB) TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_msync(SB) - GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $8 DATA ·libc_msync_trampoline_addr(SB)/8, $libc_msync_trampoline<>(SB) TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlock(SB) - GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlock_trampoline_addr(SB)/8, $libc_munlock_trampoline<>(SB) TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlockall(SB) - GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlockall_trampoline_addr(SB)/8, $libc_munlockall_trampoline<>(SB) TEXT libc_pipe2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pipe2(SB) - GLOBL ·libc_pipe2_trampoline_addr(SB), RODATA, $8 DATA ·libc_pipe2_trampoline_addr(SB)/8, $libc_pipe2_trampoline<>(SB) TEXT libc_getdents_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getdents(SB) - GLOBL ·libc_getdents_trampoline_addr(SB), RODATA, $8 DATA ·libc_getdents_trampoline_addr(SB)/8, $libc_getdents_trampoline<>(SB) TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getcwd(SB) - GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) - GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) - GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) - GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $8 DATA ·libc_ppoll_trampoline_addr(SB)/8, $libc_ppoll_trampoline<>(SB) TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_access(SB) - GLOBL ·libc_access_trampoline_addr(SB), RODATA, $8 DATA ·libc_access_trampoline_addr(SB)/8, $libc_access_trampoline<>(SB) TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_adjtime(SB) - GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $8 DATA ·libc_adjtime_trampoline_addr(SB)/8, $libc_adjtime_trampoline<>(SB) TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chdir(SB) - GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_chdir_trampoline_addr(SB)/8, $libc_chdir_trampoline<>(SB) TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chflags(SB) - GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_chflags_trampoline_addr(SB)/8, $libc_chflags_trampoline<>(SB) TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chmod(SB) - GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_chmod_trampoline_addr(SB)/8, $libc_chmod_trampoline<>(SB) TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chown(SB) - GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $8 DATA ·libc_chown_trampoline_addr(SB)/8, $libc_chown_trampoline<>(SB) TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) - GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $8 DATA ·libc_chroot_trampoline_addr(SB)/8, $libc_chroot_trampoline<>(SB) +TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_clock_gettime(SB) +GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $8 +DATA ·libc_clock_gettime_trampoline_addr(SB)/8, $libc_clock_gettime_trampoline<>(SB) + TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_close(SB) - GLOBL ·libc_close_trampoline_addr(SB), RODATA, $8 DATA ·libc_close_trampoline_addr(SB)/8, $libc_close_trampoline<>(SB) TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup(SB) - GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup_trampoline_addr(SB)/8, $libc_dup_trampoline<>(SB) TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup2(SB) - GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup2_trampoline_addr(SB)/8, $libc_dup2_trampoline<>(SB) TEXT libc_dup3_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup3(SB) - GLOBL ·libc_dup3_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup3_trampoline_addr(SB)/8, $libc_dup3_trampoline<>(SB) TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_exit(SB) - GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $8 DATA ·libc_exit_trampoline_addr(SB)/8, $libc_exit_trampoline<>(SB) TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_faccessat(SB) - GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $8 DATA ·libc_faccessat_trampoline_addr(SB)/8, $libc_faccessat_trampoline<>(SB) TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchdir(SB) - GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchdir_trampoline_addr(SB)/8, $libc_fchdir_trampoline<>(SB) TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchflags(SB) - GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchflags_trampoline_addr(SB)/8, $libc_fchflags_trampoline<>(SB) TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmod(SB) - GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmod_trampoline_addr(SB)/8, $libc_fchmod_trampoline<>(SB) TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmodat(SB) - GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmodat_trampoline_addr(SB)/8, $libc_fchmodat_trampoline<>(SB) TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchown(SB) - GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchown_trampoline_addr(SB)/8, $libc_fchown_trampoline<>(SB) TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchownat(SB) - GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchownat_trampoline_addr(SB)/8, $libc_fchownat_trampoline<>(SB) TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_flock(SB) - GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $8 DATA ·libc_flock_trampoline_addr(SB)/8, $libc_flock_trampoline<>(SB) TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) - GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_fpathconf_trampoline_addr(SB)/8, $libc_fpathconf_trampoline<>(SB) TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) - GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstat_trampoline_addr(SB)/8, $libc_fstat_trampoline<>(SB) TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatat(SB) - GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatat_trampoline_addr(SB)/8, $libc_fstatat_trampoline<>(SB) TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatfs(SB) - GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatfs_trampoline_addr(SB)/8, $libc_fstatfs_trampoline<>(SB) TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) - GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $8 DATA ·libc_fsync_trampoline_addr(SB)/8, $libc_fsync_trampoline<>(SB) TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) - GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_ftruncate_trampoline_addr(SB)/8, $libc_ftruncate_trampoline<>(SB) TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getegid(SB) - GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getegid_trampoline_addr(SB)/8, $libc_getegid_trampoline<>(SB) TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_geteuid(SB) - GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_geteuid_trampoline_addr(SB)/8, $libc_geteuid_trampoline<>(SB) TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgid(SB) - GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgid_trampoline_addr(SB)/8, $libc_getgid_trampoline<>(SB) TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgid(SB) - GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgid_trampoline_addr(SB)/8, $libc_getpgid_trampoline<>(SB) TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgrp(SB) - GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgrp_trampoline_addr(SB)/8, $libc_getpgrp_trampoline<>(SB) TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpid(SB) - GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpid_trampoline_addr(SB)/8, $libc_getpid_trampoline<>(SB) TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getppid(SB) - GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getppid_trampoline_addr(SB)/8, $libc_getppid_trampoline<>(SB) TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpriority(SB) - GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpriority_trampoline_addr(SB)/8, $libc_getpriority_trampoline<>(SB) TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrlimit(SB) - GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrlimit_trampoline_addr(SB)/8, $libc_getrlimit_trampoline<>(SB) TEXT libc_getrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrtable(SB) - GLOBL ·libc_getrtable_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrtable_trampoline_addr(SB)/8, $libc_getrtable_trampoline<>(SB) TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrusage(SB) - GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrusage_trampoline_addr(SB)/8, $libc_getrusage_trampoline<>(SB) TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsid(SB) - GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsid_trampoline_addr(SB)/8, $libc_getsid_trampoline<>(SB) TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) - GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_gettimeofday_trampoline_addr(SB)/8, $libc_gettimeofday_trampoline<>(SB) TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getuid(SB) - GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getuid_trampoline_addr(SB)/8, $libc_getuid_trampoline<>(SB) TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_issetugid(SB) - GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $8 DATA ·libc_issetugid_trampoline_addr(SB)/8, $libc_issetugid_trampoline<>(SB) TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kill(SB) - GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $8 DATA ·libc_kill_trampoline_addr(SB)/8, $libc_kill_trampoline<>(SB) TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kqueue(SB) - GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $8 DATA ·libc_kqueue_trampoline_addr(SB)/8, $libc_kqueue_trampoline<>(SB) TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lchown(SB) - GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_lchown_trampoline_addr(SB)/8, $libc_lchown_trampoline<>(SB) TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_link(SB) - GLOBL ·libc_link_trampoline_addr(SB), RODATA, $8 DATA ·libc_link_trampoline_addr(SB)/8, $libc_link_trampoline<>(SB) TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_linkat(SB) - GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_linkat_trampoline_addr(SB)/8, $libc_linkat_trampoline<>(SB) TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_listen(SB) - GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $8 DATA ·libc_listen_trampoline_addr(SB)/8, $libc_listen_trampoline<>(SB) TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lstat(SB) - GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_lstat_trampoline_addr(SB)/8, $libc_lstat_trampoline<>(SB) TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) - GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdir_trampoline_addr(SB)/8, $libc_mkdir_trampoline<>(SB) TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdirat(SB) - GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdirat_trampoline_addr(SB)/8, $libc_mkdirat_trampoline<>(SB) TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifo(SB) - GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifo_trampoline_addr(SB)/8, $libc_mkfifo_trampoline<>(SB) TEXT libc_mkfifoat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifoat(SB) - GLOBL ·libc_mkfifoat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifoat_trampoline_addr(SB)/8, $libc_mkfifoat_trampoline<>(SB) TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknod(SB) - GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB) TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknodat(SB) - GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) - GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 DATA ·libc_nanosleep_trampoline_addr(SB)/8, $libc_nanosleep_trampoline<>(SB) TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_open(SB) - GLOBL ·libc_open_trampoline_addr(SB), RODATA, $8 DATA ·libc_open_trampoline_addr(SB)/8, $libc_open_trampoline<>(SB) TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_openat(SB) - GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $8 DATA ·libc_openat_trampoline_addr(SB)/8, $libc_openat_trampoline<>(SB) TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pathconf(SB) - GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_pathconf_trampoline_addr(SB)/8, $libc_pathconf_trampoline<>(SB) TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pread(SB) - GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $8 DATA ·libc_pread_trampoline_addr(SB)/8, $libc_pread_trampoline<>(SB) TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pwrite(SB) - GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) - GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 DATA ·libc_read_trampoline_addr(SB)/8, $libc_read_trampoline<>(SB) TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlink(SB) - GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlink_trampoline_addr(SB)/8, $libc_readlink_trampoline<>(SB) TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlinkat(SB) - GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlinkat_trampoline_addr(SB)/8, $libc_readlinkat_trampoline<>(SB) TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rename(SB) - GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $8 DATA ·libc_rename_trampoline_addr(SB)/8, $libc_rename_trampoline<>(SB) TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renameat(SB) - GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $8 DATA ·libc_renameat_trampoline_addr(SB)/8, $libc_renameat_trampoline<>(SB) TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_revoke(SB) - GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $8 DATA ·libc_revoke_trampoline_addr(SB)/8, $libc_revoke_trampoline<>(SB) TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rmdir(SB) - GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_rmdir_trampoline_addr(SB)/8, $libc_rmdir_trampoline<>(SB) TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lseek(SB) - GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $8 DATA ·libc_lseek_trampoline_addr(SB)/8, $libc_lseek_trampoline<>(SB) TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_select(SB) - GLOBL ·libc_select_trampoline_addr(SB), RODATA, $8 DATA ·libc_select_trampoline_addr(SB)/8, $libc_select_trampoline<>(SB) TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setegid(SB) - GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setegid_trampoline_addr(SB)/8, $libc_setegid_trampoline<>(SB) TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_seteuid(SB) - GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_seteuid_trampoline_addr(SB)/8, $libc_seteuid_trampoline<>(SB) TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgid(SB) - GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgid_trampoline_addr(SB)/8, $libc_setgid_trampoline<>(SB) TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setlogin(SB) - GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $8 DATA ·libc_setlogin_trampoline_addr(SB)/8, $libc_setlogin_trampoline<>(SB) TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpgid(SB) - GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpgid_trampoline_addr(SB)/8, $libc_setpgid_trampoline<>(SB) TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpriority(SB) - GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpriority_trampoline_addr(SB)/8, $libc_setpriority_trampoline<>(SB) TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setregid(SB) - GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setregid_trampoline_addr(SB)/8, $libc_setregid_trampoline<>(SB) TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setreuid(SB) - GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setreuid_trampoline_addr(SB)/8, $libc_setreuid_trampoline<>(SB) TEXT libc_setresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresgid(SB) - GLOBL ·libc_setresgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setresgid_trampoline_addr(SB)/8, $libc_setresgid_trampoline<>(SB) TEXT libc_setresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresuid(SB) - GLOBL ·libc_setresuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setresuid_trampoline_addr(SB)/8, $libc_setresuid_trampoline<>(SB) TEXT libc_setrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setrlimit(SB) - GLOBL ·libc_setrlimit_trampoline_addr(SB), RODATA, $8 DATA ·libc_setrlimit_trampoline_addr(SB)/8, $libc_setrlimit_trampoline<>(SB) TEXT libc_setrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setrtable(SB) - GLOBL ·libc_setrtable_trampoline_addr(SB), RODATA, $8 DATA ·libc_setrtable_trampoline_addr(SB)/8, $libc_setrtable_trampoline<>(SB) TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsid(SB) - GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsid_trampoline_addr(SB)/8, $libc_setsid_trampoline<>(SB) TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) - GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_settimeofday_trampoline_addr(SB)/8, $libc_settimeofday_trampoline<>(SB) TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) - GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setuid_trampoline_addr(SB)/8, $libc_setuid_trampoline<>(SB) TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_stat(SB) - GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $8 DATA ·libc_stat_trampoline_addr(SB)/8, $libc_stat_trampoline<>(SB) TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_statfs(SB) - GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_statfs_trampoline_addr(SB)/8, $libc_statfs_trampoline<>(SB) TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) - GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlink_trampoline_addr(SB)/8, $libc_symlink_trampoline<>(SB) TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlinkat(SB) - GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlinkat_trampoline_addr(SB)/8, $libc_symlinkat_trampoline<>(SB) TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sync(SB) - GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $8 DATA ·libc_sync_trampoline_addr(SB)/8, $libc_sync_trampoline<>(SB) TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_truncate(SB) - GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_truncate_trampoline_addr(SB)/8, $libc_truncate_trampoline<>(SB) TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_umask(SB) - GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $8 DATA ·libc_umask_trampoline_addr(SB)/8, $libc_umask_trampoline<>(SB) TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlink(SB) - GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlink_trampoline_addr(SB)/8, $libc_unlink_trampoline<>(SB) TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) - GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlinkat_trampoline_addr(SB)/8, $libc_unlinkat_trampoline<>(SB) TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unmount(SB) - GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $8 DATA ·libc_unmount_trampoline_addr(SB)/8, $libc_unmount_trampoline<>(SB) TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_write(SB) - GLOBL ·libc_write_trampoline_addr(SB), RODATA, $8 DATA ·libc_write_trampoline_addr(SB)/8, $libc_write_trampoline<>(SB) TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mmap(SB) - GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_mmap_trampoline_addr(SB)/8, $libc_mmap_trampoline<>(SB) TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munmap(SB) - GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) - GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go index 91f5a2bde28..78d4a4240e9 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go @@ -38,6 +38,7 @@ import ( //go:cgo_import_dynamic libc_chmod chmod "libc.so" //go:cgo_import_dynamic libc_chown chown "libc.so" //go:cgo_import_dynamic libc_chroot chroot "libc.so" +//go:cgo_import_dynamic libc_clockgettime clockgettime "libc.so" //go:cgo_import_dynamic libc_close close "libc.so" //go:cgo_import_dynamic libc_creat creat "libc.so" //go:cgo_import_dynamic libc_dup dup "libc.so" @@ -177,6 +178,7 @@ import ( //go:linkname procChmod libc_chmod //go:linkname procChown libc_chown //go:linkname procChroot libc_chroot +//go:linkname procClockGettime libc_clockgettime //go:linkname procClose libc_close //go:linkname procCreat libc_creat //go:linkname procDup libc_dup @@ -317,6 +319,7 @@ var ( procChmod, procChown, procChroot, + procClockGettime, procClose, procCreat, procDup, @@ -750,6 +753,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procClockGettime)), 2, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0, 0, 0, 0) + if e1 != 0 { + err = e1 + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procClose)), 1, uintptr(fd), 0, 0, 0, 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go index 9e9d0b2a9c4..55e0484719c 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go @@ -17,6 +17,7 @@ var sysctlMib = []mibentry{ {"ddb.max_line", []_C_int{9, 3}}, {"ddb.max_width", []_C_int{9, 2}}, {"ddb.panic", []_C_int{9, 5}}, + {"ddb.profile", []_C_int{9, 9}}, {"ddb.radix", []_C_int{9, 1}}, {"ddb.tab_stop_width", []_C_int{9, 4}}, {"ddb.trigger", []_C_int{9, 8}}, @@ -33,29 +34,37 @@ var sysctlMib = []mibentry{ {"hw.ncpufound", []_C_int{6, 21}}, {"hw.ncpuonline", []_C_int{6, 25}}, {"hw.pagesize", []_C_int{6, 7}}, + {"hw.perfpolicy", []_C_int{6, 23}}, {"hw.physmem", []_C_int{6, 19}}, + {"hw.power", []_C_int{6, 26}}, {"hw.product", []_C_int{6, 15}}, {"hw.serialno", []_C_int{6, 17}}, {"hw.setperf", []_C_int{6, 13}}, + {"hw.smt", []_C_int{6, 24}}, {"hw.usermem", []_C_int{6, 20}}, {"hw.uuid", []_C_int{6, 18}}, {"hw.vendor", []_C_int{6, 14}}, {"hw.version", []_C_int{6, 16}}, - {"kern.arandom", []_C_int{1, 37}}, + {"kern.allowdt", []_C_int{1, 65}}, + {"kern.allowkmem", []_C_int{1, 52}}, {"kern.argmax", []_C_int{1, 8}}, + {"kern.audio", []_C_int{1, 84}}, {"kern.boottime", []_C_int{1, 21}}, {"kern.bufcachepercent", []_C_int{1, 72}}, {"kern.ccpu", []_C_int{1, 45}}, {"kern.clockrate", []_C_int{1, 12}}, + {"kern.consbuf", []_C_int{1, 83}}, + {"kern.consbufsize", []_C_int{1, 82}}, {"kern.consdev", []_C_int{1, 75}}, {"kern.cp_time", []_C_int{1, 40}}, {"kern.cp_time2", []_C_int{1, 71}}, - {"kern.cryptodevallowsoft", []_C_int{1, 53}}, + {"kern.cpustats", []_C_int{1, 85}}, {"kern.domainname", []_C_int{1, 22}}, {"kern.file", []_C_int{1, 73}}, {"kern.forkstat", []_C_int{1, 42}}, {"kern.fscale", []_C_int{1, 46}}, {"kern.fsync", []_C_int{1, 33}}, + {"kern.global_ptrace", []_C_int{1, 81}}, {"kern.hostid", []_C_int{1, 11}}, {"kern.hostname", []_C_int{1, 10}}, {"kern.intrcnt.nintrcnt", []_C_int{1, 63, 1}}, @@ -78,17 +87,16 @@ var sysctlMib = []mibentry{ {"kern.ngroups", []_C_int{1, 18}}, {"kern.nosuidcoredump", []_C_int{1, 32}}, {"kern.nprocs", []_C_int{1, 47}}, - {"kern.nselcoll", []_C_int{1, 43}}, {"kern.nthreads", []_C_int{1, 26}}, {"kern.numvnodes", []_C_int{1, 58}}, {"kern.osrelease", []_C_int{1, 2}}, {"kern.osrevision", []_C_int{1, 3}}, {"kern.ostype", []_C_int{1, 1}}, {"kern.osversion", []_C_int{1, 27}}, + {"kern.pfstatus", []_C_int{1, 86}}, {"kern.pool_debug", []_C_int{1, 77}}, {"kern.posix1version", []_C_int{1, 17}}, {"kern.proc", []_C_int{1, 66}}, - {"kern.random", []_C_int{1, 31}}, {"kern.rawpartition", []_C_int{1, 24}}, {"kern.saved_ids", []_C_int{1, 20}}, {"kern.securelevel", []_C_int{1, 9}}, @@ -106,21 +114,20 @@ var sysctlMib = []mibentry{ {"kern.timecounter.hardware", []_C_int{1, 69, 3}}, {"kern.timecounter.tick", []_C_int{1, 69, 1}}, {"kern.timecounter.timestepwarnings", []_C_int{1, 69, 2}}, - {"kern.tty.maxptys", []_C_int{1, 44, 6}}, - {"kern.tty.nptys", []_C_int{1, 44, 7}}, + {"kern.timeout_stats", []_C_int{1, 87}}, {"kern.tty.tk_cancc", []_C_int{1, 44, 4}}, {"kern.tty.tk_nin", []_C_int{1, 44, 1}}, {"kern.tty.tk_nout", []_C_int{1, 44, 2}}, {"kern.tty.tk_rawcc", []_C_int{1, 44, 3}}, {"kern.tty.ttyinfo", []_C_int{1, 44, 5}}, {"kern.ttycount", []_C_int{1, 57}}, - {"kern.userasymcrypto", []_C_int{1, 60}}, - {"kern.usercrypto", []_C_int{1, 52}}, - {"kern.usermount", []_C_int{1, 30}}, + {"kern.utc_offset", []_C_int{1, 88}}, {"kern.version", []_C_int{1, 4}}, - {"kern.vnode", []_C_int{1, 13}}, + {"kern.video", []_C_int{1, 89}}, {"kern.watchdog.auto", []_C_int{1, 64, 2}}, {"kern.watchdog.period", []_C_int{1, 64, 1}}, + {"kern.witnesswatch", []_C_int{1, 53}}, + {"kern.wxabort", []_C_int{1, 74}}, {"net.bpf.bufsize", []_C_int{4, 31, 1}}, {"net.bpf.maxbufsize", []_C_int{4, 31, 2}}, {"net.inet.ah.enable", []_C_int{4, 2, 51, 1}}, @@ -148,7 +155,9 @@ var sysctlMib = []mibentry{ {"net.inet.icmp.stats", []_C_int{4, 2, 1, 7}}, {"net.inet.icmp.tstamprepl", []_C_int{4, 2, 1, 6}}, {"net.inet.igmp.stats", []_C_int{4, 2, 2, 1}}, + {"net.inet.ip.arpdown", []_C_int{4, 2, 0, 40}}, {"net.inet.ip.arpqueued", []_C_int{4, 2, 0, 36}}, + {"net.inet.ip.arptimeout", []_C_int{4, 2, 0, 39}}, {"net.inet.ip.encdebug", []_C_int{4, 2, 0, 12}}, {"net.inet.ip.forwarding", []_C_int{4, 2, 0, 1}}, {"net.inet.ip.ifq.congestion", []_C_int{4, 2, 0, 30, 4}}, @@ -157,8 +166,10 @@ var sysctlMib = []mibentry{ {"net.inet.ip.ifq.maxlen", []_C_int{4, 2, 0, 30, 2}}, {"net.inet.ip.maxqueue", []_C_int{4, 2, 0, 11}}, {"net.inet.ip.mforwarding", []_C_int{4, 2, 0, 31}}, + {"net.inet.ip.mrtmfc", []_C_int{4, 2, 0, 37}}, {"net.inet.ip.mrtproto", []_C_int{4, 2, 0, 34}}, {"net.inet.ip.mrtstats", []_C_int{4, 2, 0, 35}}, + {"net.inet.ip.mrtvif", []_C_int{4, 2, 0, 38}}, {"net.inet.ip.mtu", []_C_int{4, 2, 0, 4}}, {"net.inet.ip.mtudisc", []_C_int{4, 2, 0, 27}}, {"net.inet.ip.mtudisctimeout", []_C_int{4, 2, 0, 28}}, @@ -175,9 +186,7 @@ var sysctlMib = []mibentry{ {"net.inet.ipcomp.stats", []_C_int{4, 2, 108, 2}}, {"net.inet.ipip.allow", []_C_int{4, 2, 4, 1}}, {"net.inet.ipip.stats", []_C_int{4, 2, 4, 2}}, - {"net.inet.mobileip.allow", []_C_int{4, 2, 55, 1}}, {"net.inet.pfsync.stats", []_C_int{4, 2, 240, 1}}, - {"net.inet.pim.stats", []_C_int{4, 2, 103, 1}}, {"net.inet.tcp.ackonpush", []_C_int{4, 2, 6, 13}}, {"net.inet.tcp.always_keepalive", []_C_int{4, 2, 6, 22}}, {"net.inet.tcp.baddynamic", []_C_int{4, 2, 6, 6}}, @@ -191,6 +200,7 @@ var sysctlMib = []mibentry{ {"net.inet.tcp.reasslimit", []_C_int{4, 2, 6, 18}}, {"net.inet.tcp.rfc1323", []_C_int{4, 2, 6, 1}}, {"net.inet.tcp.rfc3390", []_C_int{4, 2, 6, 17}}, + {"net.inet.tcp.rootonly", []_C_int{4, 2, 6, 24}}, {"net.inet.tcp.rstppslimit", []_C_int{4, 2, 6, 12}}, {"net.inet.tcp.sack", []_C_int{4, 2, 6, 10}}, {"net.inet.tcp.sackholelimit", []_C_int{4, 2, 6, 20}}, @@ -198,9 +208,12 @@ var sysctlMib = []mibentry{ {"net.inet.tcp.stats", []_C_int{4, 2, 6, 21}}, {"net.inet.tcp.synbucketlimit", []_C_int{4, 2, 6, 16}}, {"net.inet.tcp.syncachelimit", []_C_int{4, 2, 6, 15}}, + {"net.inet.tcp.synhashsize", []_C_int{4, 2, 6, 25}}, + {"net.inet.tcp.synuselimit", []_C_int{4, 2, 6, 23}}, {"net.inet.udp.baddynamic", []_C_int{4, 2, 17, 2}}, {"net.inet.udp.checksum", []_C_int{4, 2, 17, 1}}, {"net.inet.udp.recvspace", []_C_int{4, 2, 17, 3}}, + {"net.inet.udp.rootonly", []_C_int{4, 2, 17, 6}}, {"net.inet.udp.sendspace", []_C_int{4, 2, 17, 4}}, {"net.inet.udp.stats", []_C_int{4, 2, 17, 5}}, {"net.inet6.divert.recvspace", []_C_int{4, 24, 86, 1}}, @@ -213,13 +226,8 @@ var sysctlMib = []mibentry{ {"net.inet6.icmp6.nd6_delay", []_C_int{4, 24, 30, 8}}, {"net.inet6.icmp6.nd6_maxnudhint", []_C_int{4, 24, 30, 15}}, {"net.inet6.icmp6.nd6_mmaxtries", []_C_int{4, 24, 30, 10}}, - {"net.inet6.icmp6.nd6_prune", []_C_int{4, 24, 30, 6}}, {"net.inet6.icmp6.nd6_umaxtries", []_C_int{4, 24, 30, 9}}, - {"net.inet6.icmp6.nd6_useloopback", []_C_int{4, 24, 30, 11}}, - {"net.inet6.icmp6.nodeinfo", []_C_int{4, 24, 30, 13}}, - {"net.inet6.icmp6.rediraccept", []_C_int{4, 24, 30, 2}}, {"net.inet6.icmp6.redirtimeout", []_C_int{4, 24, 30, 3}}, - {"net.inet6.ip6.accept_rtadv", []_C_int{4, 24, 17, 12}}, {"net.inet6.ip6.auto_flowlabel", []_C_int{4, 24, 17, 17}}, {"net.inet6.ip6.dad_count", []_C_int{4, 24, 17, 16}}, {"net.inet6.ip6.dad_pending", []_C_int{4, 24, 17, 49}}, @@ -232,20 +240,19 @@ var sysctlMib = []mibentry{ {"net.inet6.ip6.maxdynroutes", []_C_int{4, 24, 17, 48}}, {"net.inet6.ip6.maxfragpackets", []_C_int{4, 24, 17, 9}}, {"net.inet6.ip6.maxfrags", []_C_int{4, 24, 17, 41}}, - {"net.inet6.ip6.maxifdefrouters", []_C_int{4, 24, 17, 47}}, - {"net.inet6.ip6.maxifprefixes", []_C_int{4, 24, 17, 46}}, {"net.inet6.ip6.mforwarding", []_C_int{4, 24, 17, 42}}, + {"net.inet6.ip6.mrtmfc", []_C_int{4, 24, 17, 53}}, + {"net.inet6.ip6.mrtmif", []_C_int{4, 24, 17, 52}}, {"net.inet6.ip6.mrtproto", []_C_int{4, 24, 17, 8}}, {"net.inet6.ip6.mtudisctimeout", []_C_int{4, 24, 17, 50}}, {"net.inet6.ip6.multicast_mtudisc", []_C_int{4, 24, 17, 44}}, {"net.inet6.ip6.multipath", []_C_int{4, 24, 17, 43}}, {"net.inet6.ip6.neighborgcthresh", []_C_int{4, 24, 17, 45}}, {"net.inet6.ip6.redirect", []_C_int{4, 24, 17, 2}}, - {"net.inet6.ip6.rr_prune", []_C_int{4, 24, 17, 22}}, + {"net.inet6.ip6.soiikey", []_C_int{4, 24, 17, 54}}, {"net.inet6.ip6.sourcecheck", []_C_int{4, 24, 17, 10}}, {"net.inet6.ip6.sourcecheck_logint", []_C_int{4, 24, 17, 11}}, {"net.inet6.ip6.use_deprecated", []_C_int{4, 24, 17, 21}}, - {"net.inet6.ip6.v6only", []_C_int{4, 24, 17, 24}}, {"net.key.sadb_dump", []_C_int{4, 30, 1}}, {"net.key.spd_dump", []_C_int{4, 30, 2}}, {"net.mpls.ifq.congestion", []_C_int{4, 33, 3, 4}}, @@ -254,12 +261,12 @@ var sysctlMib = []mibentry{ {"net.mpls.ifq.maxlen", []_C_int{4, 33, 3, 2}}, {"net.mpls.mapttl_ip", []_C_int{4, 33, 5}}, {"net.mpls.mapttl_ip6", []_C_int{4, 33, 6}}, - {"net.mpls.maxloop_inkernel", []_C_int{4, 33, 4}}, {"net.mpls.ttl", []_C_int{4, 33, 2}}, {"net.pflow.stats", []_C_int{4, 34, 1}}, {"net.pipex.enable", []_C_int{4, 35, 1}}, {"vm.anonmin", []_C_int{2, 7}}, {"vm.loadavg", []_C_int{2, 2}}, + {"vm.malloc_conf", []_C_int{2, 12}}, {"vm.maxslp", []_C_int{2, 10}}, {"vm.nkmempages", []_C_int{2, 6}}, {"vm.psstrings", []_C_int{2, 3}}, diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go index adecd09667d..d2243cf83f5 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go @@ -36,23 +36,29 @@ var sysctlMib = []mibentry{ {"hw.pagesize", []_C_int{6, 7}}, {"hw.perfpolicy", []_C_int{6, 23}}, {"hw.physmem", []_C_int{6, 19}}, + {"hw.power", []_C_int{6, 26}}, {"hw.product", []_C_int{6, 15}}, {"hw.serialno", []_C_int{6, 17}}, {"hw.setperf", []_C_int{6, 13}}, + {"hw.smt", []_C_int{6, 24}}, {"hw.usermem", []_C_int{6, 20}}, {"hw.uuid", []_C_int{6, 18}}, {"hw.vendor", []_C_int{6, 14}}, {"hw.version", []_C_int{6, 16}}, + {"kern.allowdt", []_C_int{1, 65}}, {"kern.allowkmem", []_C_int{1, 52}}, {"kern.argmax", []_C_int{1, 8}}, + {"kern.audio", []_C_int{1, 84}}, {"kern.boottime", []_C_int{1, 21}}, {"kern.bufcachepercent", []_C_int{1, 72}}, {"kern.ccpu", []_C_int{1, 45}}, {"kern.clockrate", []_C_int{1, 12}}, + {"kern.consbuf", []_C_int{1, 83}}, + {"kern.consbufsize", []_C_int{1, 82}}, {"kern.consdev", []_C_int{1, 75}}, {"kern.cp_time", []_C_int{1, 40}}, {"kern.cp_time2", []_C_int{1, 71}}, - {"kern.dnsjackport", []_C_int{1, 13}}, + {"kern.cpustats", []_C_int{1, 85}}, {"kern.domainname", []_C_int{1, 22}}, {"kern.file", []_C_int{1, 73}}, {"kern.forkstat", []_C_int{1, 42}}, @@ -81,13 +87,13 @@ var sysctlMib = []mibentry{ {"kern.ngroups", []_C_int{1, 18}}, {"kern.nosuidcoredump", []_C_int{1, 32}}, {"kern.nprocs", []_C_int{1, 47}}, - {"kern.nselcoll", []_C_int{1, 43}}, {"kern.nthreads", []_C_int{1, 26}}, {"kern.numvnodes", []_C_int{1, 58}}, {"kern.osrelease", []_C_int{1, 2}}, {"kern.osrevision", []_C_int{1, 3}}, {"kern.ostype", []_C_int{1, 1}}, {"kern.osversion", []_C_int{1, 27}}, + {"kern.pfstatus", []_C_int{1, 86}}, {"kern.pool_debug", []_C_int{1, 77}}, {"kern.posix1version", []_C_int{1, 17}}, {"kern.proc", []_C_int{1, 66}}, @@ -108,15 +114,19 @@ var sysctlMib = []mibentry{ {"kern.timecounter.hardware", []_C_int{1, 69, 3}}, {"kern.timecounter.tick", []_C_int{1, 69, 1}}, {"kern.timecounter.timestepwarnings", []_C_int{1, 69, 2}}, + {"kern.timeout_stats", []_C_int{1, 87}}, {"kern.tty.tk_cancc", []_C_int{1, 44, 4}}, {"kern.tty.tk_nin", []_C_int{1, 44, 1}}, {"kern.tty.tk_nout", []_C_int{1, 44, 2}}, {"kern.tty.tk_rawcc", []_C_int{1, 44, 3}}, {"kern.tty.ttyinfo", []_C_int{1, 44, 5}}, {"kern.ttycount", []_C_int{1, 57}}, + {"kern.utc_offset", []_C_int{1, 88}}, {"kern.version", []_C_int{1, 4}}, + {"kern.video", []_C_int{1, 89}}, {"kern.watchdog.auto", []_C_int{1, 64, 2}}, {"kern.watchdog.period", []_C_int{1, 64, 1}}, + {"kern.witnesswatch", []_C_int{1, 53}}, {"kern.wxabort", []_C_int{1, 74}}, {"net.bpf.bufsize", []_C_int{4, 31, 1}}, {"net.bpf.maxbufsize", []_C_int{4, 31, 2}}, @@ -176,7 +186,6 @@ var sysctlMib = []mibentry{ {"net.inet.ipcomp.stats", []_C_int{4, 2, 108, 2}}, {"net.inet.ipip.allow", []_C_int{4, 2, 4, 1}}, {"net.inet.ipip.stats", []_C_int{4, 2, 4, 2}}, - {"net.inet.mobileip.allow", []_C_int{4, 2, 55, 1}}, {"net.inet.pfsync.stats", []_C_int{4, 2, 240, 1}}, {"net.inet.tcp.ackonpush", []_C_int{4, 2, 6, 13}}, {"net.inet.tcp.always_keepalive", []_C_int{4, 2, 6, 22}}, @@ -252,12 +261,12 @@ var sysctlMib = []mibentry{ {"net.mpls.ifq.maxlen", []_C_int{4, 33, 3, 2}}, {"net.mpls.mapttl_ip", []_C_int{4, 33, 5}}, {"net.mpls.mapttl_ip6", []_C_int{4, 33, 6}}, - {"net.mpls.maxloop_inkernel", []_C_int{4, 33, 4}}, {"net.mpls.ttl", []_C_int{4, 33, 2}}, {"net.pflow.stats", []_C_int{4, 34, 1}}, {"net.pipex.enable", []_C_int{4, 35, 1}}, {"vm.anonmin", []_C_int{2, 7}}, {"vm.loadavg", []_C_int{2, 2}}, + {"vm.malloc_conf", []_C_int{2, 12}}, {"vm.maxslp", []_C_int{2, 10}}, {"vm.nkmempages", []_C_int{2, 6}}, {"vm.psstrings", []_C_int{2, 3}}, diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go index 8ea52a4a181..82dc51bd8b5 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go @@ -17,6 +17,7 @@ var sysctlMib = []mibentry{ {"ddb.max_line", []_C_int{9, 3}}, {"ddb.max_width", []_C_int{9, 2}}, {"ddb.panic", []_C_int{9, 5}}, + {"ddb.profile", []_C_int{9, 9}}, {"ddb.radix", []_C_int{9, 1}}, {"ddb.tab_stop_width", []_C_int{9, 4}}, {"ddb.trigger", []_C_int{9, 8}}, @@ -33,29 +34,37 @@ var sysctlMib = []mibentry{ {"hw.ncpufound", []_C_int{6, 21}}, {"hw.ncpuonline", []_C_int{6, 25}}, {"hw.pagesize", []_C_int{6, 7}}, + {"hw.perfpolicy", []_C_int{6, 23}}, {"hw.physmem", []_C_int{6, 19}}, + {"hw.power", []_C_int{6, 26}}, {"hw.product", []_C_int{6, 15}}, {"hw.serialno", []_C_int{6, 17}}, {"hw.setperf", []_C_int{6, 13}}, + {"hw.smt", []_C_int{6, 24}}, {"hw.usermem", []_C_int{6, 20}}, {"hw.uuid", []_C_int{6, 18}}, {"hw.vendor", []_C_int{6, 14}}, {"hw.version", []_C_int{6, 16}}, - {"kern.arandom", []_C_int{1, 37}}, + {"kern.allowdt", []_C_int{1, 65}}, + {"kern.allowkmem", []_C_int{1, 52}}, {"kern.argmax", []_C_int{1, 8}}, + {"kern.audio", []_C_int{1, 84}}, {"kern.boottime", []_C_int{1, 21}}, {"kern.bufcachepercent", []_C_int{1, 72}}, {"kern.ccpu", []_C_int{1, 45}}, {"kern.clockrate", []_C_int{1, 12}}, + {"kern.consbuf", []_C_int{1, 83}}, + {"kern.consbufsize", []_C_int{1, 82}}, {"kern.consdev", []_C_int{1, 75}}, {"kern.cp_time", []_C_int{1, 40}}, {"kern.cp_time2", []_C_int{1, 71}}, - {"kern.cryptodevallowsoft", []_C_int{1, 53}}, + {"kern.cpustats", []_C_int{1, 85}}, {"kern.domainname", []_C_int{1, 22}}, {"kern.file", []_C_int{1, 73}}, {"kern.forkstat", []_C_int{1, 42}}, {"kern.fscale", []_C_int{1, 46}}, {"kern.fsync", []_C_int{1, 33}}, + {"kern.global_ptrace", []_C_int{1, 81}}, {"kern.hostid", []_C_int{1, 11}}, {"kern.hostname", []_C_int{1, 10}}, {"kern.intrcnt.nintrcnt", []_C_int{1, 63, 1}}, @@ -78,17 +87,16 @@ var sysctlMib = []mibentry{ {"kern.ngroups", []_C_int{1, 18}}, {"kern.nosuidcoredump", []_C_int{1, 32}}, {"kern.nprocs", []_C_int{1, 47}}, - {"kern.nselcoll", []_C_int{1, 43}}, {"kern.nthreads", []_C_int{1, 26}}, {"kern.numvnodes", []_C_int{1, 58}}, {"kern.osrelease", []_C_int{1, 2}}, {"kern.osrevision", []_C_int{1, 3}}, {"kern.ostype", []_C_int{1, 1}}, {"kern.osversion", []_C_int{1, 27}}, + {"kern.pfstatus", []_C_int{1, 86}}, {"kern.pool_debug", []_C_int{1, 77}}, {"kern.posix1version", []_C_int{1, 17}}, {"kern.proc", []_C_int{1, 66}}, - {"kern.random", []_C_int{1, 31}}, {"kern.rawpartition", []_C_int{1, 24}}, {"kern.saved_ids", []_C_int{1, 20}}, {"kern.securelevel", []_C_int{1, 9}}, @@ -106,21 +114,20 @@ var sysctlMib = []mibentry{ {"kern.timecounter.hardware", []_C_int{1, 69, 3}}, {"kern.timecounter.tick", []_C_int{1, 69, 1}}, {"kern.timecounter.timestepwarnings", []_C_int{1, 69, 2}}, - {"kern.tty.maxptys", []_C_int{1, 44, 6}}, - {"kern.tty.nptys", []_C_int{1, 44, 7}}, + {"kern.timeout_stats", []_C_int{1, 87}}, {"kern.tty.tk_cancc", []_C_int{1, 44, 4}}, {"kern.tty.tk_nin", []_C_int{1, 44, 1}}, {"kern.tty.tk_nout", []_C_int{1, 44, 2}}, {"kern.tty.tk_rawcc", []_C_int{1, 44, 3}}, {"kern.tty.ttyinfo", []_C_int{1, 44, 5}}, {"kern.ttycount", []_C_int{1, 57}}, - {"kern.userasymcrypto", []_C_int{1, 60}}, - {"kern.usercrypto", []_C_int{1, 52}}, - {"kern.usermount", []_C_int{1, 30}}, + {"kern.utc_offset", []_C_int{1, 88}}, {"kern.version", []_C_int{1, 4}}, - {"kern.vnode", []_C_int{1, 13}}, + {"kern.video", []_C_int{1, 89}}, {"kern.watchdog.auto", []_C_int{1, 64, 2}}, {"kern.watchdog.period", []_C_int{1, 64, 1}}, + {"kern.witnesswatch", []_C_int{1, 53}}, + {"kern.wxabort", []_C_int{1, 74}}, {"net.bpf.bufsize", []_C_int{4, 31, 1}}, {"net.bpf.maxbufsize", []_C_int{4, 31, 2}}, {"net.inet.ah.enable", []_C_int{4, 2, 51, 1}}, @@ -148,7 +155,9 @@ var sysctlMib = []mibentry{ {"net.inet.icmp.stats", []_C_int{4, 2, 1, 7}}, {"net.inet.icmp.tstamprepl", []_C_int{4, 2, 1, 6}}, {"net.inet.igmp.stats", []_C_int{4, 2, 2, 1}}, + {"net.inet.ip.arpdown", []_C_int{4, 2, 0, 40}}, {"net.inet.ip.arpqueued", []_C_int{4, 2, 0, 36}}, + {"net.inet.ip.arptimeout", []_C_int{4, 2, 0, 39}}, {"net.inet.ip.encdebug", []_C_int{4, 2, 0, 12}}, {"net.inet.ip.forwarding", []_C_int{4, 2, 0, 1}}, {"net.inet.ip.ifq.congestion", []_C_int{4, 2, 0, 30, 4}}, @@ -157,8 +166,10 @@ var sysctlMib = []mibentry{ {"net.inet.ip.ifq.maxlen", []_C_int{4, 2, 0, 30, 2}}, {"net.inet.ip.maxqueue", []_C_int{4, 2, 0, 11}}, {"net.inet.ip.mforwarding", []_C_int{4, 2, 0, 31}}, + {"net.inet.ip.mrtmfc", []_C_int{4, 2, 0, 37}}, {"net.inet.ip.mrtproto", []_C_int{4, 2, 0, 34}}, {"net.inet.ip.mrtstats", []_C_int{4, 2, 0, 35}}, + {"net.inet.ip.mrtvif", []_C_int{4, 2, 0, 38}}, {"net.inet.ip.mtu", []_C_int{4, 2, 0, 4}}, {"net.inet.ip.mtudisc", []_C_int{4, 2, 0, 27}}, {"net.inet.ip.mtudisctimeout", []_C_int{4, 2, 0, 28}}, @@ -175,9 +186,7 @@ var sysctlMib = []mibentry{ {"net.inet.ipcomp.stats", []_C_int{4, 2, 108, 2}}, {"net.inet.ipip.allow", []_C_int{4, 2, 4, 1}}, {"net.inet.ipip.stats", []_C_int{4, 2, 4, 2}}, - {"net.inet.mobileip.allow", []_C_int{4, 2, 55, 1}}, {"net.inet.pfsync.stats", []_C_int{4, 2, 240, 1}}, - {"net.inet.pim.stats", []_C_int{4, 2, 103, 1}}, {"net.inet.tcp.ackonpush", []_C_int{4, 2, 6, 13}}, {"net.inet.tcp.always_keepalive", []_C_int{4, 2, 6, 22}}, {"net.inet.tcp.baddynamic", []_C_int{4, 2, 6, 6}}, @@ -191,6 +200,7 @@ var sysctlMib = []mibentry{ {"net.inet.tcp.reasslimit", []_C_int{4, 2, 6, 18}}, {"net.inet.tcp.rfc1323", []_C_int{4, 2, 6, 1}}, {"net.inet.tcp.rfc3390", []_C_int{4, 2, 6, 17}}, + {"net.inet.tcp.rootonly", []_C_int{4, 2, 6, 24}}, {"net.inet.tcp.rstppslimit", []_C_int{4, 2, 6, 12}}, {"net.inet.tcp.sack", []_C_int{4, 2, 6, 10}}, {"net.inet.tcp.sackholelimit", []_C_int{4, 2, 6, 20}}, @@ -198,9 +208,12 @@ var sysctlMib = []mibentry{ {"net.inet.tcp.stats", []_C_int{4, 2, 6, 21}}, {"net.inet.tcp.synbucketlimit", []_C_int{4, 2, 6, 16}}, {"net.inet.tcp.syncachelimit", []_C_int{4, 2, 6, 15}}, + {"net.inet.tcp.synhashsize", []_C_int{4, 2, 6, 25}}, + {"net.inet.tcp.synuselimit", []_C_int{4, 2, 6, 23}}, {"net.inet.udp.baddynamic", []_C_int{4, 2, 17, 2}}, {"net.inet.udp.checksum", []_C_int{4, 2, 17, 1}}, {"net.inet.udp.recvspace", []_C_int{4, 2, 17, 3}}, + {"net.inet.udp.rootonly", []_C_int{4, 2, 17, 6}}, {"net.inet.udp.sendspace", []_C_int{4, 2, 17, 4}}, {"net.inet.udp.stats", []_C_int{4, 2, 17, 5}}, {"net.inet6.divert.recvspace", []_C_int{4, 24, 86, 1}}, @@ -213,13 +226,8 @@ var sysctlMib = []mibentry{ {"net.inet6.icmp6.nd6_delay", []_C_int{4, 24, 30, 8}}, {"net.inet6.icmp6.nd6_maxnudhint", []_C_int{4, 24, 30, 15}}, {"net.inet6.icmp6.nd6_mmaxtries", []_C_int{4, 24, 30, 10}}, - {"net.inet6.icmp6.nd6_prune", []_C_int{4, 24, 30, 6}}, {"net.inet6.icmp6.nd6_umaxtries", []_C_int{4, 24, 30, 9}}, - {"net.inet6.icmp6.nd6_useloopback", []_C_int{4, 24, 30, 11}}, - {"net.inet6.icmp6.nodeinfo", []_C_int{4, 24, 30, 13}}, - {"net.inet6.icmp6.rediraccept", []_C_int{4, 24, 30, 2}}, {"net.inet6.icmp6.redirtimeout", []_C_int{4, 24, 30, 3}}, - {"net.inet6.ip6.accept_rtadv", []_C_int{4, 24, 17, 12}}, {"net.inet6.ip6.auto_flowlabel", []_C_int{4, 24, 17, 17}}, {"net.inet6.ip6.dad_count", []_C_int{4, 24, 17, 16}}, {"net.inet6.ip6.dad_pending", []_C_int{4, 24, 17, 49}}, @@ -232,20 +240,19 @@ var sysctlMib = []mibentry{ {"net.inet6.ip6.maxdynroutes", []_C_int{4, 24, 17, 48}}, {"net.inet6.ip6.maxfragpackets", []_C_int{4, 24, 17, 9}}, {"net.inet6.ip6.maxfrags", []_C_int{4, 24, 17, 41}}, - {"net.inet6.ip6.maxifdefrouters", []_C_int{4, 24, 17, 47}}, - {"net.inet6.ip6.maxifprefixes", []_C_int{4, 24, 17, 46}}, {"net.inet6.ip6.mforwarding", []_C_int{4, 24, 17, 42}}, + {"net.inet6.ip6.mrtmfc", []_C_int{4, 24, 17, 53}}, + {"net.inet6.ip6.mrtmif", []_C_int{4, 24, 17, 52}}, {"net.inet6.ip6.mrtproto", []_C_int{4, 24, 17, 8}}, {"net.inet6.ip6.mtudisctimeout", []_C_int{4, 24, 17, 50}}, {"net.inet6.ip6.multicast_mtudisc", []_C_int{4, 24, 17, 44}}, {"net.inet6.ip6.multipath", []_C_int{4, 24, 17, 43}}, {"net.inet6.ip6.neighborgcthresh", []_C_int{4, 24, 17, 45}}, {"net.inet6.ip6.redirect", []_C_int{4, 24, 17, 2}}, - {"net.inet6.ip6.rr_prune", []_C_int{4, 24, 17, 22}}, + {"net.inet6.ip6.soiikey", []_C_int{4, 24, 17, 54}}, {"net.inet6.ip6.sourcecheck", []_C_int{4, 24, 17, 10}}, {"net.inet6.ip6.sourcecheck_logint", []_C_int{4, 24, 17, 11}}, {"net.inet6.ip6.use_deprecated", []_C_int{4, 24, 17, 21}}, - {"net.inet6.ip6.v6only", []_C_int{4, 24, 17, 24}}, {"net.key.sadb_dump", []_C_int{4, 30, 1}}, {"net.key.spd_dump", []_C_int{4, 30, 2}}, {"net.mpls.ifq.congestion", []_C_int{4, 33, 3, 4}}, @@ -254,12 +261,12 @@ var sysctlMib = []mibentry{ {"net.mpls.ifq.maxlen", []_C_int{4, 33, 3, 2}}, {"net.mpls.mapttl_ip", []_C_int{4, 33, 5}}, {"net.mpls.mapttl_ip6", []_C_int{4, 33, 6}}, - {"net.mpls.maxloop_inkernel", []_C_int{4, 33, 4}}, {"net.mpls.ttl", []_C_int{4, 33, 2}}, {"net.pflow.stats", []_C_int{4, 34, 1}}, {"net.pipex.enable", []_C_int{4, 35, 1}}, {"vm.anonmin", []_C_int{2, 7}}, {"vm.loadavg", []_C_int{2, 2}}, + {"vm.malloc_conf", []_C_int{2, 12}}, {"vm.maxslp", []_C_int{2, 10}}, {"vm.nkmempages", []_C_int{2, 6}}, {"vm.psstrings", []_C_int{2, 3}}, diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go index 154b57ae3e2..cbdda1a4ae2 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go @@ -36,6 +36,7 @@ var sysctlMib = []mibentry{ {"hw.pagesize", []_C_int{6, 7}}, {"hw.perfpolicy", []_C_int{6, 23}}, {"hw.physmem", []_C_int{6, 19}}, + {"hw.power", []_C_int{6, 26}}, {"hw.product", []_C_int{6, 15}}, {"hw.serialno", []_C_int{6, 17}}, {"hw.setperf", []_C_int{6, 13}}, @@ -44,6 +45,7 @@ var sysctlMib = []mibentry{ {"hw.uuid", []_C_int{6, 18}}, {"hw.vendor", []_C_int{6, 14}}, {"hw.version", []_C_int{6, 16}}, + {"kern.allowdt", []_C_int{1, 65}}, {"kern.allowkmem", []_C_int{1, 52}}, {"kern.argmax", []_C_int{1, 8}}, {"kern.audio", []_C_int{1, 84}}, @@ -51,6 +53,8 @@ var sysctlMib = []mibentry{ {"kern.bufcachepercent", []_C_int{1, 72}}, {"kern.ccpu", []_C_int{1, 45}}, {"kern.clockrate", []_C_int{1, 12}}, + {"kern.consbuf", []_C_int{1, 83}}, + {"kern.consbufsize", []_C_int{1, 82}}, {"kern.consdev", []_C_int{1, 75}}, {"kern.cp_time", []_C_int{1, 40}}, {"kern.cp_time2", []_C_int{1, 71}}, @@ -83,13 +87,13 @@ var sysctlMib = []mibentry{ {"kern.ngroups", []_C_int{1, 18}}, {"kern.nosuidcoredump", []_C_int{1, 32}}, {"kern.nprocs", []_C_int{1, 47}}, - {"kern.nselcoll", []_C_int{1, 43}}, {"kern.nthreads", []_C_int{1, 26}}, {"kern.numvnodes", []_C_int{1, 58}}, {"kern.osrelease", []_C_int{1, 2}}, {"kern.osrevision", []_C_int{1, 3}}, {"kern.ostype", []_C_int{1, 1}}, {"kern.osversion", []_C_int{1, 27}}, + {"kern.pfstatus", []_C_int{1, 86}}, {"kern.pool_debug", []_C_int{1, 77}}, {"kern.posix1version", []_C_int{1, 17}}, {"kern.proc", []_C_int{1, 66}}, @@ -110,13 +114,16 @@ var sysctlMib = []mibentry{ {"kern.timecounter.hardware", []_C_int{1, 69, 3}}, {"kern.timecounter.tick", []_C_int{1, 69, 1}}, {"kern.timecounter.timestepwarnings", []_C_int{1, 69, 2}}, + {"kern.timeout_stats", []_C_int{1, 87}}, {"kern.tty.tk_cancc", []_C_int{1, 44, 4}}, {"kern.tty.tk_nin", []_C_int{1, 44, 1}}, {"kern.tty.tk_nout", []_C_int{1, 44, 2}}, {"kern.tty.tk_rawcc", []_C_int{1, 44, 3}}, {"kern.tty.ttyinfo", []_C_int{1, 44, 5}}, {"kern.ttycount", []_C_int{1, 57}}, + {"kern.utc_offset", []_C_int{1, 88}}, {"kern.version", []_C_int{1, 4}}, + {"kern.video", []_C_int{1, 89}}, {"kern.watchdog.auto", []_C_int{1, 64, 2}}, {"kern.watchdog.period", []_C_int{1, 64, 1}}, {"kern.witnesswatch", []_C_int{1, 53}}, @@ -179,7 +186,6 @@ var sysctlMib = []mibentry{ {"net.inet.ipcomp.stats", []_C_int{4, 2, 108, 2}}, {"net.inet.ipip.allow", []_C_int{4, 2, 4, 1}}, {"net.inet.ipip.stats", []_C_int{4, 2, 4, 2}}, - {"net.inet.mobileip.allow", []_C_int{4, 2, 55, 1}}, {"net.inet.pfsync.stats", []_C_int{4, 2, 240, 1}}, {"net.inet.tcp.ackonpush", []_C_int{4, 2, 6, 13}}, {"net.inet.tcp.always_keepalive", []_C_int{4, 2, 6, 22}}, @@ -255,7 +261,6 @@ var sysctlMib = []mibentry{ {"net.mpls.ifq.maxlen", []_C_int{4, 33, 3, 2}}, {"net.mpls.mapttl_ip", []_C_int{4, 33, 5}}, {"net.mpls.mapttl_ip6", []_C_int{4, 33, 6}}, - {"net.mpls.maxloop_inkernel", []_C_int{4, 33, 4}}, {"net.mpls.ttl", []_C_int{4, 33, 2}}, {"net.pflow.stats", []_C_int{4, 34, 1}}, {"net.pipex.enable", []_C_int{4, 35, 1}}, diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go index d96bb2ba4db..f55eae1a821 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go @@ -36,6 +36,7 @@ var sysctlMib = []mibentry{ {"hw.pagesize", []_C_int{6, 7}}, {"hw.perfpolicy", []_C_int{6, 23}}, {"hw.physmem", []_C_int{6, 19}}, + {"hw.power", []_C_int{6, 26}}, {"hw.product", []_C_int{6, 15}}, {"hw.serialno", []_C_int{6, 17}}, {"hw.setperf", []_C_int{6, 13}}, @@ -86,7 +87,6 @@ var sysctlMib = []mibentry{ {"kern.ngroups", []_C_int{1, 18}}, {"kern.nosuidcoredump", []_C_int{1, 32}}, {"kern.nprocs", []_C_int{1, 47}}, - {"kern.nselcoll", []_C_int{1, 43}}, {"kern.nthreads", []_C_int{1, 26}}, {"kern.numvnodes", []_C_int{1, 58}}, {"kern.osrelease", []_C_int{1, 2}}, @@ -123,6 +123,7 @@ var sysctlMib = []mibentry{ {"kern.ttycount", []_C_int{1, 57}}, {"kern.utc_offset", []_C_int{1, 88}}, {"kern.version", []_C_int{1, 4}}, + {"kern.video", []_C_int{1, 89}}, {"kern.watchdog.auto", []_C_int{1, 64, 2}}, {"kern.watchdog.period", []_C_int{1, 64, 1}}, {"kern.witnesswatch", []_C_int{1, 53}}, diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go index a37f7737563..01c43a01fda 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go @@ -6,6 +6,7 @@ package unix +// Deprecated: Use libc wrappers instead of direct syscalls. const ( SYS_EXIT = 1 // { void sys_exit(int rval); } SYS_FORK = 2 // { int sys_fork(void); } diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go index 2fd2060e617..9bc4c8f9d88 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go @@ -491,6 +491,90 @@ type Utsname struct { Machine [256]byte } +const SizeofUvmexp = 0x278 + +type Uvmexp struct { + Pagesize int64 + Pagemask int64 + Pageshift int64 + Npages int64 + Free int64 + Active int64 + Inactive int64 + Paging int64 + Wired int64 + Zeropages int64 + Reserve_pagedaemon int64 + Reserve_kernel int64 + Freemin int64 + Freetarg int64 + Inactarg int64 + Wiredmax int64 + Nswapdev int64 + Swpages int64 + Swpginuse int64 + Swpgonly int64 + Nswget int64 + Unused1 int64 + Cpuhit int64 + Cpumiss int64 + Faults int64 + Traps int64 + Intrs int64 + Swtch int64 + Softs int64 + Syscalls int64 + Pageins int64 + Swapins int64 + Swapouts int64 + Pgswapin int64 + Pgswapout int64 + Forks int64 + Forks_ppwait int64 + Forks_sharevm int64 + Pga_zerohit int64 + Pga_zeromiss int64 + Zeroaborts int64 + Fltnoram int64 + Fltnoanon int64 + Fltpgwait int64 + Fltpgrele int64 + Fltrelck int64 + Fltrelckok int64 + Fltanget int64 + Fltanretry int64 + Fltamcopy int64 + Fltnamap int64 + Fltnomap int64 + Fltlget int64 + Fltget int64 + Flt_anon int64 + Flt_acow int64 + Flt_obj int64 + Flt_prcopy int64 + Flt_przero int64 + Pdwoke int64 + Pdrevs int64 + Unused4 int64 + Pdfreed int64 + Pdscans int64 + Pdanscan int64 + Pdobscan int64 + Pdreact int64 + Pdbusy int64 + Pdpageouts int64 + Pdpending int64 + Pddeact int64 + Anonpages int64 + Filepages int64 + Execpages int64 + Colorhit int64 + Colormiss int64 + Ncolors int64 + Bootpages int64 + Poolpages int64 +} + const SizeofClockinfo = 0x14 type Clockinfo struct { diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go index 6a5a1a8ae55..bb05f655d22 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go @@ -499,6 +499,90 @@ type Utsname struct { Machine [256]byte } +const SizeofUvmexp = 0x278 + +type Uvmexp struct { + Pagesize int64 + Pagemask int64 + Pageshift int64 + Npages int64 + Free int64 + Active int64 + Inactive int64 + Paging int64 + Wired int64 + Zeropages int64 + Reserve_pagedaemon int64 + Reserve_kernel int64 + Freemin int64 + Freetarg int64 + Inactarg int64 + Wiredmax int64 + Nswapdev int64 + Swpages int64 + Swpginuse int64 + Swpgonly int64 + Nswget int64 + Unused1 int64 + Cpuhit int64 + Cpumiss int64 + Faults int64 + Traps int64 + Intrs int64 + Swtch int64 + Softs int64 + Syscalls int64 + Pageins int64 + Swapins int64 + Swapouts int64 + Pgswapin int64 + Pgswapout int64 + Forks int64 + Forks_ppwait int64 + Forks_sharevm int64 + Pga_zerohit int64 + Pga_zeromiss int64 + Zeroaborts int64 + Fltnoram int64 + Fltnoanon int64 + Fltpgwait int64 + Fltpgrele int64 + Fltrelck int64 + Fltrelckok int64 + Fltanget int64 + Fltanretry int64 + Fltamcopy int64 + Fltnamap int64 + Fltnomap int64 + Fltlget int64 + Fltget int64 + Flt_anon int64 + Flt_acow int64 + Flt_obj int64 + Flt_prcopy int64 + Flt_przero int64 + Pdwoke int64 + Pdrevs int64 + Unused4 int64 + Pdfreed int64 + Pdscans int64 + Pdanscan int64 + Pdobscan int64 + Pdreact int64 + Pdbusy int64 + Pdpageouts int64 + Pdpending int64 + Pddeact int64 + Anonpages int64 + Filepages int64 + Execpages int64 + Colorhit int64 + Colormiss int64 + Ncolors int64 + Bootpages int64 + Poolpages int64 +} + const SizeofClockinfo = 0x14 type Clockinfo struct { diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go index 84cc8d01e65..db40e3a19c6 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go @@ -496,6 +496,90 @@ type Utsname struct { Machine [256]byte } +const SizeofUvmexp = 0x278 + +type Uvmexp struct { + Pagesize int64 + Pagemask int64 + Pageshift int64 + Npages int64 + Free int64 + Active int64 + Inactive int64 + Paging int64 + Wired int64 + Zeropages int64 + Reserve_pagedaemon int64 + Reserve_kernel int64 + Freemin int64 + Freetarg int64 + Inactarg int64 + Wiredmax int64 + Nswapdev int64 + Swpages int64 + Swpginuse int64 + Swpgonly int64 + Nswget int64 + Unused1 int64 + Cpuhit int64 + Cpumiss int64 + Faults int64 + Traps int64 + Intrs int64 + Swtch int64 + Softs int64 + Syscalls int64 + Pageins int64 + Swapins int64 + Swapouts int64 + Pgswapin int64 + Pgswapout int64 + Forks int64 + Forks_ppwait int64 + Forks_sharevm int64 + Pga_zerohit int64 + Pga_zeromiss int64 + Zeroaborts int64 + Fltnoram int64 + Fltnoanon int64 + Fltpgwait int64 + Fltpgrele int64 + Fltrelck int64 + Fltrelckok int64 + Fltanget int64 + Fltanretry int64 + Fltamcopy int64 + Fltnamap int64 + Fltnomap int64 + Fltlget int64 + Fltget int64 + Flt_anon int64 + Flt_acow int64 + Flt_obj int64 + Flt_prcopy int64 + Flt_przero int64 + Pdwoke int64 + Pdrevs int64 + Unused4 int64 + Pdfreed int64 + Pdscans int64 + Pdanscan int64 + Pdobscan int64 + Pdreact int64 + Pdbusy int64 + Pdpageouts int64 + Pdpending int64 + Pddeact int64 + Anonpages int64 + Filepages int64 + Execpages int64 + Colorhit int64 + Colormiss int64 + Ncolors int64 + Bootpages int64 + Poolpages int64 +} + const SizeofClockinfo = 0x14 type Clockinfo struct { diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go index c844e7096ff..11121151ccf 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go @@ -499,6 +499,90 @@ type Utsname struct { Machine [256]byte } +const SizeofUvmexp = 0x278 + +type Uvmexp struct { + Pagesize int64 + Pagemask int64 + Pageshift int64 + Npages int64 + Free int64 + Active int64 + Inactive int64 + Paging int64 + Wired int64 + Zeropages int64 + Reserve_pagedaemon int64 + Reserve_kernel int64 + Freemin int64 + Freetarg int64 + Inactarg int64 + Wiredmax int64 + Nswapdev int64 + Swpages int64 + Swpginuse int64 + Swpgonly int64 + Nswget int64 + Unused1 int64 + Cpuhit int64 + Cpumiss int64 + Faults int64 + Traps int64 + Intrs int64 + Swtch int64 + Softs int64 + Syscalls int64 + Pageins int64 + Swapins int64 + Swapouts int64 + Pgswapin int64 + Pgswapout int64 + Forks int64 + Forks_ppwait int64 + Forks_sharevm int64 + Pga_zerohit int64 + Pga_zeromiss int64 + Zeroaborts int64 + Fltnoram int64 + Fltnoanon int64 + Fltpgwait int64 + Fltpgrele int64 + Fltrelck int64 + Fltrelckok int64 + Fltanget int64 + Fltanretry int64 + Fltamcopy int64 + Fltnamap int64 + Fltnomap int64 + Fltlget int64 + Fltget int64 + Flt_anon int64 + Flt_acow int64 + Flt_obj int64 + Flt_prcopy int64 + Flt_przero int64 + Pdwoke int64 + Pdrevs int64 + Unused4 int64 + Pdfreed int64 + Pdscans int64 + Pdanscan int64 + Pdobscan int64 + Pdreact int64 + Pdbusy int64 + Pdpageouts int64 + Pdpending int64 + Pddeact int64 + Anonpages int64 + Filepages int64 + Execpages int64 + Colorhit int64 + Colormiss int64 + Ncolors int64 + Bootpages int64 + Poolpages int64 +} + const SizeofClockinfo = 0x14 type Clockinfo struct { diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go index 2ed718ca06a..26eba23b729 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go @@ -58,22 +58,22 @@ type Rlimit struct { type _Gid_t uint32 type Stat_t struct { - Mode uint32 - Dev int32 - Ino uint64 - Nlink uint32 - Uid uint32 - Gid uint32 - Rdev int32 - Atim Timespec - Mtim Timespec - Ctim Timespec - Size int64 - Blocks int64 - Blksize uint32 - Flags uint32 - Gen uint32 - X__st_birthtim Timespec + Mode uint32 + Dev int32 + Ino uint64 + Nlink uint32 + Uid uint32 + Gid uint32 + Rdev int32 + Atim Timespec + Mtim Timespec + Ctim Timespec + Size int64 + Blocks int64 + Blksize int32 + Flags uint32 + Gen uint32 + _ Timespec } type Statfs_t struct { @@ -98,7 +98,7 @@ type Statfs_t struct { F_mntonname [90]byte F_mntfromname [90]byte F_mntfromspec [90]byte - Pad_cgo_0 [2]byte + _ [2]byte Mount_info [160]byte } @@ -111,13 +111,13 @@ type Flock_t struct { } type Dirent struct { - Fileno uint64 - Off int64 - Reclen uint16 - Type uint8 - Namlen uint8 - X__d_padding [4]uint8 - Name [256]int8 + Fileno uint64 + Off int64 + Reclen uint16 + Type uint8 + Namlen uint8 + _ [4]uint8 + Name [256]int8 } type Fsid struct { @@ -262,8 +262,8 @@ type FdSet struct { } const ( - SizeofIfMsghdr = 0xec - SizeofIfData = 0xd4 + SizeofIfMsghdr = 0xa0 + SizeofIfData = 0x88 SizeofIfaMsghdr = 0x18 SizeofIfAnnounceMsghdr = 0x1a SizeofRtMsghdr = 0x60 @@ -292,7 +292,7 @@ type IfData struct { Link_state uint8 Mtu uint32 Metric uint32 - Pad uint32 + Rdomain uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 @@ -304,10 +304,10 @@ type IfData struct { Imcasts uint64 Omcasts uint64 Iqdrops uint64 + Oqdrops uint64 Noproto uint64 Capabilities uint32 Lastchange Timeval - Mclpool [7]Mclpool } type IfaMsghdr struct { @@ -368,20 +368,12 @@ type RtMetrics struct { Pad uint32 } -type Mclpool struct { - Grown int32 - Alive uint16 - Hwm uint16 - Cwm uint16 - Lwm uint16 -} - const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfProgram = 0x8 SizeofBpfInsn = 0x8 - SizeofBpfHdr = 0x14 + SizeofBpfHdr = 0x18 ) type BpfVersion struct { @@ -407,11 +399,14 @@ type BpfInsn struct { } type BpfHdr struct { - Tstamp BpfTimeval - Caplen uint32 - Datalen uint32 - Hdrlen uint16 - Pad_cgo_0 [2]byte + Tstamp BpfTimeval + Caplen uint32 + Datalen uint32 + Hdrlen uint16 + Ifidx uint16 + Flowid uint16 + Flags uint8 + Drops uint8 } type BpfTimeval struct { @@ -488,7 +483,7 @@ type Uvmexp struct { Zeropages int32 Reserve_pagedaemon int32 Reserve_kernel int32 - Anonpages int32 + Unused01 int32 Vnodepages int32 Vtextpages int32 Freemin int32 @@ -507,8 +502,8 @@ type Uvmexp struct { Swpgonly int32 Nswget int32 Nanon int32 - Nanonneeded int32 - Nfreeanon int32 + Unused05 int32 + Unused06 int32 Faults int32 Traps int32 Intrs int32 @@ -516,8 +511,8 @@ type Uvmexp struct { Softs int32 Syscalls int32 Pageins int32 - Obsolete_swapins int32 - Obsolete_swapouts int32 + Unused07 int32 + Unused08 int32 Pgswapin int32 Pgswapout int32 Forks int32 @@ -525,7 +520,7 @@ type Uvmexp struct { Forks_sharevm int32 Pga_zerohit int32 Pga_zeromiss int32 - Zeroaborts int32 + Unused09 int32 Fltnoram int32 Fltnoanon int32 Fltnoamap int32 @@ -557,9 +552,9 @@ type Uvmexp struct { Pdpageouts int32 Pdpending int32 Pddeact int32 - Pdreanon int32 - Pdrevnode int32 - Pdrevtext int32 + Unused11 int32 + Unused12 int32 + Unused13 int32 Fpswtch int32 Kmapent int32 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go index b4fb97ebe65..5a547988698 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go @@ -73,7 +73,6 @@ type Stat_t struct { Blksize int32 Flags uint32 Gen uint32 - _ [4]byte _ Timespec } @@ -81,7 +80,6 @@ type Statfs_t struct { F_flags uint32 F_bsize uint32 F_iosize uint32 - _ [4]byte F_blocks uint64 F_bfree uint64 F_bavail int64 @@ -200,10 +198,8 @@ type IPv6Mreq struct { type Msghdr struct { Name *byte Namelen uint32 - _ [4]byte Iov *Iovec Iovlen uint32 - _ [4]byte Control *byte Controllen uint32 Flags int32 @@ -311,7 +307,6 @@ type IfData struct { Oqdrops uint64 Noproto uint64 Capabilities uint32 - _ [4]byte Lastchange Timeval } @@ -373,14 +368,12 @@ type RtMetrics struct { Pad uint32 } -type Mclpool struct{} - const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 - SizeofBpfHdr = 0x14 + SizeofBpfHdr = 0x18 ) type BpfVersion struct { @@ -395,7 +388,6 @@ type BpfStat struct { type BpfProgram struct { Len uint32 - _ [4]byte Insns *BpfInsn } @@ -411,7 +403,10 @@ type BpfHdr struct { Caplen uint32 Datalen uint32 Hdrlen uint16 - _ [2]byte + Ifidx uint16 + Flowid uint16 + Flags uint8 + Drops uint8 } type BpfTimeval struct { @@ -488,7 +483,7 @@ type Uvmexp struct { Zeropages int32 Reserve_pagedaemon int32 Reserve_kernel int32 - Anonpages int32 + Unused01 int32 Vnodepages int32 Vtextpages int32 Freemin int32 @@ -507,8 +502,8 @@ type Uvmexp struct { Swpgonly int32 Nswget int32 Nanon int32 - Nanonneeded int32 - Nfreeanon int32 + Unused05 int32 + Unused06 int32 Faults int32 Traps int32 Intrs int32 @@ -516,8 +511,8 @@ type Uvmexp struct { Softs int32 Syscalls int32 Pageins int32 - Obsolete_swapins int32 - Obsolete_swapouts int32 + Unused07 int32 + Unused08 int32 Pgswapin int32 Pgswapout int32 Forks int32 @@ -525,7 +520,7 @@ type Uvmexp struct { Forks_sharevm int32 Pga_zerohit int32 Pga_zeromiss int32 - Zeroaborts int32 + Unused09 int32 Fltnoram int32 Fltnoanon int32 Fltnoamap int32 @@ -557,9 +552,9 @@ type Uvmexp struct { Pdpageouts int32 Pdpending int32 Pddeact int32 - Pdreanon int32 - Pdrevnode int32 - Pdrevtext int32 + Unused11 int32 + Unused12 int32 + Unused13 int32 Fpswtch int32 Kmapent int32 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go index 2c4675040ef..be58c4e1ff8 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go @@ -375,14 +375,12 @@ type RtMetrics struct { Pad uint32 } -type Mclpool struct{} - const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfProgram = 0x8 SizeofBpfInsn = 0x8 - SizeofBpfHdr = 0x14 + SizeofBpfHdr = 0x18 ) type BpfVersion struct { @@ -412,7 +410,10 @@ type BpfHdr struct { Caplen uint32 Datalen uint32 Hdrlen uint16 - _ [2]byte + Ifidx uint16 + Flowid uint16 + Flags uint8 + Drops uint8 } type BpfTimeval struct { diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go index ddee0451470..52338266cb3 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go @@ -368,14 +368,12 @@ type RtMetrics struct { Pad uint32 } -type Mclpool struct{} - const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 - SizeofBpfHdr = 0x14 + SizeofBpfHdr = 0x18 ) type BpfVersion struct { @@ -405,7 +403,10 @@ type BpfHdr struct { Caplen uint32 Datalen uint32 Hdrlen uint16 - _ [2]byte + Ifidx uint16 + Flowid uint16 + Flags uint8 + Drops uint8 } type BpfTimeval struct { diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go index eb13d4e8bfc..605cfdb12b1 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go @@ -368,14 +368,12 @@ type RtMetrics struct { Pad uint32 } -type Mclpool struct{} - const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 - SizeofBpfHdr = 0x14 + SizeofBpfHdr = 0x18 ) type BpfVersion struct { @@ -405,7 +403,10 @@ type BpfHdr struct { Caplen uint32 Datalen uint32 Hdrlen uint16 - _ [2]byte + Ifidx uint16 + Flowid uint16 + Flags uint8 + Drops uint8 } type BpfTimeval struct { diff --git a/vendor/modules.txt b/vendor/modules.txt index 18ce1cf0205..4a58d2efb0b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -678,11 +678,11 @@ github.com/oklog/run # github.com/oklog/ulid v1.3.1 ## explicit github.com/oklog/ulid -# github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.57.2 -## explicit; go 1.17 +# github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.69.0 +## explicit; go 1.18 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus -# github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.57.2 -## explicit; go 1.17 +# github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.69.0 +## explicit; go 1.18 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite # github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e ## explicit; go 1.11 @@ -989,9 +989,11 @@ go.opencensus.io/trace/tracestate # go.opentelemetry.io/collector v0.57.2 ## explicit; go 1.17 go.opentelemetry.io/collector/consumer/consumererror -go.opentelemetry.io/collector/service/featuregate -# go.opentelemetry.io/collector/pdata v0.57.2 -## explicit; go 1.17 +# go.opentelemetry.io/collector/featuregate v0.69.0 +## explicit; go 1.18 +go.opentelemetry.io/collector/featuregate +# go.opentelemetry.io/collector/pdata v1.0.0-rc3.0.20230109164642-7d168dd20efd +## explicit; go 1.18 go.opentelemetry.io/collector/pdata/internal go.opentelemetry.io/collector/pdata/internal/data go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1 @@ -1002,14 +1004,18 @@ go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1 go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1 go.opentelemetry.io/collector/pdata/internal/data/protogen/resource/v1 go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1 +go.opentelemetry.io/collector/pdata/internal/json go.opentelemetry.io/collector/pdata/internal/otlp go.opentelemetry.io/collector/pdata/pcommon go.opentelemetry.io/collector/pdata/plog +go.opentelemetry.io/collector/pdata/plog/internal/plogjson go.opentelemetry.io/collector/pdata/pmetric +go.opentelemetry.io/collector/pdata/pmetric/internal/pmetricjson go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp go.opentelemetry.io/collector/pdata/ptrace -# go.opentelemetry.io/collector/semconv v0.57.2 -## explicit; go 1.17 +go.opentelemetry.io/collector/pdata/ptrace/internal/ptracejson +# go.opentelemetry.io/collector/semconv v0.69.0 +## explicit; go 1.18 go.opentelemetry.io/collector/semconv/v1.6.1 # go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0 ## explicit; go 1.18 @@ -1048,8 +1054,8 @@ go.uber.org/atomic ## explicit; go 1.18 go.uber.org/goleak go.uber.org/goleak/internal/stack -# go.uber.org/multierr v1.8.0 -## explicit; go 1.14 +# go.uber.org/multierr v1.9.0 +## explicit; go 1.19 go.uber.org/multierr # go.uber.org/zap v1.21.0 ## explicit; go 1.13 @@ -1082,7 +1088,7 @@ golang.org/x/exp/slices # golang.org/x/mod v0.7.0 ## explicit; go 1.17 golang.org/x/mod/semver -# golang.org/x/net v0.4.0 +# golang.org/x/net v0.5.0 ## explicit; go 1.17 golang.org/x/net/bpf golang.org/x/net/context @@ -1113,14 +1119,14 @@ golang.org/x/oauth2/jwt ## explicit golang.org/x/sync/errgroup golang.org/x/sync/semaphore -# golang.org/x/sys v0.3.0 +# golang.org/x/sys v0.4.0 ## explicit; go 1.17 golang.org/x/sys/cpu golang.org/x/sys/execabs golang.org/x/sys/internal/unsafeheader golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/text v0.5.0 +# golang.org/x/text v0.6.0 ## explicit; go 1.17 golang.org/x/text/cases golang.org/x/text/internal