You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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. }