Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.51
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
go /
src /
runtime /
pprof /
[ HOME SHELL ]
Name
Size
Permission
Action
internal
[ DIR ]
drwxr-xr-x
testdata
[ DIR ]
drwxr-xr-x
elf.go
2.79
KB
-rw-r--r--
label.go
2.55
KB
-rw-r--r--
label_test.go
2.53
KB
-rw-r--r--
map.go
1.94
KB
-rw-r--r--
mprof_test.go
5.35
KB
-rw-r--r--
pprof.go
27.24
KB
-rw-r--r--
pprof_test.go
34.46
KB
-rw-r--r--
proto.go
22.63
KB
-rw-r--r--
proto_test.go
16.25
KB
-rw-r--r--
protobuf.go
2.51
KB
-rw-r--r--
protomem.go
2.91
KB
-rw-r--r--
protomem_test.go
2.54
KB
-rw-r--r--
runtime.go
1.5
KB
-rw-r--r--
runtime_test.go
3
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : runtime_test.go
// Copyright 2017 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 pprof import ( "context" "fmt" "reflect" "testing" ) func TestSetGoroutineLabels(t *testing.T) { sync := make(chan struct{}) wantLabels := map[string]string{} if gotLabels := getProfLabel(); !reflect.DeepEqual(gotLabels, wantLabels) { t.Errorf("Expected parent goroutine's profile labels to be empty before test, got %v", gotLabels) } go func() { if gotLabels := getProfLabel(); !reflect.DeepEqual(gotLabels, wantLabels) { t.Errorf("Expected child goroutine's profile labels to be empty before test, got %v", gotLabels) } sync <- struct{}{} }() <-sync wantLabels = map[string]string{"key": "value"} ctx := WithLabels(context.Background(), Labels("key", "value")) SetGoroutineLabels(ctx) if gotLabels := getProfLabel(); !reflect.DeepEqual(gotLabels, wantLabels) { t.Errorf("parent goroutine's profile labels: got %v, want %v", gotLabels, wantLabels) } go func() { if gotLabels := getProfLabel(); !reflect.DeepEqual(gotLabels, wantLabels) { t.Errorf("child goroutine's profile labels: got %v, want %v", gotLabels, wantLabels) } sync <- struct{}{} }() <-sync wantLabels = map[string]string{} ctx = context.Background() SetGoroutineLabels(ctx) if gotLabels := getProfLabel(); !reflect.DeepEqual(gotLabels, wantLabels) { t.Errorf("Expected parent goroutine's profile labels to be empty, got %v", gotLabels) } go func() { if gotLabels := getProfLabel(); !reflect.DeepEqual(gotLabels, wantLabels) { t.Errorf("Expected child goroutine's profile labels to be empty, got %v", gotLabels) } sync <- struct{}{} }() <-sync } func TestDo(t *testing.T) { wantLabels := map[string]string{} if gotLabels := getProfLabel(); !reflect.DeepEqual(gotLabels, wantLabels) { t.Errorf("Expected parent goroutine's profile labels to be empty before Do, got %v", gotLabels) } Do(context.Background(), Labels("key1", "value1", "key2", "value2"), func(ctx context.Context) { wantLabels := map[string]string{"key1": "value1", "key2": "value2"} if gotLabels := getProfLabel(); !reflect.DeepEqual(gotLabels, wantLabels) { t.Errorf("parent goroutine's profile labels: got %v, want %v", gotLabels, wantLabels) } sync := make(chan struct{}) go func() { wantLabels := map[string]string{"key1": "value1", "key2": "value2"} if gotLabels := getProfLabel(); !reflect.DeepEqual(gotLabels, wantLabels) { t.Errorf("child goroutine's profile labels: got %v, want %v", gotLabels, wantLabels) } sync <- struct{}{} }() <-sync }) wantLabels = map[string]string{} if gotLabels := getProfLabel(); !reflect.DeepEqual(gotLabels, wantLabels) { fmt.Printf("%#v", gotLabels) fmt.Printf("%#v", wantLabels) t.Errorf("Expected parent goroutine's profile labels to be empty after Do, got %v", gotLabels) } } func getProfLabel() map[string]string { l := (*labelMap)(runtime_getProfLabel()) if l == nil { return map[string]string{} } return *l }
Close