[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170206174516.GA24988@kernel.org>
Date: Mon, 6 Feb 2017 14:45:16 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: David Carrillo-Cisneros <davidcc@...gle.com>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Jiri Olsa <jolsa@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Wang Nan <wangnan0@...wei.com>, He Kuang <hekuang@...wei.com>,
Michal Marek <mmarek@...e.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Stephane Eranian <eranian@...gle.com>,
Paul Turner <pjt@...gle.com>
Subject: Re: [PATCH 2/4] tools lib traceevent: Robustify
do_generate_dynamic_list_file
Em Wed, Feb 01, 2017 at 10:38:02PM -0800, David Carrillo-Cisneros escreveu:
> The dynamic-list-file used to export dynamic symbols introduced in
>
> commit e3d09ec8126f ("tools lib traceevent: Export dynamic symbols
> used by traceevent plugins")
>
> is generated without any sort of error checking.
>
> I experienced problems due to an old version of nm (v 0.158) that outputs
> in a format distinct from the assumed by the script.
>
> Robustify this by enforcing that the second column in the symbol output
> is an "U" (Undefined) as it should be since we are calling $(NM) -u ...
> and print an error message otherwise.
Thanks, applied.
- Arnaldo
> Signed-off-by: David Carrillo-Cisneros <davidcc@...gle.com>
> ---
> tools/lib/traceevent/Makefile | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
> index 2616c66e10c1..1b6e146429d0 100644
> --- a/tools/lib/traceevent/Makefile
> +++ b/tools/lib/traceevent/Makefile
> @@ -257,10 +257,15 @@ define do_install_plugins
> endef
>
> define do_generate_dynamic_list_file
> - (echo '{'; \
> - $(NM) -u -D $1 | awk 'NF>1 {print "\t"$$2";"}' | sort -u; \
> - echo '};'; \
> - ) > $2
> + symbol_type=`$(NM) -u -D $1 | awk 'NF>1 {print $$1}' | sort -u`;\
> + if [ "$$symbol_type" == "U" ];then \
> + (echo '{'; \
> + $(NM) -u -D $1 | awk 'NF>1 {print "\t"$$2";"}' | sort -u;\
> + echo '};'; \
> + ) > $2; \
> + else \
> + (echo Either missing one of [$1] or bad version of $(NM)) 1>&2;\
> + fi
> endef
>
> install_lib: all_cmd install_plugins
> --
> 2.11.0.483.g087da7b7c-goog
Powered by blists - more mailing lists