Skip to contentSkip to conversation

perf/urgent fixes

GIT PULL New Arnaldo Carvalho de Melo 5 participants 11 messages Apr 23, 2015 – May 1, 2015

Subsystems (2)
lore
Share & tools
lore

Arnaldo Carvalho de Melo

author maintainer
#0 lore raw

Hi Ingo,

Please consider pulling,

- Arnaldo

The following changes since commit 0140e6141e4f1d4b15fb469e6912b0e71b7d1cc2:

perf/x86/intel/uncore: Move PCI IDs for IMC to uncore driver (2015-04-22 08:29:19 +0200)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo

for you to fetch changes up to de28c15daf60e9625bece22f13a091fac8d05f1d:

tools lib api: Undefine _FORTIFY_SOURCE before setting it (2015-04-23 17:08:23 -0300)

----------------------------------------------------------------
perf/urgent fixes:

User visible:

- Enable events when doing system wide 'trace' and starting a workload, e.g:

   # trace -a sleep 1

now it matches the pattern in 'record' and will show envents instead of sitting doing nothing while waiting for the started workload to finish (Arnaldo Carvalho de Melo)

- Disable and drain events when forked 'trace' workload ends making sure we notice the end of the workload instead of trying to keep up with the seemingly neverending flux of system wide events (Arnaldo Carvalho de Melo)

Infrastructure:

- Fix the build on 32-bit ARM by consistently use PRIu64 for printing u64 values in 'perf kmem' (Will Deacon)

- Undefine _FORTIFY_SOURCE before setting it in tools/perf/api, fixing the build on Hardened Gentoo systems (Bobby Powers)

----------------------------------------------------------------
Arnaldo Carvalho de Melo (2):
perf trace: Enable events when doing system wide tracing and starting a workload perf trace: Disable events and drain events when forked workload ends

Bobby Powers (1):
tools lib api: Undefine _FORTIFY_SOURCE before setting it

Will Deacon (1):
perf kmem: Consistently use PRIu64 for printing u64 values

 tools/lib/api/Makefile     |  2 +-
 tools/perf/builtin-kmem.c  |  4 ++--
 tools/perf/builtin-trace.c | 10 ++++++++--
 3 files changed, 11 insertions(+), 5 deletions(-)
author maintainer
#1 lore raw

PATCH 1/4 perf trace: Enable events when doing system wide tracing and starting a workload

From: Arnaldo Carvalho de Melo <[email protected]>

commit f7aa222ff397
Author: Arnaldo Carvalho de Melo <[email protected]>
Date: Tue Feb 3 13:25:39 2015 -0300

perf trace: No need to enable evsels for workload started from perf

The assumption was that whenever a workload is specified, the attr.enable_on_exec evsel flag would be set, but that is not happening when perf_record_opts.system_wide is set, for instance

That resulted in both perf_evlist__enable() and attr.enable_on_exec being not called/set, which made the events to remain disabled while the workload runs, producing no output.

Fix it, by calling perf_evlist__enable() in the 'trace' tool when forking and not targetting a workload started from trace

v2: Test against !target__none(), as suggested by Namhyung Kim, that is what is used in perf_evsel__config() when deciding if the attr.enable_on_exec flag to be set. More work is needed to cover other cases such as opts->initial_delay.

---
 tools/perf/builtin-trace.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/perf/builtin-trace.c +3 -2
index e124741be187..8842218e1856 100644
@@ -2241,10 +2241,11 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 	if (err < 0)
 		goto out_error_mmap;
 
+	if (!target__none(&trace->opts.target))
+		perf_evlist__enable(evlist);
+
 	if (forks)
 		perf_evlist__start_workload(evlist);
-	else
-		perf_evlist__enable(evlist);
 
 	trace->multiple_threads = evlist->threads->map[0] == -1 ||
 				  evlist->threads->nr > 1 ||
Signature · 1 line
1.9.3
author maintainer
#2 lore raw

PATCH 2/4 perf trace: Disable events and drain events when forked workload ends

In reply to Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <[email protected]>

We were not checking in the inner event processing loop if the forked workload had finished, which, on a busy system, may make it take a long time trying to drain events, entering a seemingly neverending loop, waiting for the system to get idle enough to make it drain the buffers.

Fix it by disabling the events when 'done' is true, in the inner loop, to start draining what is in the buffers.

Now:

[root@ssdandy ~]# time trace --filter-pids 14003 -a sleep 1 | tail
996.748 ( 0.002 ms): sh/30296 rt_sigprocmask(how: SETMASK, nset: 0x7ffc83418160, sigsetsize: 8) = 0 996.751 ( 0.002 ms): sh/30296 rt_sigprocmask(how: BLOCK, nset: 0x7ffc834181f0, oset: 0x7ffc83418270, sigsetsize: 8) = 0 996.755 ( 0.002 ms): sh/30296 rt_sigaction(sig: INT, act: 0x7ffc83417f50, oact: 0x7ffc83417ff0, sigsetsize: 8) = 0
1004.543 ( 0.362 ms): tail/30198 ... [continued]: read()) = 4096
1004.548 ( 7.791 ms): sh/30296 wait4(upid: -1, stat_addr: 0x7ffc834181a0) ...
1004.975 ( 0.427 ms): tail/30198 read(buf: 0x7633f0, count: 8192) = 4096
1005.390 ( 0.410 ms): tail/30198 read(buf: 0x765410, count: 8192) = 4096
1005.743 ( 0.348 ms): tail/30198 read(buf: 0x7633f0, count: 8192) = 4096
1006.197 ( 0.449 ms): tail/30198 read(buf: 0x765410, count: 8192) = 4096
1006.492 ( 0.290 ms): tail/30198 read(buf: 0x7633f0, count: 8192) = 4096

real 0m1.219s
user 0m0.704s
sys 0m0.331s
[root@ssdandy ~]#

---
 tools/perf/builtin-trace.c | 5 +++++
 1 file changed, 5 insertions(+)
tools/perf/builtin-trace.c +5 -0
index 8842218e1856..e122970361f2 100644
@@ -2273,6 +2273,11 @@ next_event:
 
 			if (interrupted)
 				goto out_disable;
+
+			if (done && !draining) {
+				perf_evlist__disable(evlist);
+				draining = true;
+			}
 		}
 	}
 
Signature · 1 line
1.9.3
author maintainer
#3 lore raw

PATCH 3/4 perf kmem: Consistently use PRIu64 for printing u64 values

In reply to Arnaldo Carvalho de Melo

From: Will Deacon <[email protected]>

Building the perf tool for 32-bit ARM results in the following build error due to a combination of an incorrect conversion specifier and compiling with -Werror:

builtin-kmem.c: In function ‘print_page_summary’:
builtin-kmem.c:644:9: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘u64’ [-Werror=format=]

           nr_alloc_freed, (total_alloc_freed_bytes) / 1024);
           ^
  builtin-kmem.c:647:9: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘u64’ [-Werror=format=]
           (total_page_alloc_bytes - total_alloc_freed_bytes) / 1024);
           ^

cc1: all warnings being treated as errors

This patch fixes the problem by consistently using PRIu64 for printing out u64 values.

---
 tools/perf/builtin-kmem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-kmem.c +2 -2
index 63ea01349b6e..a1915b430044 100644
@@ -640,9 +640,9 @@ static void print_page_summary(void)
 	       nr_page_frees, total_page_free_bytes / 1024);
 	printf("\n");
 
-	printf("%-30s: %'16lu   [ %'16"PRIu64" KB ]\n", "Total alloc+freed requests",
+	printf("%-30s: %'16"PRIu64"   [ %'16"PRIu64" KB ]\n", "Total alloc+freed requests",
 	       nr_alloc_freed, (total_alloc_freed_bytes) / 1024);
-	printf("%-30s: %'16lu   [ %'16"PRIu64" KB ]\n", "Total alloc-only requests",
+	printf("%-30s: %'16"PRIu64"   [ %'16"PRIu64" KB ]\n", "Total alloc-only requests",
 	       nr_page_allocs - nr_alloc_freed,
 	       (total_page_alloc_bytes - total_alloc_freed_bytes) / 1024);
 	printf("%-30s: %'16lu   [ %'16"PRIu64" KB ]\n", "Total free-only requests",
Signature · 1 line
1.9.3
author maintainer
#4 lore raw

PATCH 4/4 tools lib api: Undefine _FORTIFY_SOURCE before setting it

In reply to Arnaldo Carvalho de Melo

From: Bobby Powers <[email protected]>

Some toolchains (like Hardened Gentoo) define _FORTIFY_SOURCE in the built-in, default args. This causes perf builds to fail with:

<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror] <built-in>: note: this is the location of the previous definition cc1:
all warnings being treated as errors

To avoid this, undefine _FORTIFY_SOURCE before (possibly re-)defining it in tools/lib/api.

v2 applies cleanly on top of already pulled kbuild changes for 4.1-rc1.

---
 tools/lib/api/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/api/Makefile +1 -1
index d8fe29fc19a4..8bd960658463 100644
@@ -16,7 +16,7 @@ MAKEFLAGS += --no-print-directory
 LIBFILE = $(OUTPUT)libapi.a
 
 CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
-CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 -fPIC
+CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC
 CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
 
 RM = rm -f
Signature · 1 line
1.9.3
maintainer
#5 lore raw
In reply to Arnaldo Carvalho de Melo

Hi Arnaldo,

I've set up some docker containers for build test, and found a couple of failures.. It seems David's kmem build fix ("perf kmem: Fix compiles on RHEL6/OL6") which is in your perf/core branch also needs to be in perf/urgent. Sorry about the kmem breakages..

And I also found this..

From 581ae7f48c89377755391c3f95637a1d48eefc73 Mon Sep 17 00:00:00 2001
From: Namhyung Kim <[email protected]>
Date: Fri, 24 Apr 2015 10:45:16 +0900
Subject: [PATCH] tools lib traceevent: Fix build failure on 32-bit arch

In my i386 build, it failed like this:

CC event-parse.o
event-parse.c: In function 'print_str_arg':
event-parse.c:3868:5: warning: format '%lu' expects argument of type 'long unsigned int',
but argument 3 has type 'uint64_t' [-Wformat]

---
 tools/lib/traceevent/event-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/event-parse.c +1 -1
index 12a7e2a40c89..aa21bd55bd8a 100644
@@ -3865,7 +3865,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
 			} else if (el_size == 4) {
 				trace_seq_printf(s, "%u", *(uint32_t *)num);
 			} else if (el_size == 8) {
-				trace_seq_printf(s, "%lu", *(uint64_t *)num);
+				trace_seq_printf(s, "%"PRIu64, *(uint64_t *)num);
 			} else {
 				trace_seq_printf(s, "BAD SIZE:%d 0x%x",
 						 el_size, *(uint8_t *)num);
Signature · 5 lines
2.3.4


Thanks,
Namhyung
Quoted 67 lines · Arnaldo Carvalho de Melo

Hi Ingo,

Please consider pulling,

- Arnaldo

The following changes since commit 0140e6141e4f1d4b15fb469e6912b0e71b7d1cc2:

perf/x86/intel/uncore: Move PCI IDs for IMC to uncore driver (2015-04-22 08:29:19 +0200)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo

for you to fetch changes up to de28c15daf60e9625bece22f13a091fac8d05f1d:

tools lib api: Undefine _FORTIFY_SOURCE before setting it (2015-04-23 17:08:23 -0300)

----------------------------------------------------------------
perf/urgent fixes:

User visible:

- Enable events when doing system wide 'trace' and starting a workload, e.g:

   # trace -a sleep 1

now it matches the pattern in 'record' and will show envents instead of sitting doing nothing while waiting for the started workload to finish (Arnaldo Carvalho de Melo)

- Disable and drain events when forked 'trace' workload ends making sure we notice the end of the workload instead of trying to keep up with the seemingly neverending flux of system wide events (Arnaldo Carvalho de Melo)

Infrastructure:

- Fix the build on 32-bit ARM by consistently use PRIu64 for printing u64 values in 'perf kmem' (Will Deacon)

- Undefine _FORTIFY_SOURCE before setting it in tools/perf/api, fixing the build on Hardened Gentoo systems (Bobby Powers)

----------------------------------------------------------------
Arnaldo Carvalho de Melo (2):
perf trace: Enable events when doing system wide tracing and starting a workload perf trace: Disable events and drain events when forked workload ends

Bobby Powers (1):
tools lib api: Undefine _FORTIFY_SOURCE before setting it

Will Deacon (1):
perf kmem: Consistently use PRIu64 for printing u64 values

 tools/lib/api/Makefile     |  2 +-
 tools/perf/builtin-kmem.c  |  4 ++--
 tools/perf/builtin-trace.c | 10 ++++++++--
 3 files changed, 11 insertions(+), 5 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

author maintainer
#6 lore raw

Em Fri, Apr 24, 2015 at 11:02:18AM +0900, Namhyung Kim escreveu:

Quoted 8 lines

Hi Arnaldo,

I've set up some docker containers for build test, and found a couple of failures.. It seems David's kmem build fix ("perf kmem: Fix compiles on RHEL6/OL6") which is in your perf/core branch also needs to be in perf/urgent. Sorry about the kmem breakages..

And I also found this..

I can send those tomorrow, in another pull request to Ingo. I noticed a few on a RHEL5 machine I tested today, in libtraceevent even, I guess you was on the CC list for that bug report.

- Arnaldo

Quoted 108 lines
Quoted 2 lines

From 581ae7f48c89377755391c3f95637a1d48eefc73 Mon Sep 17 00:00:00 2001

From: Namhyung Kim <[email protected]>
Date: Fri, 24 Apr 2015 10:45:16 +0900
Subject: [PATCH] tools lib traceevent: Fix build failure on 32-bit arch

In my i386 build, it failed like this:

CC event-parse.o
event-parse.c: In function 'print_str_arg':
event-parse.c:3868:5: warning: format '%lu' expects argument of type 'long unsigned int',
but argument 3 has type 'uint64_t' [-Wformat]

---
 tools/lib/traceevent/event-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/event-parse.c +1 -1
index 12a7e2a40c89..aa21bd55bd8a 100644
@@ -3865,7 +3865,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
 			} else if (el_size == 4) {
 				trace_seq_printf(s, "%u", *(uint32_t *)num);
 			} else if (el_size == 8) {
-				trace_seq_printf(s, "%lu", *(uint64_t *)num);
+				trace_seq_printf(s, "%"PRIu64, *(uint64_t *)num);
 			} else {
 				trace_seq_printf(s, "BAD SIZE:%d 0x%x",
 						 el_size, *(uint8_t *)num);
Signature · 5 lines
2.3.4


Thanks,
Namhyung
Quoted 67 lines · Arnaldo Carvalho de Melo

Hi Ingo,

Please consider pulling,

- Arnaldo

The following changes since commit 0140e6141e4f1d4b15fb469e6912b0e71b7d1cc2:

perf/x86/intel/uncore: Move PCI IDs for IMC to uncore driver (2015-04-22 08:29:19 +0200)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo

for you to fetch changes up to de28c15daf60e9625bece22f13a091fac8d05f1d:

tools lib api: Undefine _FORTIFY_SOURCE before setting it (2015-04-23 17:08:23 -0300)

----------------------------------------------------------------
perf/urgent fixes:

User visible:

- Enable events when doing system wide 'trace' and starting a workload, e.g:

   # trace -a sleep 1

now it matches the pattern in 'record' and will show envents instead of sitting doing nothing while waiting for the started workload to finish (Arnaldo Carvalho de Melo)

- Disable and drain events when forked 'trace' workload ends making sure we notice the end of the workload instead of trying to keep up with the seemingly neverending flux of system wide events (Arnaldo Carvalho de Melo)

Infrastructure:

- Fix the build on 32-bit ARM by consistently use PRIu64 for printing u64 values in 'perf kmem' (Will Deacon)

- Undefine _FORTIFY_SOURCE before setting it in tools/perf/api, fixing the build on Hardened Gentoo systems (Bobby Powers)

----------------------------------------------------------------
Arnaldo Carvalho de Melo (2):
perf trace: Enable events when doing system wide tracing and starting a workload perf trace: Disable events and drain events when forked workload ends

Bobby Powers (1):
tools lib api: Undefine _FORTIFY_SOURCE before setting it

Will Deacon (1):
perf kmem: Consistently use PRIu64 for printing u64 values

 tools/lib/api/Makefile     |  2 +-
 tools/perf/builtin-kmem.c  |  4 ++--
 tools/perf/builtin-trace.c | 10 ++++++++--
 3 files changed, 11 insertions(+), 5 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Acked-by
#7 lore raw
In reply to Namhyung Kim
Quoted 33 lines · Namhyung Kim

Hi Arnaldo,

I've set up some docker containers for build test, and found a couple of failures.. It seems David's kmem build fix ("perf kmem: Fix compiles on RHEL6/OL6") which is in your perf/core branch also needs to be in perf/urgent. Sorry about the kmem breakages..

And I also found this..

From 581ae7f48c89377755391c3f95637a1d48eefc73 Mon Sep 17 00:00:00 2001
From: Namhyung Kim <[email protected]>
Date: Fri, 24 Apr 2015 10:45:16 +0900
Subject: [PATCH] tools lib traceevent: Fix build failure on 32-bit arch

In my i386 build, it failed like this:

CC event-parse.o
event-parse.c: In function 'print_str_arg':
event-parse.c:3868:5: warning: format '%lu' expects argument of type 'long unsigned int',
but argument 3 has type 'uint64_t' [-Wformat]

---
 tools/lib/traceevent/event-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/event-parse.c +0 -0
index 12a7e2a40c89..aa21bd55bd8a 100644

tools/lib/traceevent/event-parse.c static void print_str_arg(struct trace_seq *s, void *data, int size, · line 3868

Quoted 5 lines
tools/lib/traceevent/event-parse.c +1 -1
@@ -3865,7 +3865,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
 			} else if (el_size == 4) {
 				trace_seq_printf(s, "%u", *(uint32_t *)num);
 			} else if (el_size == 8) {
-				trace_seq_printf(s, "%lu", *(uint64_t *)num);
+				trace_seq_printf(s, "%"PRIu64, *(uint64_t *)num);

Didn't know about PRIu64 and friends. FWIW,

While you are at it, you could also fix the previous "%u" to "%"PRIu32

Quoted 80 lines
tools/lib/traceevent/event-parse.c +0 -0
 			} else {
 				trace_seq_printf(s, "BAD SIZE:%d 0x%x",
 						 el_size, *(uint8_t *)num);
Signature · 5 lines
2.3.4


Thanks,
Namhyung
Quoted 67 lines · Arnaldo Carvalho de Melo

Hi Ingo,

Please consider pulling,

- Arnaldo

The following changes since commit 0140e6141e4f1d4b15fb469e6912b0e71b7d1cc2:

perf/x86/intel/uncore: Move PCI IDs for IMC to uncore driver (2015-04-22 08:29:19 +0200)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo

for you to fetch changes up to de28c15daf60e9625bece22f13a091fac8d05f1d:

tools lib api: Undefine _FORTIFY_SOURCE before setting it (2015-04-23 17:08:23 -0300)

----------------------------------------------------------------
perf/urgent fixes:

User visible:

- Enable events when doing system wide 'trace' and starting a workload, e.g:

   # trace -a sleep 1

now it matches the pattern in 'record' and will show envents instead of sitting doing nothing while waiting for the started workload to finish (Arnaldo Carvalho de Melo)

- Disable and drain events when forked 'trace' workload ends making sure we notice the end of the workload instead of trying to keep up with the seemingly neverending flux of system wide events (Arnaldo Carvalho de Melo)

Infrastructure:

- Fix the build on 32-bit ARM by consistently use PRIu64 for printing u64 values in 'perf kmem' (Will Deacon)

- Undefine _FORTIFY_SOURCE before setting it in tools/perf/api, fixing the build on Hardened Gentoo systems (Bobby Powers)

----------------------------------------------------------------
Arnaldo Carvalho de Melo (2):
perf trace: Enable events when doing system wide tracing and starting a workload perf trace: Disable events and drain events when forked workload ends

Bobby Powers (1):
tools lib api: Undefine _FORTIFY_SOURCE before setting it

Will Deacon (1):
perf kmem: Consistently use PRIu64 for printing u64 values

 tools/lib/api/Makefile     |  2 +-
 tools/perf/builtin-kmem.c  |  4 ++--
 tools/perf/builtin-trace.c | 10 ++++++++--
 3 files changed, 11 insertions(+), 5 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

author maintainer
#8 lore raw

Em Fri, Apr 24, 2015 at 09:59:18AM +0100, Javi Merino escreveu:

Quoted 9 lines · Namhyung Kim
Quoted 8 lines

Hi Arnaldo,

I've set up some docker containers for build test, and found a couple of failures.. It seems David's kmem build fix ("perf kmem: Fix compiles on RHEL6/OL6") which is in your perf/core branch also needs to be in perf/urgent. Sorry about the kmem breakages..

And I also found this..

Applied both, some more?

- Arnaldo

Quoted 116 lines
Quoted 24 lines

From 581ae7f48c89377755391c3f95637a1d48eefc73 Mon Sep 17 00:00:00 2001
From: Namhyung Kim <[email protected]>
Date: Fri, 24 Apr 2015 10:45:16 +0900
Subject: [PATCH] tools lib traceevent: Fix build failure on 32-bit arch

In my i386 build, it failed like this:

CC event-parse.o
event-parse.c: In function 'print_str_arg':
event-parse.c:3868:5: warning: format '%lu' expects argument of type 'long unsigned int',
but argument 3 has type 'uint64_t' [-Wformat]

---
 tools/lib/traceevent/event-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/event-parse.c +0 -0
index 12a7e2a40c89..aa21bd55bd8a 100644

tools/lib/traceevent/event-parse.c static void print_str_arg(struct trace_seq *s, void *data, int size, · line 3868

Quoted 5 lines
tools/lib/traceevent/event-parse.c +1 -1
@@ -3865,7 +3865,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
 			} else if (el_size == 4) {
 				trace_seq_printf(s, "%u", *(uint32_t *)num);
 			} else if (el_size == 8) {
-				trace_seq_printf(s, "%lu", *(uint64_t *)num);
+				trace_seq_printf(s, "%"PRIu64, *(uint64_t *)num);

Didn't know about PRIu64 and friends. FWIW,

While you are at it, you could also fix the previous "%u" to "%"PRIu32

Quoted 80 lines
tools/lib/traceevent/event-parse.c +0 -0
 			} else {
 				trace_seq_printf(s, "BAD SIZE:%d 0x%x",
 						 el_size, *(uint8_t *)num);
Signature · 5 lines
2.3.4


Thanks,
Namhyung
Quoted 67 lines · Arnaldo Carvalho de Melo

Hi Ingo,

Please consider pulling,

- Arnaldo

The following changes since commit 0140e6141e4f1d4b15fb469e6912b0e71b7d1cc2:

perf/x86/intel/uncore: Move PCI IDs for IMC to uncore driver (2015-04-22 08:29:19 +0200)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo

for you to fetch changes up to de28c15daf60e9625bece22f13a091fac8d05f1d:

tools lib api: Undefine _FORTIFY_SOURCE before setting it (2015-04-23 17:08:23 -0300)

----------------------------------------------------------------
perf/urgent fixes:

User visible:

- Enable events when doing system wide 'trace' and starting a workload, e.g:

   # trace -a sleep 1

now it matches the pattern in 'record' and will show envents instead of sitting doing nothing while waiting for the started workload to finish (Arnaldo Carvalho de Melo)

- Disable and drain events when forked 'trace' workload ends making sure we notice the end of the workload instead of trying to keep up with the seemingly neverending flux of system wide events (Arnaldo Carvalho de Melo)

Infrastructure:

- Fix the build on 32-bit ARM by consistently use PRIu64 for printing u64 values in 'perf kmem' (Will Deacon)

- Undefine _FORTIFY_SOURCE before setting it in tools/perf/api, fixing the build on Hardened Gentoo systems (Bobby Powers)

----------------------------------------------------------------
Arnaldo Carvalho de Melo (2):
perf trace: Enable events when doing system wide tracing and starting a workload perf trace: Disable events and drain events when forked workload ends

Bobby Powers (1):
tools lib api: Undefine _FORTIFY_SOURCE before setting it

Will Deacon (1):
perf kmem: Consistently use PRIu64 for printing u64 values

 tools/lib/api/Makefile     |  2 +-
 tools/perf/builtin-kmem.c  |  4 ++--
 tools/perf/builtin-trace.c | 10 ++++++++--
 3 files changed, 11 insertions(+), 5 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#9 lore raw
Quoted 4 lines · Arnaldo Carvalho de Melo

Em Fri, Apr 24, 2015 at 09:59:18AM +0100, Javi Merino escreveu:

Quoted 3 lines · Namhyung Kim
Quoted 2 lines

Hi Arnaldo,

Quoted 8 lines
Quoted 6 lines
Quoted 6 lines

I've set up some docker containers for build test, and found a couple of failures.. It seems David's kmem build fix ("perf kmem: Fix compiles on RHEL6/OL6") which is in your perf/core branch also needs to be in perf/urgent. Sorry about the kmem breakages..

And I also found this..

Applied both, some more?

The only issue remaining for arm/arm64 is the /proc/cpuinfo parsing, which ends up with us passing -jN to Make, where N is 5 or 6 times the number of CPUs in the system.

http://permalink.gmane.org/gmane.linux.kernel/1936575

Will

#10 lore raw

[tip:perf/urgent] tools lib traceevent: Fix build failure on 32-bit arch

In reply to Namhyung Kim
tools lib traceevent: Fix build failure on 32-bit arch
Commit-ID:  410ceb8f2f1d4edeb02d229ef192e76602005b8b
Gitweb:     http://git.kernel.org/tip/410ceb8f2f1d4edeb02d229ef192e76602005b8b
Author:     Namhyung Kim <[email protected]>
AuthorDate: Fri, 24 Apr 2015 10:45:16 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Fri, 24 Apr 2015 12:47:10 -0300

tools lib traceevent: Fix build failure on 32-bit arch

In my i386 build, it failed like this:

CC event-parse.o
event-parse.c: In function 'print_str_arg':
event-parse.c:3868:5: warning: format '%lu' expects argument of type 'long unsigned int',
but argument 3 has type 'uint64_t' [-Wformat]

---
 tools/lib/traceevent/event-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/event-parse.c +1 -1
index 12a7e2a..aa21bd5 100644
@@ -3865,7 +3865,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
 			} else if (el_size == 4) {
 				trace_seq_printf(s, "%u", *(uint32_t *)num);
 			} else if (el_size == 8) {
-				trace_seq_printf(s, "%lu", *(uint64_t *)num);
+				trace_seq_printf(s, "%"PRIu64, *(uint64_t *)num);
 			} else {
 				trace_seq_printf(s, "BAD SIZE:%d 0x%x",
 						 el_size, *(uint8_t *)num);