Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1575027

Re: [PATCH 2/4] tools lib traceevent: Robustify do_generate_dynamic_list_file

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/4] tools lib traceevent: Robustify do_generate_dynamic_list_file
Date 2017-02-06 18:50 +0100
Message-ID <t7VAl-87K-5@gated-at.bofh.it> (permalink)
References <t6jdL-fC-1@gated-at.bofh.it> <t6jdL-fC-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@google.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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] Fixes for perf build and feature detection David Carrillo-Cisneros <davidcc@google.com> - 2017-02-02 07:40 +0100
  [PATCH 2/4] tools lib traceevent: Robustify do_generate_dynamic_list_file David Carrillo-Cisneros <davidcc@google.com> - 2017-02-02 07:40 +0100
    Re: [PATCH 2/4] tools lib traceevent: Robustify  do_generate_dynamic_list_file Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-06 18:50 +0100
  [PATCH 4/4] tools include: Fix include path for uapi/asm-generic/mman.h David Carrillo-Cisneros <davidcc@google.com> - 2017-02-02 07:40 +0100
    Re: [PATCH 4/4] tools include: Fix include path for  uapi/asm-generic/mman.h Jiri Olsa <jolsa@redhat.com> - 2017-02-02 14:00 +0100
    Re: [PATCH 4/4] tools include: Fix include path for  uapi/asm-generic/mman.h Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-06 19:30 +0100
      Re: [PATCH 4/4] tools include: Fix include path for uapi/asm-generic/mman.h David Carrillo-Cisneros <davidcc@google.com> - 2017-02-06 21:10 +0100
  [PATCH 1/4] perf tools: pass PYTHON config to feature detection David Carrillo-Cisneros <davidcc@google.com> - 2017-02-02 07:40 +0100
    Re: [PATCH 1/4] perf tools: pass PYTHON config to feature detection Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-06 14:20 +0100
      Re: [PATCH 1/4] perf tools: pass PYTHON config to feature detection Namhyung Kim <namhyung@kernel.org> - 2017-02-06 16:30 +0100
    Re: [PATCH 1/4] perf tools: pass PYTHON config to feature detection Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-07 20:50 +0100
      Re: [PATCH 1/4] perf tools: pass PYTHON config to feature detection David Carrillo-Cisneros <davidcc@google.com> - 2017-02-08 04:20 +0100
        [PATCH v2] tools lib traceevent: Robustify do_generate_dynamic_list_file David Carrillo-Cisneros <davidcc@google.com> - 2017-02-08 06:30 +0100
          Re: [PATCH v2] tools lib traceevent: Robustify  do_generate_dynamic_list_file Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-08 13:50 +0100
            Re: [PATCH v2] tools lib traceevent: Robustify  do_generate_dynamic_list_file Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-08 14:30 +0100
              Re: [PATCH v2] tools lib traceevent: Robustify do_generate_dynamic_list_file David Carrillo-Cisneros <davidcc@google.com> - 2017-02-09 06:20 +0100
          [tip:perf/core] tools lib traceevent: Robustify  do_generate_dynamic_list_file tip-bot for David Carrillo-Cisneros <tipbot@zytor.com> - 2017-02-10 09:50 +0100
  Re: [PATCH 0/4] Fixes for perf build and feature detection Jiri Olsa <jolsa@redhat.com> - 2017-02-02 14:00 +0100

csiph-web