mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@fb.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: "linux-kernel@vger.kernel.org" <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: [RFC v2 0/2] Introduce perf-stat -b for BPF programs
Date: Tue, 1 Dec 2020 20:43:50 +0000	[thread overview]
Message-ID: <2E0DA3EB-BFE7-4439-9142-DA98825B4159@fb.com> (raw)
In-Reply-To: <20201201201654.GD3169083@krava>



> On Dec 1, 2020, at 12:16 PM, Jiri Olsa <jolsa@redhat.com> wrote:
> 
> On Mon, Nov 30, 2020 at 11:36:45PM -0800, Song Liu wrote:
>> This set introduces perf-stat -b option to count events for BPF programs.
>> This is similar to bpftool-prog-profile. But perf-stat makes it much more
>> flexible.
>> 
>> Sending as RFC because I haven't addressed some known limitations:
>>  1. Only counting events for one BPF program at a time.
>>  2. Need extra logic in target__validate().
> 
> hi,
> I'm getting this eror:
> 
> 	  CLANG    /home/jolsa/linux-perf/tools/perf/util/bpf_skel/.tmp/dummy.bpf.o
> 	util/bpf_skel/dummy.bpf.c:4:10: fatal error: 'bpf/bpf_helpers.h' file not found
> 	#include <bpf/bpf_helpers.h>
> 		 ^~~~~~~~~~~~~~~~~~~
> 	1 error generated.
> 
> I added change below to fix it, but not sure it's the best fix
> 
> jirka

The fix looks great to me. I will fold it in. 

Thanks!
Song

> 
> 
> ---
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index d926f0c35ed4..c8f012132d19 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -1022,7 +1022,7 @@ BPFTOOL_CFLAGS := $(filter-out -D_GNU_SOURCE,$(CFLAGS))
> BPFTOOL := $(SKEL_TMP_OUT)/bpftool-bootstrap
> LIBBPF_SRC := $(abspath ../lib/bpf)
> BPFOBJ := $(SKEL_TMP_OUT)/libbpf.a
> -BPF_INCLUDE := $(SKEL_TMP_OUT)
> +BPF_INCLUDE := -I$(LIBBPF_SRC)/..
> submake_extras := feature_display=0
> 
> $(SKEL_TMP_OUT):
> @@ -1034,7 +1034,7 @@ $(BPFTOOL): | $(SKEL_TMP_OUT)
> 
> $(SKEL_TMP_OUT)/%.bpf.o: util/bpf_skel/%.bpf.c $(BPFOBJ) | $(SKEL_TMP_OUT)
> 	$(call QUIET_CLANG, $@)
> -	$(Q)$(CLANG) -g -O2 -target bpf	-c $(filter util/bpf_skel/%.bpf.c,$^) -o $@ && \
> +	$(Q)$(CLANG) -g -O2 -target bpf	$(BPF_INCLUDE) -c $(filter util/bpf_skel/%.bpf.c,$^) -o $@ && \
> 	$(LLVM_STRIP) -g $@
> 
> $(SKEL_OUT)/%.skel.h: $(SKEL_TMP_OUT)/%.bpf.o | $(BPFTOOL)
> 


      reply	other threads:[~2020-12-01 20:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01  7:36 Song Liu
2020-12-01  7:36 ` [RFC v2 1/2] perf: support build BPF skeletons with perf Song Liu
2020-12-01 20:54   ` Jiri Olsa
2020-12-01 22:47     ` Song Liu
2020-12-03 22:20       ` Jiri Olsa
2020-12-01  7:36 ` [RFC v2 2/2] perf-stat: enable counting events for BPF programs Song Liu
2020-12-01 20:16 ` [RFC v2 0/2] Introduce perf-stat -b " Jiri Olsa
2020-12-01 20:43   ` Song Liu [this message]

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=2E0DA3EB-BFE7-4439-9142-DA98825B4159@fb.com \
    --to=songliubraving@fb.com \
    --cc=Kernel-team@fb.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /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

all inboxes | Powered by JetHome®