kmesh icon indicating copy to clipboard operation
kmesh copied to clipboard

[WIP]Introduce eBPF prog coverage

Open tacslon opened this issue 1 year ago • 6 comments

What type of PR is this?

/kind enhancement What this PR does / why we need it: Introduce eBPF prog coverage Which issue(s) this PR fixes: Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Introduce a new flag `enable-bpf-coverage` to generate eBPF code coverage after Kmesh is exited

tacslon avatar Aug 06 '24 08:08 tacslon

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign nlgwcy for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

kmesh-bot avatar Aug 06 '24 08:08 kmesh-bot

How to generate coverage

(This is a temporary way to generate coverage, and will be optimized in future work)

  1. Copy all codes in bpf/ to Kmesh-pod:/kmesh
  2. Start Kmesh in pod with --enable-bpf-coverage=true at directory /kmesh/bpf/kmesh/workload
  3. Run test cases
  4. Stop kmesh-deamon process
  5. The coverage HTML is at Kmesh-pod:/kmesh/sockops-cov.html

Coverage HTML sample: sockops-cov.zip image

tacslon avatar Aug 06 '24 08:08 tacslon

How to generate coverage

  1. Start Kmesh with --enable-bpf-coverage=true
  2. Copy all codes in bpf/ to Kmesh-pod:/kmesh
  3. Run test cases
  4. Get yourself into Kmesh-pod, then stop Kmesh
  5. The coverage HTML is at Kmesh-pod:/kmesh/sockops-cov.html

can you introduct it at Thursday's community meeting?

LiZhenCheng9527 avatar Aug 06 '24 08:08 LiZhenCheng9527

How to generate coverage

  1. Start Kmesh with --enable-bpf-coverage=true
  2. Copy all codes in bpf/ to Kmesh-pod:/kmesh
  3. Run test cases
  4. Get yourself into Kmesh-pod, then stop Kmesh
  5. The coverage HTML is at Kmesh-pod:/kmesh/sockops-cov.html

can you introduct it at Thursday's community meeting?

Sure

tacslon avatar Aug 06 '24 08:08 tacslon

/retest

hzxuzhonghu avatar Aug 07 '24 08:08 hzxuzhonghu

To be discussed:

  1. Do eBPF test: with Kmesh daemon running OR run the eBPF programs alone? -- do not depend on Kmesh start
  2. Integrate eBPF coverage with E2E Test? -- do not integrate with E2E

TODO: Integrade with summer-ospp UT framework project

tacslon avatar Aug 08 '24 08:08 tacslon