(t *testing.T)
| 694 | } |
| 695 | |
| 696 | func TestProgramAttachToKernel(t *testing.T) { |
| 697 | // See https://github.com/torvalds/linux/commit/290248a5b7d829871b3ea3c62578613a580a1744 |
| 698 | testutils.SkipOnOldKernel(t, "5.5", "attach_btf_id") |
| 699 | |
| 700 | tests := []struct { |
| 701 | attachTo string |
| 702 | programType ProgramType |
| 703 | attachType AttachType |
| 704 | flags uint32 |
| 705 | }{ |
| 706 | { |
| 707 | attachTo: "task_getpgid", |
| 708 | programType: LSM, |
| 709 | attachType: AttachLSMMac, |
| 710 | }, |
| 711 | { |
| 712 | attachTo: "inet_dgram_connect", |
| 713 | programType: Tracing, |
| 714 | attachType: AttachTraceFEntry, |
| 715 | }, |
| 716 | { |
| 717 | attachTo: "inet_dgram_connect", |
| 718 | programType: Tracing, |
| 719 | attachType: AttachTraceFExit, |
| 720 | }, |
| 721 | { |
| 722 | attachTo: "bpf_modify_return_test", |
| 723 | programType: Tracing, |
| 724 | attachType: AttachModifyReturn, |
| 725 | }, |
| 726 | { |
| 727 | attachTo: "kfree_skb", |
| 728 | programType: Tracing, |
| 729 | attachType: AttachTraceRawTp, |
| 730 | }, |
| 731 | { |
| 732 | attachTo: "bpf_testmod_test_read", |
| 733 | programType: Tracing, |
| 734 | attachType: AttachTraceFEntry, |
| 735 | }, |
| 736 | { |
| 737 | attachTo: "bpf_testmod_test_read", |
| 738 | programType: Tracing, |
| 739 | attachType: AttachTraceFExit, |
| 740 | }, |
| 741 | { |
| 742 | attachTo: "bpf_testmod_test_read", |
| 743 | programType: Tracing, |
| 744 | attachType: AttachModifyReturn, |
| 745 | }, |
| 746 | { |
| 747 | attachTo: "bpf_testmod_test_read", |
| 748 | programType: Tracing, |
| 749 | attachType: AttachTraceRawTp, |
| 750 | }, |
| 751 | } |
| 752 | for _, test := range tests { |
| 753 | name := fmt.Sprintf("%s:%s", test.attachType, test.attachTo) |
nothing calls this directly
no test coverage detected
searching dependent graphs…