mirror of
https://github.com/hengyoush/kyanos.git
synced 2025-12-20 01:03:46 +08:00
[Fix] fix redis nil bug
This commit is contained in:
@@ -471,6 +471,9 @@ func getCmdAndArgs(payloads []ParsedMessage) (string, string) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(payloads) == 0 {
|
||||
return "", ""
|
||||
}
|
||||
firstMessage := convertParsedMessageToRedisMessage(payloads[0])
|
||||
candidateCmd := strings.ToUpper(firstMessage.payload)
|
||||
_, ok := redisCommandsMap[candidateCmd]
|
||||
|
||||
BIN
bpf/custom-archive/centos/8/x86_64/4.19.104-300.el7.x86_64.btf
Normal file
BIN
bpf/custom-archive/centos/8/x86_64/4.19.104-300.el7.x86_64.btf
Normal file
Binary file not shown.
BIN
bpf/custom-archive/centos/8/x86_64/4.19.110-300.el7.x86_64.btf
Normal file
BIN
bpf/custom-archive/centos/8/x86_64/4.19.110-300.el7.x86_64.btf
Normal file
Binary file not shown.
BIN
bpf/custom-archive/centos/8/x86_64/4.19.113-300.el7.x86_64.btf
Normal file
BIN
bpf/custom-archive/centos/8/x86_64/4.19.113-300.el7.x86_64.btf
Normal file
Binary file not shown.
BIN
bpf/custom-archive/centos/8/x86_64/4.19.84-300.el7.x86_64.btf
Normal file
BIN
bpf/custom-archive/centos/8/x86_64/4.19.84-300.el7.x86_64.btf
Normal file
Binary file not shown.
BIN
bpf/custom-archive/centos/8/x86_64/4.19.94-300.el7.x86_64.btf
Normal file
BIN
bpf/custom-archive/centos/8/x86_64/4.19.94-300.el7.x86_64.btf
Normal file
Binary file not shown.
BIN
bpf/custom-archive/centos/8/x86_64/5.4.28-200.el7.x86_64.btf
Normal file
BIN
bpf/custom-archive/centos/8/x86_64/5.4.28-200.el7.x86_64.btf
Normal file
Binary file not shown.
4
go.mod
4
go.mod
@@ -26,7 +26,10 @@ require (
|
||||
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
|
||||
github.com/lestrrat-go/strftime v1.0.6 // indirect
|
||||
github.com/magiconair/properties v1.8.7 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.2 // indirect
|
||||
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
@@ -46,6 +49,7 @@ require (
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/gizak/termui/v3 v3.1.0
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/spf13/viper v1.18.2
|
||||
|
||||
8
go.sum
8
go.sum
@@ -15,6 +15,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk
|
||||
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||
github.com/gizak/termui/v3 v3.1.0 h1:ZZmVDgwHl7gR7elfKf1xc4IudXZ5qqfDh4wExk4Iajc=
|
||||
github.com/gizak/termui/v3 v3.1.0/go.mod h1:bXQEBkJpzxUAKf0+xq9MSWAvWZlE7c+aidmyFlkYTrY=
|
||||
github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI=
|
||||
github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
@@ -43,8 +45,14 @@ github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205Ah
|
||||
github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw=
|
||||
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
|
||||
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
|
||||
github.com/mattn/go-runewidth v0.0.2 h1:UnlwIPBGaTZfPQ6T1IGzPI0EkYAQmT9fAEJ/poFC63o=
|
||||
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM=
|
||||
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d h1:x3S6kxmy49zXVVyhcnrFqxvNVCBPb2KZ9hV2RBdS840=
|
||||
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ=
|
||||
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
|
||||
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
|
||||
23
main.go
23
main.go
@@ -1,9 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"kyanos/cmd"
|
||||
"log"
|
||||
|
||||
ui "github.com/gizak/termui/v3"
|
||||
"github.com/gizak/termui/v3/widgets"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cmd.Execute()
|
||||
// cmd.Execute()
|
||||
if err := ui.Init(); err != nil {
|
||||
log.Fatalf("failed to initialize termui: %v", err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
p := widgets.NewParagraph()
|
||||
p.Text = "Hello World!"
|
||||
p.SetRect(0, 0, 25, 5)
|
||||
|
||||
ui.Render(p)
|
||||
|
||||
for e := range ui.PollEvents() {
|
||||
if e.Type == ui.KeyboardEvent {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user