Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
netobserv-ebpf-agent
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hdacloud
netobserv-ebpf-agent
Commits
93fd553e
Commit
93fd553e
authored
1 year ago
by
Mohamed Mahmoud
Browse files
Options
Downloads
Patches
Plain Diff
fix ebpf program name for older kernel
Signed-off-by:
Mohamed Mahmoud
<
mmahmoud@redhat.com
>
parent
40c4f8b7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/ebpf/tracer.go
+18
-6
18 additions, 6 deletions
pkg/ebpf/tracer.go
with
18 additions
and
6 deletions
pkg/ebpf/tracer.go
+
18
−
6
View file @
93fd553e
...
@@ -606,10 +606,16 @@ func kernelSpecificLoadAndAssign(oldKernel bool, spec *ebpf.CollectionSpec) (Bpf
...
@@ -606,10 +606,16 @@ func kernelSpecificLoadAndAssign(oldKernel bool, spec *ebpf.CollectionSpec) (Bpf
// Here we define another structure similar to the bpf2go created one but w/o the hooks that does not exist in older kernel
// Here we define another structure similar to the bpf2go created one but w/o the hooks that does not exist in older kernel
// Note: if new hooks are added in the future we need to update the following structures manually
// Note: if new hooks are added in the future we need to update the following structures manually
type
NewBpfPrograms
struct
{
type
NewBpfPrograms
struct
{
TcEgressFlowParse
*
ebpf
.
Program
`ebpf:"egress_flow_parse"`
TcEgressFlowParse
*
ebpf
.
Program
`ebpf:"tc_egress_flow_parse"`
TcIngressFlowParse
*
ebpf
.
Program
`ebpf:"ingress_flow_parse"`
TcIngressFlowParse
*
ebpf
.
Program
`ebpf:"tc_ingress_flow_parse"`
TCPRcvFentry
*
ebpf
.
Program
`ebpf:"tcp_rcv_fentry"`
TcxEgressFlowParse
*
ebpf
.
Program
`ebpf:"tcx_egress_flow_parse"`
TCPRcvKprobe
*
ebpf
.
Program
`ebpf:"tcp_rcv_kprobe"`
TcxIngressFlowParse
*
ebpf
.
Program
`ebpf:"tcx_ingress_flow_parse"`
TcEgressPcaParse
*
ebpf
.
Program
`ebpf:"tc_egress_pca_parse"`
TcIngressPcaParse
*
ebpf
.
Program
`ebpf:"tc_ingress_pca_parse"`
TcxEgressPcaParse
*
ebpf
.
Program
`ebpf:"tcx_egress_pca_parse"`
TcxIngressPcaParse
*
ebpf
.
Program
`ebpf:"tcx_ingress_pca_parse"`
TCPRcvFentry
*
ebpf
.
Program
`ebpf:"tcp_rcv_fentry"`
TCPRcvKprobe
*
ebpf
.
Program
`ebpf:"tcp_rcv_kprobe"`
}
}
type
NewBpfObjects
struct
{
type
NewBpfObjects
struct
{
NewBpfPrograms
NewBpfPrograms
...
@@ -634,6 +640,12 @@ func kernelSpecificLoadAndAssign(oldKernel bool, spec *ebpf.CollectionSpec) (Bpf
...
@@ -634,6 +640,12 @@ func kernelSpecificLoadAndAssign(oldKernel bool, spec *ebpf.CollectionSpec) (Bpf
objects
.
AggregatedFlows
=
newObjects
.
AggregatedFlows
objects
.
AggregatedFlows
=
newObjects
.
AggregatedFlows
objects
.
TcEgressFlowParse
=
newObjects
.
TcEgressFlowParse
objects
.
TcEgressFlowParse
=
newObjects
.
TcEgressFlowParse
objects
.
TcIngressFlowParse
=
newObjects
.
TcIngressFlowParse
objects
.
TcIngressFlowParse
=
newObjects
.
TcIngressFlowParse
objects
.
TcxEgressFlowParse
=
newObjects
.
TcxEgressFlowParse
objects
.
TcxIngressFlowParse
=
newObjects
.
TcxIngressFlowParse
objects
.
TcEgressPcaParse
=
newObjects
.
TcEgressPcaParse
objects
.
TcIngressPcaParse
=
newObjects
.
TcIngressPcaParse
objects
.
TcxEgressPcaParse
=
newObjects
.
TcxEgressPcaParse
objects
.
TcxIngressPcaParse
=
newObjects
.
TcxIngressPcaParse
objects
.
TcpRcvFentry
=
newObjects
.
TCPRcvFentry
objects
.
TcpRcvFentry
=
newObjects
.
TCPRcvFentry
objects
.
TcpRcvKprobe
=
newObjects
.
TCPRcvKprobe
objects
.
TcpRcvKprobe
=
newObjects
.
TCPRcvKprobe
objects
.
GlobalCounters
=
newObjects
.
GlobalCounters
objects
.
GlobalCounters
=
newObjects
.
GlobalCounters
...
@@ -873,7 +885,7 @@ func fetchEgressEvents(iface ifaces.Interface, ipvlan netlink.Link, parser *ebpf
...
@@ -873,7 +885,7 @@ func fetchEgressEvents(iface ifaces.Interface, ipvlan netlink.Link, parser *ebpf
}
}
func
(
p
*
PacketFetcher
)
registerEgress
(
iface
ifaces
.
Interface
,
ipvlan
netlink
.
Link
)
error
{
func
(
p
*
PacketFetcher
)
registerEgress
(
iface
ifaces
.
Interface
,
ipvlan
netlink
.
Link
)
error
{
egressFilter
,
err
:=
fetchEgressEvents
(
iface
,
ipvlan
,
p
.
objects
.
TcEgressPcaParse
,
"egress_pca_parse"
)
egressFilter
,
err
:=
fetchEgressEvents
(
iface
,
ipvlan
,
p
.
objects
.
TcEgressPcaParse
,
"
tc_
egress_pca_parse"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -912,7 +924,7 @@ func fetchIngressEvents(iface ifaces.Interface, ipvlan netlink.Link, parser *ebp
...
@@ -912,7 +924,7 @@ func fetchIngressEvents(iface ifaces.Interface, ipvlan netlink.Link, parser *ebp
}
}
func
(
p
*
PacketFetcher
)
registerIngress
(
iface
ifaces
.
Interface
,
ipvlan
netlink
.
Link
)
error
{
func
(
p
*
PacketFetcher
)
registerIngress
(
iface
ifaces
.
Interface
,
ipvlan
netlink
.
Link
)
error
{
ingressFilter
,
err
:=
fetchIngressEvents
(
iface
,
ipvlan
,
p
.
objects
.
TcIngressPcaParse
,
"ingress_pca_parse"
)
ingressFilter
,
err
:=
fetchIngressEvents
(
iface
,
ipvlan
,
p
.
objects
.
TcIngressPcaParse
,
"
tc_
ingress_pca_parse"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment