Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

groutinelabel.go 482B

1234567891011121314151617181920
  1. // Copyright 2022 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package log
  5. import "unsafe"
  6. //go:linkname runtime_getProfLabel runtime/pprof.runtime_getProfLabel
  7. func runtime_getProfLabel() unsafe.Pointer // nolint
  8. type labelMap map[string]string
  9. func getGoroutineLabels() map[string]string {
  10. l := (*labelMap)(runtime_getProfLabel())
  11. if l == nil {
  12. return nil
  13. }
  14. return *l
  15. }