summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel
diff options
context:
space:
mode:
authorRoy.Li <rongqing.li@windriver.com>2013-06-07 13:37:44 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-11 15:38:01 +0100
commit9fcf4e9ad09b31f15cd8b50b9fc197daadedc11f (patch)
tree2f59da2cda1d9b729e6f67521b419923fa875a6a /meta/recipes-kernel
parentb4ad8ff0d70d1dc952181da404a5ad6c6d4c8d74 (diff)
downloadpoky-9fcf4e9ad09b31f15cd8b50b9fc197daadedc11f.tar.gz
trace-cmd: backport three patches
Backport three patches to fix running issues. (From OE-Core rev: c00f67b5cd84adda7566505ec9372e11ad812ca1) Signed-off-by: Roy.Li <rongqing.li@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel')
-rw-r--r--meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Add-checks-for-invalid-pointers-to-fix-seg.patch61
-rw-r--r--meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Do-not-call-stop_threads-if-doing-latency-.patch38
-rw-r--r--meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Setting-plugin-to-nop-clears-data-before-i.patch96
-rw-r--r--meta/recipes-kernel/trace-cmd/trace-cmd_1.2.bb8
4 files changed, 201 insertions, 2 deletions
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Add-checks-for-invalid-pointers-to-fix-seg.patch b/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Add-checks-for-invalid-pointers-to-fix-seg.patch
new file mode 100644
index 0000000000..8fdeedb008
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Add-checks-for-invalid-pointers-to-fix-seg.patch
@@ -0,0 +1,61 @@
1From a6e259b2cd43db3c0f69441f627a8cf214f88506 Mon Sep 17 00:00:00 2001
2From: Mark Asselstine <mark.asselstine@windriver.com>
3Date: Thu, 5 Apr 2012 15:19:44 -0400
4Subject: [PATCH] trace-cmd: Add checks for invalid pointers to fix segfaults
5
6Upstream-Status: Backport
7
8Running 'trace-cmd report' after running latency tracers will cause a
9segfault due to invalid pointers. Adding checks to ensure
10pointers/lists are initialized before attempting to use them prevents
11these segfaults.
12
13Link: http://lkml.kernel.org/r/1333653586-3379-2-git-send-email-mark.asselstine@windriver.com
14
15Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
16Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
17---
18 trace-input.c | 12 +++++++++---
19 1 file changed, 9 insertions(+), 3 deletions(-)
20
21diff --git a/trace-input.c b/trace-input.c
22index b6af1e6..5151c1e 100644
23--- a/trace-input.c
24+++ b/trace-input.c
25@@ -695,7 +695,8 @@ static void __free_page(struct tracecmd_input *handle, struct page *page)
26
27 static void free_page(struct tracecmd_input *handle, int cpu)
28 {
29- if (!handle->cpu_data[cpu].page)
30+ if (!handle->cpu_data || cpu >= handle->cpus ||
31+ !handle->cpu_data[cpu].page)
32 return;
33
34 __free_page(handle, handle->cpu_data[cpu].page);
35@@ -746,8 +747,12 @@ void tracecmd_record_ref(struct record *record)
36
37 static void free_next(struct tracecmd_input *handle, int cpu)
38 {
39- struct record *record = handle->cpu_data[cpu].next;
40+ struct record *record;
41+
42+ if (!handle->cpu_data || cpu >= handle->cpus)
43+ return;
44
45+ record = handle->cpu_data[cpu].next;
46 if (!record)
47 return;
48
49@@ -2337,7 +2342,8 @@ void tracecmd_close(struct tracecmd_input *handle)
50 /* The tracecmd_peek_data may have cached a record */
51 free_next(handle, cpu);
52 free_page(handle, cpu);
53- if (!list_empty(&handle->cpu_data[cpu].pages))
54+ if (handle->cpu_data &&
55+ !list_empty(&handle->cpu_data[cpu].pages))
56 warning("pages still allocated on cpu %d%s",
57 cpu, show_records(&handle->cpu_data[cpu].pages));
58 }
59--
601.7.10.4
61
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Do-not-call-stop_threads-if-doing-latency-.patch b/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Do-not-call-stop_threads-if-doing-latency-.patch
new file mode 100644
index 0000000000..4c00c512bb
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Do-not-call-stop_threads-if-doing-latency-.patch
@@ -0,0 +1,38 @@
1From 356dee73d9ced3e019dea2883a7f357fd4664b3e Mon Sep 17 00:00:00 2001
2From: Mark Asselstine <mark.asselstine@windriver.com>
3Date: Thu, 5 Apr 2012 15:19:45 -0400
4Subject: [PATCH] trace-cmd: Do not call stop_threads() if doing latency
5 tracing
6
7Upstream-Status: Backport
8
9If we are using a latency tracer we do not call start_threads() we
10should therefore not call stop_threads() if 'latency'. Attempting
11to call stop_threads() without first calling start_threads() will
12cause a segfault since pids will be uninitialized.
13
14Link: http://lkml.kernel.org/r/1333653586-3379-3-git-send-email-mark.asselstine@windriver.com
15
16Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
17Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
18---
19 trace-record.c | 3 ++-
20 1 file changed, 2 insertions(+), 1 deletion(-)
21
22diff --git a/trace-record.c b/trace-record.c
23index fcec28b..1c56fa9 100644
24--- a/trace-record.c
25+++ b/trace-record.c
26@@ -2216,7 +2216,8 @@ void trace_record (int argc, char **argv)
27 }
28
29 disable_tracing();
30- stop_threads();
31+ if (!latency)
32+ stop_threads();
33 }
34
35 for (cpu = 0; cpu < cpu_count; cpu++) {
36--
371.7.10.4
38
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Setting-plugin-to-nop-clears-data-before-i.patch b/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Setting-plugin-to-nop-clears-data-before-i.patch
new file mode 100644
index 0000000000..724e1e80b1
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Setting-plugin-to-nop-clears-data-before-i.patch
@@ -0,0 +1,96 @@
1From d65740d61e7a4ea6d8d77237954b33dd18e3276c Mon Sep 17 00:00:00 2001
2From: Mark Asselstine <mark.asselstine@windriver.com>
3Date: Sun, 8 Apr 2012 11:38:45 -0400
4Subject: [PATCH] trace-cmd: Setting plugin to 'nop' clears data before it's
5 recorded
6
7Upstream-Status: Backport
8
9commit e09a5db1a929ab668c273b87c4f0a32b81e1c21a
10[trace-cmd: Add trace-cmd record --date option]
11
12moved the call to disable_all() in trace_record() from after record_data()
13to before it. Unfortunately disable_all() sets 'nop' in 'current_tracer'
14which has the side affect of clearing 'trace', thus all the latency tracer
15reports are empty/useless. Here we make disable_all() optionally call
16set_plugin() thus, where we need to, we can delay the disabling of the tracer
17until we have had a chance to capture 'trace'. We have added this delayed
18behavior to trace_record() to fix the latency reports, for all other calls to
19disable_all() we continue to have set_plugin() called.
20
21Link: http://lkml.kernel.org/r/1333899525-6436-1-git-send-email-mark.asselstine@windriver.com
22
23Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
24Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
25---
26 trace-record.c | 16 ++++++++++------
27 1 file changed, 10 insertions(+), 6 deletions(-)
28
29diff --git a/trace-record.c b/trace-record.c
30index 1c56fa9..95d4a2a 100644
31--- a/trace-record.c
32+++ b/trace-record.c
33@@ -897,11 +897,13 @@ static void disable_tracing(void)
34 write_tracing_on(0);
35 }
36
37-static void disable_all(void)
38+static void disable_all(int disable_tracer)
39 {
40 disable_tracing();
41
42- set_plugin("nop");
43+ if (disable_tracer)
44+ set_plugin("nop");
45+
46 reset_events();
47
48 /* Force close and reset of ftrace pid file */
49@@ -1573,7 +1575,7 @@ static void set_funcs(void)
50 /* make sure we are filtering functions */
51 if (func_stack) {
52 if (!functions_filtered()) {
53- disable_all();
54+ disable_all(1);
55 die("Function stack trace set, but functions not filtered");
56 }
57 save_option(FUNC_STACK_TRACE);
58@@ -1938,7 +1940,7 @@ void trace_record (int argc, char **argv)
59 break;
60 }
61 }
62- disable_all();
63+ disable_all(1);
64 set_buffer_size();
65 exit(0);
66 } else
67@@ -2147,7 +2149,7 @@ void trace_record (int argc, char **argv)
68
69 if (!extract) {
70 fset = set_ftrace(!disable);
71- disable_all();
72+ disable_all(1);
73
74 /* Record records the date first */
75 if (record && date)
76@@ -2227,7 +2229,7 @@ void trace_record (int argc, char **argv)
77 }
78
79 if (!keep)
80- disable_all();
81+ disable_all(0);
82
83 printf("Kernel buffer statistics:\n"
84 " Note: \"entries\" are the entries left in the kernel ring buffer and are not\n"
85@@ -2249,6 +2251,8 @@ void trace_record (int argc, char **argv)
86 if (keep)
87 exit(0);
88
89+ set_plugin("nop");
90+
91 /* If tracing_on was enabled before we started, set it on now */
92 if (tracing_on_init_val)
93 write_tracing_on(tracing_on_init_val);
94--
951.7.10.4
96
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd_1.2.bb b/meta/recipes-kernel/trace-cmd/trace-cmd_1.2.bb
index 90ba3b35e3..ff895f8eb3 100644
--- a/meta/recipes-kernel/trace-cmd/trace-cmd_1.2.bb
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd_1.2.bb
@@ -3,7 +3,7 @@ LICENSE = "GPLv2 & LGPLv2.1"
3LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ 3LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
4 file://trace-cmd.c;beginline=6;endline=8;md5=2c22c965a649ddd7973d7913c5634a5e \ 4 file://trace-cmd.c;beginline=6;endline=8;md5=2c22c965a649ddd7973d7913c5634a5e \
5 file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff \ 5 file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff \
6 file://trace-input.c;beginline=5;endine=8;md5=c9c405aaf5cfc09582ec83cf6e83a020" 6 file://trace-input.c;beginline=5;endine=8;md5=6ad47cc2b03385d8456771eec5eeea0b"
7 7
8SRCREV = "7055ffd37beeb44714e86a4abc703f7e175a0db5" 8SRCREV = "7055ffd37beeb44714e86a4abc703f7e175a0db5"
9PR = "r3" 9PR = "r3"
@@ -14,7 +14,11 @@ inherit pkgconfig pythonnative
14SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git;protocol=git \ 14SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git;protocol=git \
15 file://addldflags.patch \ 15 file://addldflags.patch \
16 file://make-docs-optional.patch \ 16 file://make-docs-optional.patch \
17 file://blktrace-api-compatibility.patch" 17 file://blktrace-api-compatibility.patch \
18 file://trace-cmd-Add-checks-for-invalid-pointers-to-fix-seg.patch \
19 file://trace-cmd-Do-not-call-stop_threads-if-doing-latency-.patch \
20 file://trace-cmd-Setting-plugin-to-nop-clears-data-before-i.patch \
21"
18S = "${WORKDIR}/git" 22S = "${WORKDIR}/git"
19 23
20EXTRA_OEMAKE = "'prefix=${prefix}'" 24EXTRA_OEMAKE = "'prefix=${prefix}'"