aboutsummaryrefslogtreecommitdiffstats
path: root/modules/log/groutinelabel.go
blob: 56d7af42da3fbfe52375ac1e211d714d0f1a7570 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package log

import "unsafe"

//go:linkname runtime_getProfLabel runtime/pprof.runtime_getProfLabel
func runtime_getProfLabel() unsafe.Pointer //nolint

type labelMap map[string]string

func getGoroutineLabels() map[string]string {
	l := (*labelMap)(runtime_getProfLabel())
	if l == nil {
		return nil
	}
	return *l
}