linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: Yicong Yang <yangyicong@huawei.com>
Cc: Namhyung Kim <namhyung@kernel.org>,
	yangyicong@hisilicon.com, acme@kernel.org, peterz@infradead.org,
	mingo@redhat.com, linux-perf-users@vger.kernel.org,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	jolsa@kernel.org, irogers@google.com, amadio@gentoo.org,
	linuxarm@huawei.com
Subject: Re: [PATCH] perf build: Add missing cflags when building with custom libtraceevent
Date: Wed, 30 Oct 2024 11:04:58 +0000	[thread overview]
Message-ID: <20241030110458.GD24446@e132581.arm.com> (raw)
In-Reply-To: <a8143fa2-d7e2-48d7-5c9b-2c00e2adbe9c@huawei.com>

On Wed, Oct 30, 2024 at 10:45:47AM +0800, Yicong Yang wrote:

[...]

> >> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> >> index 4ddb27a48eed..53fc5f787a77 100644
> >> --- a/tools/perf/Makefile.config
> >> +++ b/tools/perf/Makefile.config
> >> @@ -1194,7 +1194,7 @@ endif
> >>  ifneq ($(NO_LIBTRACEEVENT),1)
> >>    $(call feature_check,libtraceevent)
> >>    ifeq ($(feature-libtraceevent), 1)
> >> -    CFLAGS += -DHAVE_LIBTRACEEVENT
> >> +    CFLAGS += -DHAVE_LIBTRACEEVENT $(shell $(PKG_CONFIG) --cflags libtraceevent)
> >
> > Does this solve the problem?  On my machine, it returns this:
> >
> >   $ pkg-config --cflags libtraceevent
> >   -I/usr/include/traceevent
> >
> >   $ ls /usr/include/traceevent/
> >   event-parse.h  event-utils.h  kbuffer.h  trace-seq.h
> >
> > So the include path should be "/usr/include" or we should include
> > <event-parse.h> directly.  We may update the every include statements
> > but just curious how it solved your problem.
> >
> 
> I think you're right, we should use the path according to the pkg-config outputs.
> But it's a different problem, for me it's due to the missing of the include path
> (my libtraceevent is not under the system path). With the fix you proposed and drop
> the change in my patch:
> 
> $ PKG_CONFIG_PATH=/home/yangyicong/Community/libtraceevent/install/usr/local/lib/aarch64-linux-gnu/pkgconfig/ pkg-config --cflags-only-I libtraceevent
> -I/home/yangyicong/Community/libtraceevent/install/usr/local/include/traceevent
> $ PKG_CONFIG_PATH=/home/yangyicong/Community/libtraceevent/install/usr/local/lib/aarch64-linux-gnu/pkgconfig/ make -C tools/perf NO_LIBPYTHON=1
> In file included from bench/../util/session.h:5,
>                  from bench/synthesize.c:12:
> bench/../util/trace-event.h:153:10: fatal error: event-parse.h: No such file or directory
>   153 | #include <event-parse.h>
>       |
> [...]
> 
> Checked how we handle with libtracefs currently:
>  ifeq ($(feature-libtracefs), 1)
>     CFLAGS +=  $(shell $(PKG_CONFIG) --cflags libtracefs) # we've added the cflags from pkg-config
>     LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-L libtracefs)

The libtracefs.pc file claims requesting libtraceevent, as a result, it
returns the header paths for both libtraceevent and libtracefs:

  $ pkg-config --cflags libtracefs
  -I/usr/local/include/tracefs -I/usr/local/include/traceevent

I checked the packages libtraceevent-dev and libtracefs-dev and either
can be installed independently. Therefore, it seems to me that this
patch is correct for finding the traceevent header path, with no
dependency on tracefs.

Thanks,
Leo

  reply	other threads:[~2024-10-30 11:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24 13:32 [PATCH] perf build: Add missing cflags when building with custom libtraceevent Yicong Yang
2024-10-30  0:12 ` Namhyung Kim
2024-10-30  2:45   ` Yicong Yang
2024-10-30 11:04     ` Leo Yan [this message]
2024-11-02  6:23       ` Namhyung Kim
2024-11-04 10:47         ` Leo Yan
2024-11-04 12:51           ` Guilherme Amadio
2024-11-05  2:06             ` Yicong Yang
2024-11-05  6:08               ` Namhyung Kim
2024-11-05 16:41 ` Namhyung Kim

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=20241030110458.GD24446@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=amadio@gentoo.org \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=yangyicong@hisilicon.com \
    --cc=yangyicong@huawei.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;
as well as URLs for NNTP newsgroup(s).