From: Ingo Molnar <mingo@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>, Jiri Olsa <jolsa@redhat.com>
Cc: linux-kernel@vger.kernel.org,
Adrian Hunter <adrian.hunter@intel.com>,
Andi Kleen <ak@linux.intel.com>, Borislav Petkov <bp@suse.de>,
David Ahern <david.ahern@oracle.com>,
He Kuang <hekuang@huawei.com>,
Hemant Kumar <hemant@linux.vnet.ibm.com>,
Jiri Olsa <jolsa@redhat.com>, Kan Liang <kan.liang@intel.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Namhyung Kim <namhyung@kernel.org>,
Naohiro Aota <naota@elisp.net>, Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <peterz@infradead.org>,
Wang Nan <wangnan0@huawei.com>,
Yunlong Song <yunlong.song@huawei.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH] perf tools: Fix pthread_attr_setaffinity_np() feature detection on Ubuntu systems
Date: Sat, 28 Feb 2015 08:49:27 +0100 [thread overview]
Message-ID: <20150228074746.GA14064@gmail.com> (raw)
In-Reply-To: <1425064989-26440-1-git-send-email-acme@kernel.org>
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Hi Ingo,
>
> Please consider pulling,
>
> - Arnaldo
>
> The following changes since commit 0afb1704010f60e7ae85aef0f93fc10f2d99761e:
>
> Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-02-26 12:25:20 +0100)
>
> are available in the git repository at:
>
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
>
> for you to fetch changes up to fefd2d9619de3bf0bf02a8622e9f445c3d19cc3f:
>
> perf report: Fix branch stack mode cannot be set (2015-02-27 15:52:42 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> User visible:
>
> - Fix SIGBUS failures due to misaligned accesses in Sparc64 (David Ahern)
>
> - Fix branch stack mode in 'perf report' (He Kuang)
>
> - Fix a 'perf probe' operator precedence bug (He Kuang)
>
> - Fix Support for different binaries with same name in 'perf diff' (Kan Liang)
>
> - Check kprobes blacklist when adding new events via 'perf probe' (Masami Hiramatsu)
>
> - Add --purge FILE to remove all caches of FILE in 'perf buildid-cache' (Masami Hiramatsu)
>
> - Show usage with some incorrect params (Masami Hiramatsu)
>
> - Add new buildid cache if update target is not cached in 'buildid-cache' (Masami Hiramatsu)
>
> - Allow listing events with 'tracepoint' prefix in 'perf list' (Yunlong Song)
>
> - Sort the output of 'perf list' (Yunlong Song)
>
> - Fix bash completion of 'perf --' (Yunlong Song)
>
> Developer Zone:
>
> - Handle strdup() failure path in 'perf probe' (Arnaldo Carvalho de Melo)
>
> - Fix get_real_path to free allocated memory in error path in 'perf probe' (Masami Hiramatsu)
>
> - Use pr_debug instead of verbose && pr_info perf buildid-cache (Masami Hiramatsu)
>
> - Fix building of 'perf data' with some gcc versions due to incorrect array struct
> entry (Yunlong Song)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (1):
> perf probe: Handle strdup() failure
>
> David Ahern (1):
> perf trace: Fix SIGBUS failures due to misaligned accesses
>
> He Kuang (2):
> perf probe: Fix a precedence bug
> perf report: Fix branch stack mode cannot be set
>
> Kan Liang (1):
> perf diff: Support for different binaries
>
> Masami Hiramatsu (6):
> perf probe: Check kprobes blacklist when adding new events
> perf probe: Fix get_real_path to free allocated memory in error path
> perf buildid-cache: Add new buildid cache if update target is not cached
> perf buildid-cache: Add --purge FILE to remove all caches of FILE
> perf buildid-cache: Use pr_debug instead of verbose && pr_info
> perf buildid-cache: Show usage with incorrect params
>
> Yunlong Song (8):
> perf data: Fix sentinel setting for data_cmds array
> perf list: Sort the output of 'perf list' to view more clearly
> perf list: Allow listing events with 'tracepoint' prefix
> perf list: Avoid confusion of perf output and the next command prompt
> perf tools: Remove the '--(null)' long_name for --list-opts
> perf list: Clean up the printing functions of hardware/software events
> perf list: Extend raw-dump to certain kind of events
> perf tools: Fix the bash completion problem of 'perf --*'
>
> tools/perf/Documentation/perf-buildid-cache.txt | 24 ++-
> tools/perf/Documentation/perf-diff.txt | 5 +
> tools/perf/Documentation/perf-list.txt | 6 +
> tools/perf/builtin-buildid-cache.c | 72 ++++++--
> tools/perf/builtin-data.c | 2 +-
> tools/perf/builtin-list.c | 27 ++-
> tools/perf/builtin-report.c | 2 +-
> tools/perf/builtin-trace.c | 36 +++-
> tools/perf/perf-completion.sh | 6 +-
> tools/perf/perf.c | 28 ++++
> tools/perf/util/build-id.c | 105 ++++++++++--
> tools/perf/util/build-id.h | 4 +
> tools/perf/util/parse-events.c | 210 +++++++++++++++++-------
> tools/perf/util/parse-events.h | 11 +-
> tools/perf/util/parse-options.c | 5 +-
> tools/perf/util/probe-event.c | 117 ++++++++++++-
> tools/perf/util/sort.c | 9 +
> 17 files changed, 542 insertions(+), 127 deletions(-)
Pulled, but let me rant a bit:
recent changes to perf bench broke the build on an Ubuntu image I
have:
CC bench/futex-hash.o
In file included from bench/futex-hash.c:17:0:
bench/futex.h:73:19: error: conflicting types for
‘pthread_attr_setaffinity_np’
static inline int pthread_attr_setaffinity_np(pthread_attr_t *attr,
^
In file included from bench/futex.h:72:0,
from bench/futex-hash.c:17:
/usr/include/pthread.h:407:12: note: previous declaration of
‘pthread_attr_setaffinity_np’ was here
extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
^
So this is a config detection system confusion, and while trying to
read the code I got lost in it. For example in:
0695e57b9a6a perf tools: Factor features display code
Firstly, 'factor' isn't a verb we use for code, 'factor out' is. But
it's not really factoring out - it separates the code. Did this title
want to say:
perf tools: Separate feature display code into three parts
? The title was absolutely unreadable.
Then it introduces two new makefile variables: LIB_FEATURE_TESTS and
VF_FEATURE_TESTS. LIB_FEATURE_TESTS is reasonably self-explanatory,
but wth is VF_FEATURE_TESTS?
More importantly, why isn't there a _single_ comment explaining their
use in the Makefile - _especially_ since CORE_FEATURE_TESTS is
explained so well, it's not like a bad example had to be followed.
Using cryptic abbreviations like 'VF' adds insult to injury. It took
me some time to figure out that it probably means 'Verbose Features'.
New feature detection adds to all these variables so people will just
guess to which to add and why.
Guys, this particular change was rushed and not explained well enough,
and it made debugging from that point on harder. Please slow down a
bit.
</rant>
Back to the bug, using the (now decyphered VF=1), the pthread-attr
test fails:
... pthread-attr-setaffinity-np: [ OFF ]
but that failure is bogus - this is why the build bug triggers. The
failure happens because:
triton:~/tip/tools/perf/config/feature-checks> make
test-pthread-attr-setaffinity-np.bin
gcc -MD -o test-pthread-attr-setaffinity-np.bin
test-pthread-attr-setaffinity-np.c -D_GNU_SOURCE -Werror -lpthread
test-pthread-attr-setaffinity-np.c: In function ‘main’:
test-pthread-attr-setaffinity-np.c:11:2: error: null argument where non-null required (argument 3) [-Werror=nonnull]
ret = pthread_attr_setaffinity_np(&thread_attr, 0, NULL);
^
cc1: all warnings being treated as errors
Makefile:53: recipe for target 'test-pthread-attr-setaffinity-np.bin' failed
It's a new -Werror=nonnull warning by GCC 4.9.1 that appears to have
caused this - extending the testcase to a more substantial
pthread_attr_setaffinity_np() use fixes it for me and perf builds
fine.
Find further below another feature detection message fix for the same
system - libslang-dev was replaced by libslang2-dev.
Thanks,
Ingo
Signed-off-by: Ingo Molnar <mingo@kernel.org>
diff --git a/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c b/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c
index 0a0d3ecb4e8a..85ab83e6a42f 100644
--- a/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c
+++ b/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c
@@ -5,10 +5,12 @@ int main(void)
{
int ret = 0;
pthread_attr_t thread_attr;
+ cpu_set_t cpu_mask;
pthread_attr_init(&thread_attr);
- /* don't care abt exact args, just the API itself in libpthread */
- ret = pthread_attr_setaffinity_np(&thread_attr, 0, NULL);
+ CPU_ZERO(&cpu_mask);
+
+ ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_mask), &cpu_mask);
return ret;
}
Signed-off-by: Ingo Molnar <mingo@kernel.org>
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index c3570b5..c13184d 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -489,7 +489,7 @@ endif
ifndef NO_SLANG
ifneq ($(feature-libslang), 1)
- msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev);
+ msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev/libslang2-dev);
NO_SLANG := 1
else
# Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
next prev parent reply other threads:[~2015-02-28 7:49 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-27 19:22 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-02-27 19:22 ` [PATCH 01/19] perf trace: Fix SIGBUS failures due to misaligned accesses Arnaldo Carvalho de Melo
2015-02-27 19:22 ` [PATCH 02/19] perf probe: Check kprobes blacklist when adding new events Arnaldo Carvalho de Melo
2015-02-27 19:22 ` [PATCH 03/19] perf probe: Fix get_real_path to free allocated memory in error path Arnaldo Carvalho de Melo
2015-02-27 19:22 ` [PATCH 04/19] perf probe: Handle strdup() failure Arnaldo Carvalho de Melo
2015-02-27 19:22 ` [PATCH 05/19] perf buildid-cache: Add new buildid cache if update target is not cached Arnaldo Carvalho de Melo
2015-02-27 19:22 ` [PATCH 06/19] perf diff: Support for different binaries Arnaldo Carvalho de Melo
2015-02-27 19:22 ` [PATCH 07/19] perf probe: Fix a precedence bug Arnaldo Carvalho de Melo
2015-02-27 19:22 ` [PATCH 08/19] perf data: Fix sentinel setting for data_cmds array Arnaldo Carvalho de Melo
2015-02-27 19:22 ` [PATCH 09/19] perf list: Sort the output of 'perf list' to view more clearly Arnaldo Carvalho de Melo
2015-02-27 19:23 ` [PATCH 10/19] perf list: Allow listing events with 'tracepoint' prefix Arnaldo Carvalho de Melo
2015-02-27 19:23 ` [PATCH 11/19] perf list: Avoid confusion of perf output and the next command prompt Arnaldo Carvalho de Melo
2015-02-27 19:23 ` [PATCH 12/19] perf tools: Remove the '--(null)' long_name for --list-opts Arnaldo Carvalho de Melo
2015-02-27 19:23 ` [PATCH 13/19] perf list: Clean up the printing functions of hardware/software events Arnaldo Carvalho de Melo
2015-02-27 19:23 ` [PATCH 14/19] perf list: Extend raw-dump to certain kind of events Arnaldo Carvalho de Melo
2015-02-27 19:23 ` [PATCH 15/19] perf tools: Fix the bash completion problem of 'perf --*' Arnaldo Carvalho de Melo
2015-02-27 19:23 ` [PATCH 16/19] perf buildid-cache: Add --purge FILE to remove all caches of FILE Arnaldo Carvalho de Melo
2015-02-27 19:23 ` [PATCH 17/19] perf buildid-cache: Use pr_debug instead of verbose && pr_info Arnaldo Carvalho de Melo
2015-02-27 19:23 ` [PATCH 18/19] perf buildid-cache: Show usage with incorrect params Arnaldo Carvalho de Melo
2015-02-27 19:23 ` [PATCH 19/19] perf report: Fix branch stack mode cannot be set Arnaldo Carvalho de Melo
2015-02-28 7:49 ` Ingo Molnar [this message]
2015-02-28 22:57 ` [PATCH] perf tools: Fix pthread_attr_setaffinity_np() feature detection on Ubuntu systems Jiri Olsa
2015-03-01 16:11 ` Ingo Molnar
2015-02-28 8:12 ` [PATCH] perf tools: Add PERF-FEATURES to the .gitignore file Ingo Molnar
2015-02-28 8:17 ` [PATCH] perf tools: Remove annoying extra message from the features build Ingo Molnar
2015-03-03 6:24 ` [tip:perf/core] " tip-bot for Ingo Molnar
2015-02-28 8:33 ` [PATCH] perf tools: Improve Python feature detection messages Ingo Molnar
2015-03-02 15:10 ` Arnaldo Carvalho de Melo
2015-03-03 13:01 ` Ingo Molnar
2015-03-03 6:24 ` [tip:perf/core] " tip-bot for Ingo Molnar
2015-02-28 8:39 ` [PATCH] perf tools: Improve libperl detection message Ingo Molnar
2015-03-03 6:24 ` [tip:perf/core] " tip-bot for Ingo Molnar
2015-02-28 8:41 ` [PATCH] perf tools: Improve libbfd " Ingo Molnar
2015-02-28 8:46 ` [PATCH v2] " Ingo Molnar
2015-03-03 6:24 ` [tip:perf/core] " tip-bot for Ingo Molnar
2015-02-28 9:16 ` [PATCH] perf tools: Improve feature test debuggability Ingo Molnar
2015-03-03 6:25 ` [tip:perf/core] " tip-bot for Ingo Molnar
2015-02-28 9:18 ` [PATCH] perf tools: Improve 'libbabel' feature check failure message Ingo Molnar
2015-03-02 15:19 ` Arnaldo Carvalho de Melo
2015-03-03 13:02 ` Ingo Molnar
2015-03-03 6:25 ` [tip:perf/core] " tip-bot for Ingo Molnar
2015-03-03 6:23 ` [tip:perf/core] perf tools: Add PERF-FEATURES to the .gitignore file tip-bot for Ingo Molnar
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=20150228074746.GA14064@gmail.com \
--to=mingo@kernel.org \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=bp@suse.de \
--cc=david.ahern@oracle.com \
--cc=hekuang@huawei.com \
--cc=hemant@linux.vnet.ibm.com \
--cc=jolsa@redhat.com \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=namhyung@kernel.org \
--cc=naota@elisp.net \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=wangnan0@huawei.com \
--cc=yunlong.song@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 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.