Skip to content

Commit 6b3c64b

Browse files
Tao Chenanakryiko
authored andcommitted
bpf: Remove attach_type in bpf_tracing_link
Use attach_type in bpf_link, and remove it in bpf_tracing_link. Signed-off-by: Tao Chen <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Acked-by: Jiri Olsa <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 146ecb1 commit 6b3c64b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

include/linux/bpf.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1784,7 +1784,6 @@ struct bpf_shim_tramp_link {
17841784

17851785
struct bpf_tracing_link {
17861786
struct bpf_tramp_link link;
1787-
enum bpf_attach_type attach_type;
17881787
struct bpf_trampoline *trampoline;
17891788
struct bpf_prog *tgt_prog;
17901789
};

kernel/bpf/syscall.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3414,7 +3414,7 @@ static void bpf_tracing_link_show_fdinfo(const struct bpf_link *link,
34143414
"target_obj_id:\t%u\n"
34153415
"target_btf_id:\t%u\n"
34163416
"cookie:\t%llu\n",
3417-
tr_link->attach_type,
3417+
link->attach_type,
34183418
target_obj_id,
34193419
target_btf_id,
34203420
tr_link->link.cookie);
@@ -3426,7 +3426,7 @@ static int bpf_tracing_link_fill_link_info(const struct bpf_link *link,
34263426
struct bpf_tracing_link *tr_link =
34273427
container_of(link, struct bpf_tracing_link, link.link);
34283428

3429-
info->tracing.attach_type = tr_link->attach_type;
3429+
info->tracing.attach_type = link->attach_type;
34303430
info->tracing.cookie = tr_link->link.cookie;
34313431
bpf_trampoline_unpack_key(tr_link->trampoline->key,
34323432
&info->tracing.target_obj_id,
@@ -3516,7 +3516,6 @@ static int bpf_tracing_prog_attach(struct bpf_prog *prog,
35163516
bpf_link_init(&link->link.link, BPF_LINK_TYPE_TRACING,
35173517
&bpf_tracing_link_lops, prog, attach_type);
35183518

3519-
link->attach_type = prog->expected_attach_type;
35203519
link->link.cookie = bpf_cookie;
35213520

35223521
mutex_lock(&prog->aux->dst_mutex);

0 commit comments

Comments
 (0)