All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Jiri Olsa <jolsa@redhat.com>, Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] perf tools: Add file-handle feature test
Date: Thu, 2 Apr 2020 15:37:15 -0300	[thread overview]
Message-ID: <20200402183715.GF8736@kernel.org> (raw)
In-Reply-To: <20200402153748.GC8736@kernel.org>

Em Thu, Apr 02, 2020 at 12:37:48PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Thu, Apr 02, 2020 at 10:52:49AM +0900, Namhyung Kim escreveu:
> > The file handle (FHANDLE) support is configurable so some systems might
> > not have it.  So add a config feature item to check it on build time
> > and reject cgroup tracking based on that.
> 
> Ok, I'll break this patch in two, add the feature test first, then fold
> the usage of HAVE_FILE_HANDLE with the patch that uses it, so that we
> keep the codebase bisectable,

> > +++ b/tools/build/feature/test-file-handle.c
> > @@ -0,0 +1,14 @@
> > +#define _GNU_SOURCE
> > +#include <sys/types.h>
> > +#include <sys/stat.h>
> > +#include <fcntl.h>
> > +
> > +int main(void)
> > +{
> > +	struct file_handle fh;
> > +	int mount_id;
> > +
> > +	name_to_handle_at(AT_FDCWD, "/", &fh, &mount_id, 0);
> > +	return 0;

Also had to do it just like you use in your patches, see patch below, to
cover this case as well:

  CC       /tmp/build/perf/util/synthetic-events.o
  CC       /tmp/build/perf/util/data.o
  CC       /tmp/build/perf/util/tsc.o
  CC       /tmp/build/perf/util/cloexec.o
util/synthetic-events.c:428:22: error: field 'fh' with   CC       /tmp/build/perf/util/call-path.o
variable sized type 'struct file_handle' not at the end of a struct or class is a GNU
      extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
                struct file_handle fh;
                                   ^
1 error generated.
mv: can't rename '/tmp/build/perf/util/.synthetic-events.o.tmp': No such file or directory
make[4]: *** [/git/linux/tools/build/Makefile.build:97: /tmp/build/perf/util/synthetic-events.o] Error 1
make[4]: *** Waiting for unfinished jobs....


This is on Alpine Linux 3.11 onwards, musl libc.

- Arnaldo


diff --git a/tools/build/feature/test-file-handle.c b/tools/build/feature/test-file-handle.c
index e325b2a060ed..bed871e3978d 100644
--- a/tools/build/feature/test-file-handle.c
+++ b/tools/build/feature/test-file-handle.c
@@ -5,9 +5,12 @@
 
 int main(void)
 {
-	struct file_handle fh;
+        struct {
+                struct file_handle fh;
+                uint64_t cgroup_id;
+        } handle;
 	int mount_id;
 
-	name_to_handle_at(AT_FDCWD, "/", &fh, &mount_id, 0);
+	name_to_handle_at(AT_FDCWD, "/", &handle.fh, &mount_id, 0);
 	return 0;
 }

  parent reply	other threads:[~2020-04-02 18:37 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 12:45 [PATCHSET 0/9] perf: Improve cgroup profiling (v6) Namhyung Kim
2020-03-25 12:45 ` [PATCH 1/9] perf/core: Add PERF_RECORD_CGROUP event Namhyung Kim
2020-04-04  8:41   ` [tip: perf/urgent] " tip-bot2 for Namhyung Kim
2020-03-25 12:45 ` [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature Namhyung Kim
2020-04-04  8:41   ` [tip: perf/urgent] " tip-bot2 for Namhyung Kim
2020-03-25 12:45 ` [PATCH 3/9] perf tools: Basic support for CGROUP event Namhyung Kim
2020-03-27 14:06   ` Arnaldo Carvalho de Melo
2020-04-04  8:41   ` [tip: perf/urgent] " tip-bot2 for Namhyung Kim
2020-03-25 12:45 ` [PATCH 4/9] perf tools: Maintain cgroup hierarchy Namhyung Kim
2020-04-03 12:36   ` Arnaldo Carvalho de Melo
2020-04-04  1:29     ` Namhyung Kim
2020-04-04  8:41     ` [tip: perf/urgent] perf python: Include rwsem.c in the pythong biding tip-bot2 for Arnaldo Carvalho de Melo
2020-04-04  8:41   ` [tip: perf/urgent] perf cgroup: Maintain cgroup hierarchy tip-bot2 for Namhyung Kim
2020-03-25 12:45 ` [PATCH 5/9] perf report: Add 'cgroup' sort key Namhyung Kim
2020-04-04  8:41   ` [tip: perf/urgent] " tip-bot2 for Namhyung Kim
2020-03-25 12:45 ` [PATCH 6/9] perf record: Support synthesizing cgroup events Namhyung Kim
2020-03-30 16:30   ` Arnaldo Carvalho de Melo
2020-03-30 16:43     ` Arnaldo Carvalho de Melo
2020-03-31 16:04       ` Arnaldo Carvalho de Melo
2020-04-01 23:22       ` Namhyung Kim
2020-04-02  1:52         ` [PATCH] perf tools: Add file-handle feature test Namhyung Kim
2020-04-02 15:37           ` Arnaldo Carvalho de Melo
2020-04-02 15:46             ` Arnaldo Carvalho de Melo
2020-04-02 18:37             ` Arnaldo Carvalho de Melo [this message]
2020-04-04  8:41           ` [tip: perf/urgent] " tip-bot2 for Namhyung Kim
2020-04-04  8:41   ` [tip: perf/urgent] perf record: Support synthesizing cgroup events tip-bot2 for Namhyung Kim
2020-03-25 12:45 ` [PATCH 7/9] perf record: Add --all-cgroups option Namhyung Kim
2020-04-04  8:41   ` [tip: perf/urgent] " tip-bot2 for Namhyung Kim
2020-03-25 12:45 ` [PATCH 8/9] perf top: " Namhyung Kim
2020-03-27 16:35   ` Arnaldo Carvalho de Melo
2020-04-04  8:41   ` [tip: perf/urgent] " tip-bot2 for Namhyung Kim
2020-03-25 12:45 ` [PATCH 9/9] perf script: Add --show-cgroup-events option Namhyung Kim
2020-03-27 16:39   ` Arnaldo Carvalho de Melo
2020-04-04  8:41   ` [tip: perf/urgent] " tip-bot2 for Namhyung Kim
2020-03-25 13:05 ` [PATCHSET 0/9] perf: Improve cgroup profiling (v6) Arnaldo Carvalho de Melo
2020-03-25 13:19   ` 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=20200402183715.GF8736@kernel.org \
    --to=arnaldo.melo@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.