Re: [PATCH] perf tools: Fix pthread_attr_setaffinity_np() feature detection on Ubuntu systems
* Jiri Olsa wrote: > agreed, sry about that.. I'll try to clean it up while moving > features detection into tools/ as you suggested before That would be nice! > > --- 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); > > I think Arnaldo got this one covered in perf/urgent already, but I > might have missed something.. Ok, I'll wait for his set of fixes. Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] perf tools: Fix pthread_attr_setaffinity_np() feature detection on Ubuntu systems
On Sat, Feb 28, 2015 at 08:49:27AM +0100, Ingo Molnar wrote: SNIP > > 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. agreed, sry about that.. I'll try to clean it up while moving features detection into tools/ as you suggested before > > > SNIP > 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); I think Arnaldo got this one covered in perf/urgent already, but I might have missed something.. jirka -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] perf tools: Fix pthread_attr_setaffinity_np() feature detection on Ubuntu systems
* Arnaldo Carvalho de Melo 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 > > > 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 include