Skip to content

stream v4 #9236

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

Open
wants to merge 2 commits into
base: bpf-next_base
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion kernel/bpf/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3244,6 +3244,7 @@ int bpf_prog_get_file_line(struct bpf_prog *prog, unsigned long ip, const char *
struct bpf_line_info *linfo;
void **jited_linfo;
struct btf *btf;
int nr_linfo;

btf = prog->aux->btf;
linfo = prog->aux->linfo;
Expand All @@ -3258,8 +3259,9 @@ int bpf_prog_get_file_line(struct bpf_prog *prog, unsigned long ip, const char *

insn_start = linfo[0].insn_off;
insn_end = insn_start + len;
nr_linfo = prog->aux->nr_linfo - prog->aux->linfo_idx;

for (int i = 0; i < prog->aux->nr_linfo &&
for (int i = 0; i < nr_linfo &&
linfo[i].insn_off >= insn_start && linfo[i].insn_off < insn_end; i++) {
if (jited_linfo[i] >= (void *)ip)
break;
Expand Down
4 changes: 2 additions & 2 deletions kernel/bpf/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,11 @@ static bool dump_stack_cb(void *cookie, u64 ip, u64 sp, u64 bp)
if (ret < 0)
goto end;
ctxp->err = bpf_stream_stage_printk(ctxp->ss, "%pS\n %s @ %s:%d\n",
(void *)ip, line, file, num);
(void *)(long)ip, line, file, num);
return !ctxp->err;
}
end:
ctxp->err = bpf_stream_stage_printk(ctxp->ss, "%pS\n", (void *)ip);
ctxp->err = bpf_stream_stage_printk(ctxp->ss, "%pS\n", (void *)(long)ip);
return !ctxp->err;
}

Expand Down
Loading