@@ -62,8 +62,11 @@ func NewAnalyzeQueue(ctx *common.AccessLogContext) (*AnalyzeQueue, error) {
62
62
if int (perCPUBufferSize ) < os .Getpagesize () {
63
63
return nil , fmt .Errorf ("the cpu buffer must bigger than %dB" , os .Getpagesize ())
64
64
}
65
- if ctx .Config .ProtocolAnalyze .Parallels < 1 {
66
- return nil , fmt .Errorf ("the parallels cannot be small than 1" )
65
+ if ctx .Config .ProtocolAnalyze .AnalyzeParallels < 1 {
66
+ return nil , fmt .Errorf ("the analyze parallels cannot be small than 1" )
67
+ }
68
+ if ctx .Config .ProtocolAnalyze .ParseParallels < 1 {
69
+ return nil , fmt .Errorf ("the parse parallels cannot be small than 1" )
67
70
}
68
71
if ctx .Config .ProtocolAnalyze .QueueSize < 1 {
69
72
return nil , fmt .Errorf ("the queue size be small than 1" )
@@ -85,20 +88,22 @@ func NewAnalyzeQueue(ctx *common.AccessLogContext) (*AnalyzeQueue, error) {
85
88
}
86
89
87
90
func (q * AnalyzeQueue ) Start (ctx context.Context ) {
88
- q .eventQueue = btf .NewEventQueue (q .context .Config .ProtocolAnalyze .Parallels , q .context .Config .ProtocolAnalyze .QueueSize ,
91
+ q .eventQueue = btf .NewEventQueue (q .context .Config .ProtocolAnalyze .AnalyzeParallels , q .context .Config .ProtocolAnalyze .QueueSize ,
89
92
func (num int ) btf.PartitionContext {
90
93
return NewPartitionContext (q .context , num , q .supportAnalyzers (q .context ))
91
94
})
92
- q .eventQueue .RegisterReceiver (q .context .BPF .SocketDetailDataQueue , int (q .perCPUBuffer ), func () interface {} {
93
- return q .detailSupplier ()
94
- }, func (data interface {}) string {
95
- return fmt .Sprintf ("%d" , data .(events.SocketDetail ).GetConnectionID ())
96
- })
97
- q .eventQueue .RegisterReceiver (q .context .BPF .SocketDataUploadEventQueue , int (q .perCPUBuffer ), func () interface {} {
98
- return & events.SocketDataUploadEvent {}
99
- }, func (data interface {}) string {
100
- return fmt .Sprintf ("%d" , data .(* events.SocketDataUploadEvent ).ConnectionID )
101
- })
95
+ q .eventQueue .RegisterReceiver (q .context .BPF .SocketDetailDataQueue , int (q .perCPUBuffer ),
96
+ q .context .Config .ProtocolAnalyze .ParseParallels , func () interface {} {
97
+ return q .detailSupplier ()
98
+ }, func (data interface {}) string {
99
+ return fmt .Sprintf ("%d" , data .(events.SocketDetail ).GetConnectionID ())
100
+ })
101
+ q .eventQueue .RegisterReceiver (q .context .BPF .SocketDataUploadEventQueue , int (q .perCPUBuffer ),
102
+ q .context .Config .ProtocolAnalyze .ParseParallels , func () interface {} {
103
+ return & events.SocketDataUploadEvent {}
104
+ }, func (data interface {}) string {
105
+ return fmt .Sprintf ("%d" , data .(* events.SocketDataUploadEvent ).ConnectionID )
106
+ })
102
107
103
108
q .eventQueue .Start (ctx , q .context .BPF .Linker )
104
109
}
0 commit comments