linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Clark Williams <williams@redhat.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>
Subject: [PATCH 02/28] perf test: Auto bump rlimit(MEMLOCK) for BPF test sake
Date: Mon, 15 Jul 2019 18:11:34 -0300	[thread overview]
Message-ID: <20190715211200.10984-3-acme@kernel.org> (raw)
In-Reply-To: <20190715211200.10984-1-acme@kernel.org>

From: Arnaldo Carvalho de Melo <acme@redhat.com>

I noticed that the 'perf test bpf' was failing:

  # perf test bpf
  41: BPF filter                                            :
  41.1: Basic BPF filtering                                 : Skip
  41.2: BPF pinning                                         : Skip
  41.3: BPF prologue generation                             : Skip
  41.4: BPF relocation checker                              : Skip
  # ulimit -l
  64
  #

Using verbose mode we get just a line bout -EPERF being returned from
libbpf's bpf_load_program_xattr(), that ends up being used in 'perf
test bpf' initial program loading capability query:

  Missing basic BPF support, skip this test: Operation not permitted

Not that informative, but on a separate problem when creating BPF maps
bumping rlimit(MEMLOCK) helped, so I tried it here as well, works:

  # ulimit -l 128
  # perf test bpf
  41: BPF filter                                            :
  41.1: Basic BPF filtering                                 : Ok
  41.2: BPF pinning                                         : Ok
  41.3: BPF prologue generation                             : Ok
  41.4: BPF relocation checker                              : Ok
  #

So use the recently added rlimit__bump_memlock() helper:

  # ulimit -l 64
  # perf test bpf
  41: BPF filter                                            :
  41.1: Basic BPF filtering                                 : Ok
  41.2: BPF pinning                                         : Ok
  41.3: BPF prologue generation                             : Ok
  41.4: BPF relocation checker                              : Ok
  # ulimit -l
  64
  #

I.e. the bumping of memlock is restricted to the 'perf test' instance,
not changing the global value.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-b9fubkhr4jm192lu7y8hgjvo@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/builtin-test.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index 66a82badc1d1..c3bec9d2c201 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -21,6 +21,7 @@
 #include <subcmd/parse-options.h>
 #include "string2.h"
 #include "symbol.h"
+#include "util/rlimit.h"
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <subcmd/exec-cmd.h>
@@ -727,6 +728,11 @@ int cmd_test(int argc, const char **argv)
 
 	if (skip != NULL)
 		skiplist = intlist__new(skip);
+	/*
+	 * Tests that create BPF maps, for instance, need more than the 64K
+	 * default:
+	 */
+	rlimit__bump_memlock();
 
 	return __cmd_test(argc, argv, skiplist);
 }
-- 
2.21.0


  parent reply	other threads:[~2019-07-15 21:12 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 21:11 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 01/28] perf tools: Introduce rlimit__bump_memlock() helper Arnaldo Carvalho de Melo
2019-07-15 21:11 ` Arnaldo Carvalho de Melo [this message]
2019-07-15 21:11 ` [PATCH 03/28] perf trace: Auto bump rlimit(MEMLOCK) for eBPF maps sake Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 04/28] perf db-export: Get rid of db_export__deferred() Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 05/28] perf db-export: Rename db_export__comm() to db_export__exec_comm() Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 06/28] perf db-export: Pass main_thread to db_export__thread() Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 07/28] perf db-export: Export main_thread in db_export__sample() Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 08/28] perf db-export: Export comm before exporting thread Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 09/28] perf db-export: Move export__comm_thread into db_export__sample() Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 10/28] perf db-export: Fix a white space issue in db_export__sample() Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 11/28] perf db-export: Export comm details Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 12/28] perf scripts python: export-to-sqlite.py: " Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 13/28] perf scripts python: export-to-postgresql.py: " Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 14/28] perf db-export: Factor out db_export__comm() Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 15/28] perf db-export: Also export thread's current comm Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 16/28] perf scripts python: export-to-sqlite.py: Add has_calls column to comms table Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 17/28] perf scripts python: export-to-postgresql.py: " Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 18/28] perf scripts python: exported-sql-viewer.py: Remove redundant semi-colons Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 19/28] perf scripts python: exported-sql-viewer.py: Use new 'has_calls' column Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 20/28] perf script: Add scripting operation process_switch() Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 21/28] perf db-export: Factor out db_export__threads() Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 22/28] perf db-export: Export switch events Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 23/28] perf scripts python: export-to-sqlite.py: " Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 24/28] perf scripts python: export-to-postgresql.py: " Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 25/28] perf cs-etm: Remove errnoeous ERR_PTR() usage in cs_etm__process_auxtrace_info Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 26/28] perf cs-etm: Return errcode in cs_etm__process_auxtrace_info() Arnaldo Carvalho de Melo
2019-07-15 21:11 ` [PATCH 27/28] perf vendor events s390: Add JSON files for machine type 8561 Arnaldo Carvalho de Melo
2019-07-15 21:12 ` [PATCH 28/28] perf version: Fix segfault due to missing OPT_END() Arnaldo Carvalho de Melo

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=20190715211200.10984-3-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=williams@redhat.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).