Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable support for ebpf program type tracepoints #389

Merged
merged 4 commits into from
Jun 27, 2024

Conversation

sanfern
Copy link
Contributor

@sanfern sanfern commented May 21, 2024

Enable support for ebpf program type Tracepoints.

Issue #404

@sanfern sanfern force-pushed the sanfern-l3af-tracepoint-support branch 4 times, most recently from 7f01386 to e0f8d49 Compare May 22, 2024 13:59
@sanfern sanfern force-pushed the sanfern-l3af-tracepoint-support branch from e0f8d49 to 668f371 Compare June 5, 2024 15:57
@sanfern sanfern added the feat New Feature label Jun 12, 2024
Signed-off-by: sferna1 <[email protected]>
@sanfern sanfern force-pushed the sanfern-l3af-tracepoint-support branch from c47e52b to 9fbfa4b Compare June 12, 2024 11:32
@sanfern sanfern marked this pull request as ready for review June 12, 2024 11:54
@sanfern sanfern changed the title [WIP]Enable support for ebpf program type tracepoints Enable support for ebpf program type tracepoints Jun 12, 2024
@sanfern
Copy link
Contributor Author

sanfern commented Jun 19, 2024

Dependent on PR l3af-project/l3af-arch#113

@@ -33,7 +33,7 @@ jobs:
- name: Prep
run: |
sudo cp -r /home/runner/work/l3afd/l3afd /root
sudo git clone https://github.com/l3af-project/l3af-arch.git /root/l3af-arch
sudo git clone -b sanfern-e2e-add-probes https://github.com/sanfern/l3af-arch.git /root/l3af-arch

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert back once PR113 approved

kf/bpf.go Outdated
@@ -81,9 +81,6 @@ func NewBpfProgram(ctx context.Context, program models.BPFProgram, conf *config.
progMapFilePath = filepath.Join(conf.BpfMapDefaultPath, ifaceName, program.MapName)
} else if program.ProgType == models.TCType {
progMapFilePath = filepath.Join(conf.BpfMapDefaultPath, models.TCMapPinPath, ifaceName, program.MapName)
} else {
log.Error().Msgf("unsupported program type - %s", program.ProgType)
return nil
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it suppose to add another check for the ProgType for tracepoints and keep the else for the type not supported?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, we should have an explicit list of types we support

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block is for defining the progMapFilePath for pinning, when we were not supporting probe types. We wanted to explicitly throw errors for other than prog types of tc or xdp. Since we are supporting probes, we don't need prog maps and also we are not chaining. We don't want to error out here in case of probes.

kf/bpf.go Outdated
@@ -81,9 +81,6 @@ func NewBpfProgram(ctx context.Context, program models.BPFProgram, conf *config.
progMapFilePath = filepath.Join(conf.BpfMapDefaultPath, ifaceName, program.MapName)
} else if program.ProgType == models.TCType {
progMapFilePath = filepath.Join(conf.BpfMapDefaultPath, models.TCMapPinPath, ifaceName, program.MapName)
} else {
log.Error().Msgf("unsupported program type - %s", program.ProgType)
return nil
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, we should have an explicit list of types we support

kf/processCheck.go Outdated Show resolved Hide resolved
kf/processCheck.go Outdated Show resolved Hide resolved
@sanfern sanfern force-pushed the sanfern-l3af-tracepoint-support branch 2 times, most recently from 033a13c to 116af47 Compare June 25, 2024 20:39
pmoroney
pmoroney previously approved these changes Jun 26, 2024
@sanfern sanfern force-pushed the sanfern-l3af-tracepoint-support branch from 116af47 to a793619 Compare June 26, 2024 18:22
Copy link

@pmoroney pmoroney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@charleskbliu0 charleskbliu0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@sanfern sanfern merged commit d82a566 into l3af-project:main Jun 27, 2024
8 checks passed
@sanfern sanfern deleted the sanfern-l3af-tracepoint-support branch June 27, 2024 06:48
@sanfern sanfern removed the feat New Feature label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants