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 409B

12345678910111213141516171819
  1. // Copyright 2022 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package log
  4. import "unsafe"
  5. //go:linkname runtime_getProfLabel runtime/pprof.runtime_getProfLabel
  6. func runtime_getProfLabel() unsafe.Pointer //nolint
  7. type labelMap map[string]string
  8. func getGoroutineLabels() map[string]string {
  9. l := (*labelMap)(runtime_getProfLabel())
  10. if l == nil {
  11. return nil
  12. }
  13. return *l
  14. }