* [tip:perf/core] perf trace: Simplify sys_exit return printing
@ 2013-08-29 10:09 tip-bot for Arnaldo Carvalho de Melo
2013-09-12 13:27 ` perf/compat: Sharpen the libaudit dependencies test Ingo Molnar
2013-09-12 13:29 ` perf/compat: Fill in new definitions for madvise()/mmap() flags Ingo Molnar
0 siblings, 2 replies; 7+ messages in thread
From: tip-bot for Arnaldo Carvalho de Melo @ 2013-08-29 10:09 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, eranian, paulus, acme, hpa, mingo, peterz, efault,
fweisbec, adrian.hunter, dsahern, tglx
Commit-ID: da3c9a448af7ab2beab62cfff42bdea9590d9bea
Gitweb: http://git.kernel.org/tip/da3c9a448af7ab2beab62cfff42bdea9590d9bea
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Mon, 26 Aug 2013 11:28:34 -0300
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 26 Aug 2013 17:25:50 -0300
perf trace: Simplify sys_exit return printing
Avoiding multiple sc->fmt != NULL tests.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-w28d1o3uslden0k57653kda7@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-trace.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 86568ed..9e23660 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -464,16 +464,19 @@ static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel,
fprintf(trace->output, "]: %s()", sc->name);
}
- if (ret < 0 && sc->fmt && sc->fmt->errmsg) {
+ if (sc->fmt == NULL) {
+signed_print:
+ fprintf(trace->output, ") = %d", ret);
+ } else if (ret < 0 && sc->fmt->errmsg) {
char bf[256];
const char *emsg = strerror_r(-ret, bf, sizeof(bf)),
*e = audit_errno_to_name(-ret);
fprintf(trace->output, ") = -1 %s %s", e, emsg);
- } else if (ret == 0 && sc->fmt && sc->fmt->timeout)
+ } else if (ret == 0 && sc->fmt->timeout)
fprintf(trace->output, ") = 0 Timeout");
else
- fprintf(trace->output, ") = %d", ret);
+ goto signed_print;
fputc('\n', trace->output);
out:
^ permalink raw reply related [flat|nested] 7+ messages in thread* perf/compat: Sharpen the libaudit dependencies test
2013-08-29 10:09 [tip:perf/core] perf trace: Simplify sys_exit return printing tip-bot for Arnaldo Carvalho de Melo
@ 2013-09-12 13:27 ` Ingo Molnar
2013-09-13 19:20 ` Arnaldo Carvalho de Melo
2013-09-20 9:55 ` [tip:perf/urgent] perf tools: " tip-bot for Ingo Molnar
2013-09-12 13:29 ` perf/compat: Fill in new definitions for madvise()/mmap() flags Ingo Molnar
1 sibling, 2 replies; 7+ messages in thread
From: Ingo Molnar @ 2013-09-12 13:27 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-tip-commits, linux-kernel, eranian, paulus, acme, hpa,
peterz, efault, fweisbec, adrian.hunter, dsahern, tglx
There are older libaudit versions that don't have an audit_errno_to_name()
method, resulting in a builtin-trace.c build error:
builtin-trace.c: In function ‘trace__sys_exit’:
builtin-trace.c:794: warning: implicit declaration of function ‘audit_errno_to_name’
Expand the libaudit test to detect this.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
diff --git a/tools/perf/config/feature-tests.mak b/tools/perf/config/feature-tests.mak
index 708fb8e..5608add 100644
--- a/tools/perf/config/feature-tests.mak
+++ b/tools/perf/config/feature-tests.mak
@@ -210,6 +210,7 @@ define SOURCE_LIBAUDIT
int main(void)
{
+ printf("error message: %s\n", audit_errno_to_name(0));
return audit_open();
}
endef
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: perf/compat: Sharpen the libaudit dependencies test
2013-09-12 13:27 ` perf/compat: Sharpen the libaudit dependencies test Ingo Molnar
@ 2013-09-13 19:20 ` Arnaldo Carvalho de Melo
2013-09-14 5:49 ` Ingo Molnar
2013-09-20 9:55 ` [tip:perf/urgent] perf tools: " tip-bot for Ingo Molnar
1 sibling, 1 reply; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-09-13 19:20 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-tip-commits, linux-kernel, eranian, paulus, hpa, peterz,
efault, fweisbec, adrian.hunter, dsahern, tglx
Em Thu, Sep 12, 2013 at 03:27:06PM +0200, Ingo Molnar escreveu:
> There are older libaudit versions that don't have an audit_errno_to_name()
> method, resulting in a builtin-trace.c build error:
>
> builtin-trace.c: In function ‘trace__sys_exit’:
> builtin-trace.c:794: warning: implicit declaration of function ‘audit_errno_to_name’
>
> Expand the libaudit test to detect this.
Lets sharpen it a bit more ;-)
CHK libaudit
<stdin>: In function ‘main’:
<stdin>:5:9: error: ‘error’ undeclared (first use in this function)
<stdin>:5:9: note: each undeclared identifier is reported only once for each function it appears in
<stdin>:5:15: error: expected ‘)’ before ‘message’
make: Entering directory `/home/git/linux/tools/perf'
config/Makefile:238: No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev
We need this folded in to buind it, so that the test works:
diff --git a/tools/perf/config/feature-tests.mak b/tools/perf/config/feature-tests.mak
index 5608add..7f550c1 100644
--- a/tools/perf/config/feature-tests.mak
+++ b/tools/perf/config/feature-tests.mak
@@ -210,7 +210,7 @@ define SOURCE_LIBAUDIT
int main(void)
{
- printf("error message: %s\n", audit_errno_to_name(0));
+ printf(\"error message: %s\n\", audit_errno_to_name(0));
return audit_open();
}
endef
Applying, thanks!
- Arnaldo
>
> diff --git a/tools/perf/config/feature-tests.mak b/tools/perf/config/feature-tests.mak
> index 708fb8e..5608add 100644
> --- a/tools/perf/config/feature-tests.mak
> +++ b/tools/perf/config/feature-tests.mak
> @@ -210,6 +210,7 @@ define SOURCE_LIBAUDIT
>
> int main(void)
> {
> + printf("error message: %s\n", audit_errno_to_name(0));
> return audit_open();
> }
> endef
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: perf/compat: Sharpen the libaudit dependencies test
2013-09-13 19:20 ` Arnaldo Carvalho de Melo
@ 2013-09-14 5:49 ` Ingo Molnar
0 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2013-09-14 5:49 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-tip-commits, linux-kernel, eranian, paulus, hpa, peterz,
efault, fweisbec, adrian.hunter, dsahern, tglx
* Arnaldo Carvalho de Melo <acme@ghostprotocols.net> wrote:
> Em Thu, Sep 12, 2013 at 03:27:06PM +0200, Ingo Molnar escreveu:
> > There are older libaudit versions that don't have an audit_errno_to_name()
> > method, resulting in a builtin-trace.c build error:
> >
> > builtin-trace.c: In function ‘trace__sys_exit’:
> > builtin-trace.c:794: warning: implicit declaration of function ‘audit_errno_to_name’
> >
> > Expand the libaudit test to detect this.
>
> Lets sharpen it a bit more ;-)
>
> CHK libaudit
> <stdin>: In function ‘main’:
> <stdin>:5:9: error: ‘error’ undeclared (first use in this function)
> <stdin>:5:9: note: each undeclared identifier is reported only once for each function it appears in
> <stdin>:5:15: error: expected ‘)’ before ‘message’
> make: Entering directory `/home/git/linux/tools/perf'
> config/Makefile:238: No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev
>
> We need this folded in to buind it, so that the test works:
>
> diff --git a/tools/perf/config/feature-tests.mak b/tools/perf/config/feature-tests.mak
> index 5608add..7f550c1 100644
> --- a/tools/perf/config/feature-tests.mak
> +++ b/tools/perf/config/feature-tests.mak
> @@ -210,7 +210,7 @@ define SOURCE_LIBAUDIT
>
> int main(void)
> {
> - printf("error message: %s\n", audit_errno_to_name(0));
> + printf(\"error message: %s\n\", audit_errno_to_name(0));
indeed, I only tested that it turned the feature off :-/
Thanks,
Ingo
^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip:perf/urgent] perf tools: Sharpen the libaudit dependencies test
2013-09-12 13:27 ` perf/compat: Sharpen the libaudit dependencies test Ingo Molnar
2013-09-13 19:20 ` Arnaldo Carvalho de Melo
@ 2013-09-20 9:55 ` tip-bot for Ingo Molnar
1 sibling, 0 replies; 7+ messages in thread
From: tip-bot for Ingo Molnar @ 2013-09-20 9:55 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, eranian, paulus, hpa, mingo, peterz, efault,
fweisbec, adrian.hunter, dsahern, tglx
Commit-ID: 33cbbdccf39f6d7e01c282c4320d818a75b67d54
Gitweb: http://git.kernel.org/tip/33cbbdccf39f6d7e01c282c4320d818a75b67d54
Author: Ingo Molnar <mingo@kernel.org>
AuthorDate: Thu, 12 Sep 2013 15:27:06 +0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 19 Sep 2013 11:32:17 -0300
perf tools: Sharpen the libaudit dependencies test
There are older libaudit versions that don't have an
audit_errno_to_name() method, resulting in a builtin-trace.c build
error:
builtin-trace.c: In function ‘trace__sys_exit’:
builtin-trace.c:794: warning: implicit declaration of function ‘audit_errno_to_name’
Expand the libaudit test to detect this.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20130912132706.GD23826@gmail.com
[ Fix the test by escaping the double quotes ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/config/feature-tests.mak | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/config/feature-tests.mak b/tools/perf/config/feature-tests.mak
index 708fb8e..7f550c1 100644
--- a/tools/perf/config/feature-tests.mak
+++ b/tools/perf/config/feature-tests.mak
@@ -210,6 +210,7 @@ define SOURCE_LIBAUDIT
int main(void)
{
+ printf(\"error message: %s\n\", audit_errno_to_name(0));
return audit_open();
}
endef
^ permalink raw reply related [flat|nested] 7+ messages in thread
* perf/compat: Fill in new definitions for madvise()/mmap() flags
2013-08-29 10:09 [tip:perf/core] perf trace: Simplify sys_exit return printing tip-bot for Arnaldo Carvalho de Melo
2013-09-12 13:27 ` perf/compat: Sharpen the libaudit dependencies test Ingo Molnar
@ 2013-09-12 13:29 ` Ingo Molnar
2013-09-20 9:55 ` [tip:perf/urgent] perf tools: Fill in new definitions for madvise ()/mmap() flags tip-bot for Ingo Molnar
1 sibling, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2013-09-12 13:29 UTC (permalink / raw)
To: hpa, acme, paulus, eranian, linux-kernel, efault, peterz,
fweisbec, dsahern, adrian.hunter, tglx, Arnaldo Carvalho de Melo
Cc: linux-tip-commits
builtin-trace.c started using various new syscall features not defined in
the header files of older distros - resulting in build failures.
Fill in the (ABI) constants if they are not defined.
(There might be a better place to put this than builtin-trace.c, into a
compat header or so.)
Signed-off-by: Ingo Molnar <mingo@kernel.org>
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index f5aa637..e640e28 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -16,6 +16,23 @@
#include <sys/mman.h>
#include <linux/futex.h>
+/* For older distros: */
+#ifndef MAP_STACK
+# define MAP_STACK 0x20000
+#endif
+
+#ifndef MADV_HWPOISON
+# define MADV_HWPOISON 100
+#endif
+
+#ifndef MADV_MERGEABLE
+# define MADV_MERGEABLE 12
+#endif
+
+#ifndef MADV_UNMERGEABLE
+# define MADV_UNMERGEABLE 13
+#endif
+
static size_t syscall_arg__scnprintf_hex(char *bf, size_t size,
unsigned long arg,
u8 arg_idx __maybe_unused,
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [tip:perf/urgent] perf tools: Fill in new definitions for madvise ()/mmap() flags
2013-09-12 13:29 ` perf/compat: Fill in new definitions for madvise()/mmap() flags Ingo Molnar
@ 2013-09-20 9:55 ` tip-bot for Ingo Molnar
0 siblings, 0 replies; 7+ messages in thread
From: tip-bot for Ingo Molnar @ 2013-09-20 9:55 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, eranian, paulus, hpa, mingo, peterz, efault,
fweisbec, adrian.hunter, dsahern, tglx
Commit-ID: 456857bded19a4160bbe083bae926e23f483b7f7
Gitweb: http://git.kernel.org/tip/456857bded19a4160bbe083bae926e23f483b7f7
Author: Ingo Molnar <mingo@kernel.org>
AuthorDate: Thu, 12 Sep 2013 15:29:00 +0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 19 Sep 2013 11:32:17 -0300
perf tools: Fill in new definitions for madvise()/mmap() flags
builtin-trace.c started using various new syscall features not defined
in the header files of older distros - resulting in build failures.
Fill in the (ABI) constants if they are not defined.
(There might be a better place to put this than builtin-trace.c, into a
compat header or so.)
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-tip-commits@vger.kernel.org
Link: http://lkml.kernel.org/r/20130912132900.GE23826@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-trace.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index f5aa637..fd48534 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -16,6 +16,23 @@
#include <sys/mman.h>
#include <linux/futex.h>
+/* For older distros: */
+#ifndef MAP_STACK
+# define MAP_STACK 0x20000
+#endif
+
+#ifndef MADV_HWPOISON
+# define MADV_HWPOISON 100
+#endif
+
+#ifndef MADV_MERGEABLE
+# define MADV_MERGEABLE 12
+#endif
+
+#ifndef MADV_UNMERGEABLE
+# define MADV_UNMERGEABLE 13
+#endif
+
static size_t syscall_arg__scnprintf_hex(char *bf, size_t size,
unsigned long arg,
u8 arg_idx __maybe_unused,
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-09-20 9:56 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-29 10:09 [tip:perf/core] perf trace: Simplify sys_exit return printing tip-bot for Arnaldo Carvalho de Melo
2013-09-12 13:27 ` perf/compat: Sharpen the libaudit dependencies test Ingo Molnar
2013-09-13 19:20 ` Arnaldo Carvalho de Melo
2013-09-14 5:49 ` Ingo Molnar
2013-09-20 9:55 ` [tip:perf/urgent] perf tools: " tip-bot for Ingo Molnar
2013-09-12 13:29 ` perf/compat: Fill in new definitions for madvise()/mmap() flags Ingo Molnar
2013-09-20 9:55 ` [tip:perf/urgent] perf tools: Fill in new definitions for madvise ()/mmap() flags tip-bot for Ingo Molnar
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.