Commit 4deecdd
bpf: fix unpopulated name_len field in perf_event link info
Previously when retrieving `bpf_link_info.perf_event` for
kprobe/uprobe/tracepoint, the `name_len` field was not populated by the
kernel, leaving it to reflect the value initially set by the user. This
behavior was inconsistent with how other input/output string buffer
fields function (e.g. `raw_tracepoint.tp_name_len`).
This patch fills `name_len` with the actual size of the string name.
Fixes: 1b715e1 ("bpf: Support ->fill_link_info for perf_event")
Signed-off-by: Tyrone Wu <wudevelops@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Yafang Shao <laoar.shao@gmail.com>
Link: https://lore.kernel.org/r/20241008164312.46269-1-wudevelops@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>1 parent 4342476 commit 4deecdd
1 file changed
Lines changed: 22 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3565 | 3565 | | |
3566 | 3566 | | |
3567 | 3567 | | |
3568 | | - | |
| 3568 | + | |
3569 | 3569 | | |
3570 | 3570 | | |
3571 | 3571 | | |
3572 | 3572 | | |
3573 | | - | |
| 3573 | + | |
3574 | 3574 | | |
3575 | 3575 | | |
3576 | 3576 | | |
| 3577 | + | |
3577 | 3578 | | |
3578 | 3579 | | |
3579 | 3580 | | |
3580 | 3581 | | |
3581 | 3582 | | |
3582 | 3583 | | |
3583 | 3584 | | |
| 3585 | + | |
| 3586 | + | |
| 3587 | + | |
| 3588 | + | |
| 3589 | + | |
| 3590 | + | |
| 3591 | + | |
3584 | 3592 | | |
3585 | 3593 | | |
| 3594 | + | |
3586 | 3595 | | |
3587 | | - | |
3588 | 3596 | | |
3589 | 3597 | | |
3590 | 3598 | | |
| |||
3609 | 3617 | | |
3610 | 3618 | | |
3611 | 3619 | | |
3612 | | - | |
| 3620 | + | |
3613 | 3621 | | |
3614 | 3622 | | |
3615 | 3623 | | |
3616 | 3624 | | |
3617 | 3625 | | |
3618 | 3626 | | |
3619 | 3627 | | |
3620 | | - | |
| 3628 | + | |
3621 | 3629 | | |
3622 | 3630 | | |
3623 | 3631 | | |
| |||
3639 | 3647 | | |
3640 | 3648 | | |
3641 | 3649 | | |
3642 | | - | |
| 3650 | + | |
3643 | 3651 | | |
3644 | 3652 | | |
3645 | 3653 | | |
| |||
3648 | 3656 | | |
3649 | 3657 | | |
3650 | 3658 | | |
| 3659 | + | |
3651 | 3660 | | |
3652 | 3661 | | |
3653 | 3662 | | |
| |||
3673 | 3682 | | |
3674 | 3683 | | |
3675 | 3684 | | |
| 3685 | + | |
3676 | 3686 | | |
3677 | 3687 | | |
3678 | 3688 | | |
| 3689 | + | |
| 3690 | + | |
| 3691 | + | |
| 3692 | + | |
3679 | 3693 | | |
| 3694 | + | |
3680 | 3695 | | |
3681 | | - | |
| 3696 | + | |
3682 | 3697 | | |
3683 | 3698 | | |
3684 | 3699 | | |
| |||
0 commit comments