]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
tools lib traceevent: Fix "robust" test of do_generate_dynamic_list_file
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 5 Aug 2019 17:01:50 +0000 (13:01 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 12 Nov 2019 18:04:19 +0000 (19:04 +0100)
BugLink: https://bugs.launchpad.net/bugs/1849576
commit 82a2f88458d70704be843961e10b5cef9a6e95d3 upstream.

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 <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Carrillo-Cisneros <davidcc@google.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Michal rarek <mmarek@suse.com>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: stable@vger.kernel.org
Fixes: 6467753d61399 ("tools lib traceevent: Robustify do_generate_dynamic_list_file")
Link: http://lkml.kernel.org/r/20190805130150.25acfeb1@gandalf.local.home
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
tools/lib/traceevent/Makefile

index a26c44cf31aa48eb60914bc714773ea84dbb0c76..8107f060fa849263cb84a8b2dce774af2e14462f 100644 (file)
@@ -259,8 +259,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 '};';                                              \