[PATCH 07/17] tools lib traceevent: Fix "robust" test of do_generate_dynamic_list_file

From
Arnaldo Carvalho de Melo <acme@kernel.org>
Date
2019-08-20 19:28:24
Also in
lkml, stable
Reply to
Arnaldo Carvalho de Melo, 2019-08-20
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

The tools/lib/traceevent/Makefile had a test added to it to detect a failure
of the "nm" when making the dynamic list file (whatever that is). The
problem is that the test sorts the values "U W w" and some versions of sort
will place "w" ahead of "W" (even though it has a higher ASCII value, and
break the test.

Add 'tr "w" "W"' to merge the two and not worry about the ordering.

Reported-by: Tzvetomir Stoyanov <redacted>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Carrillo-Cisneros <redacted>
Cc: He Kuang <redacted>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Michal rarek <redacted>
Cc: Paul Turner <redacted>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <redacted>
Cc: Uwe Kleine-König <redacted>
Cc: Wang Nan <redacted>
Cc: <redacted>
Fixes: 6467753d61399 ("tools lib traceevent: Robustify do_generate_dynamic_list_file")
Link: http://lkml.kernel.org/r/20190805130150.25acfeb1@gandalf.local.home (local)
Signed-off-by: Arnaldo Carvalho de Melo <redacted>
---
 tools/lib/traceevent/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index 3292c290654f..8352d53dcb5a 100644
--- a/tools/lib/traceevent/Makefile
+++ b/tools/lib/traceevent/Makefile
@@ -266,8 +266,8 @@ endef
 
 define do_generate_dynamic_list_file
 	symbol_type=`$(NM) -u -D $1 | awk 'NF>1 {print $$1}' | \
-	xargs echo "U W w" | tr ' ' '\n' | sort -u | xargs echo`;\
-	if [ "$$symbol_type" = "U W w" ];then				\
+	xargs echo "U w W" | tr 'w ' 'W\n' | sort -u | xargs echo`;\
+	if [ "$$symbol_type" = "U W" ];then				\
 		(echo '{';						\
 		$(NM) -u -D $1 | awk 'NF>1 {print "\t"$$2";"}' | sort -u;\
 		echo '};';						\
-- 
2.21.0
Thread (20 messages) 20 messages, 3 authors, last reply 2019-08-20
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help