public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Song Liu <songliubraving@fb.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Kernel Team <Kernel-team@fb.com>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"acme@kernel.org" <acme@kernel.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"alexander.shishkin@linux.intel.com" 
	<alexander.shishkin@linux.intel.com>,
	"namhyung@kernel.org" <namhyung@kernel.org>
Subject: Re: [PATCH v2 2/2] perf-stat: enable counting events for BPF programs
Date: Tue, 8 Dec 2020 11:24:53 +0100	[thread overview]
Message-ID: <20201208102453.GA4135722@krava> (raw)
In-Reply-To: <C94864E9-CE05-4AEA-A986-731BFC0C95FF@fb.com>

On Tue, Dec 08, 2020 at 01:36:57AM +0000, Song Liu wrote:

SNIP

> > 
> > I'm still getting
> > 
> > [root@dell-r440-01 perf]# ./perf stat -b 38
> > libbpf: elf: skipping unrecognized data section(9) .eh_frame
> > libbpf: elf: skipping relo section(15) .rel.eh_frame for section(9) .eh_frame
> > libbpf: XXX is not found in vmlinux BTF
> > libbpf: failed to load object 'bpf_prog_profiler_bpf'
> > libbpf: failed to load BPF skeleton 'bpf_prog_profiler_bpf': -2
> > ...
> > 
> > with id 38 being:
> > 
> > 38: tracepoint  name sys_enter  tag 03418b72a610af75  gpl
> >        loaded_at 2020-12-07T22:54:05+0100  uid 0
> >        xlated 272B  jited 153B  memlock 4096B  map_ids 1
> > 
> > how is this supposed to work when there's XXX in the
> > program's section? libbpf is trying to find XXX in
> > kernel BTF and fails of course
> 
> I think this is because this program doesn't have BTF. The actual failed
> function was bpf_program__set_attach_target(). So the error message above
> should be "Failed to _open_ bpf skeleton". I will fix the error messages. 

ah right, it's bpftrace program, so there's no BTF loaded for the program
I'll check if there's a way to add it, it'd be shame not to have this
feature for bpftrace programs

there's no way around it, right? we need btf id of the program to attach
fentry/fexit to it

I think we need to fail the function if there's error detected,
and also check on the prog_name and fail if it's not found

plus change all those pr_debug to pr_err in bpf_program_profiler_load_one

jirka


  reply	other threads:[~2020-12-08 10:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04  6:13 [PATCH v2 0/2] Introduce perf-stat -b for BPF programs Song Liu
2020-12-04  6:13 ` [PATCH v2 1/2] perf: support build BPF skeletons with perf Song Liu
2020-12-07 20:25   ` Jiri Olsa
2020-12-08  0:59     ` Song Liu
2020-12-04  6:13 ` [PATCH v2 2/2] perf-stat: enable counting events for BPF programs Song Liu
2020-12-07 22:07   ` Jiri Olsa
2020-12-08  1:36     ` Song Liu
2020-12-08 10:24       ` Jiri Olsa [this message]
2020-12-08 18:16         ` Song Liu
2020-12-09 15:55       ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201208102453.GA4135722@krava \
    --to=jolsa@redhat.com \
    --cc=Kernel-team@fb.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=songliubraving@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox