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


Groups > linux.kernel > #1441908

Re: [PATCH 29/66] tools lib traceevent: Use str_error_r()

From Steven Rostedt <rostedt@goodmis.org>
Newsgroups linux.kernel
Subject Re: [PATCH 29/66] tools lib traceevent: Use str_error_r()
Date 2016-07-13 01:20 +0200
Message-ID <rUf85-3eh-5@gated-at.bofh.it> (permalink)
References <rUeF3-2Ns-3@gated-at.bofh.it> <rUeOJ-2RS-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 12 Jul 2016 19:40:04 -0300
Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> From: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> To make it portable to non-glibc systems, that follow the XSI variant
> instead of the GNU specific one that gets in place when _GNU_SOURCE is
> defined.
> 
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Wang Nan <wangnan0@huawei.com>
> Link: http://lkml.kernel.org/n/tip-c1gn8x978qfop65m510wy43o@git.kernel.org
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
>  tools/lib/traceevent/event-parse.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
> index a8b6357d1ffe..3a7bd175f73c 100644
> --- a/tools/lib/traceevent/event-parse.c
> +++ b/tools/lib/traceevent/event-parse.c
> @@ -31,6 +31,7 @@
>  #include <errno.h>
>  #include <stdint.h>
>  #include <limits.h>
> +#include <linux/string.h>
>  
>  #include <netinet/ip6.h>
>  #include "event-parse.h"
> @@ -6131,12 +6132,7 @@ int pevent_strerror(struct pevent *pevent __maybe_unused,
>  	const char *msg;
>  
>  	if (errnum >= 0) {
> -		msg = strerror_r(errnum, buf, buflen);
> -		if (msg != buf) {
> -			size_t len = strlen(msg);
> -			memcpy(buf, msg, min(buflen - 1, len));
> -			*(buf + min(buflen - 1, len)) = '\0';
> -		}
> +		str_error_r(errnum, buf, buflen);
>  		return 0;

What library is used with this? When I port this over to trace-cmd
(which is still needed as I develop this there), it fails to build.
"undefined reference to str_error_r"

-- Steve

>  	}
>  

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


Thread

[PATCH 29/66] tools lib traceevent: Use str_error_r() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-13 01:00 +0200
  Re: [PATCH 29/66] tools lib traceevent: Use str_error_r() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-13 01:20 +0200
    Re: [PATCH 29/66] tools lib traceevent: Use str_error_r() Steven Rostedt <rostedt@goodmis.org> - 2016-07-13 01:30 +0200
      Re: [PATCH 29/66] tools lib traceevent: Use str_error_r() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-13 01:40 +0200
        Re: [PATCH 29/66] tools lib traceevent: Use str_error_r() Steven Rostedt <rostedt@goodmis.org> - 2016-07-13 14:40 +0200
          Re: [PATCH 29/66] tools lib traceevent: Use str_error_r() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-13 16:00 +0200
            Re: [PATCH 29/66] tools lib traceevent: Use str_error_r() Steven Rostedt <rostedt@goodmis.org> - 2016-07-13 21:20 +0200
              Re: [PATCH 29/66] tools lib traceevent: Use str_error_r() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-13 22:10 +0200
                Re: [PATCH 29/66] tools lib traceevent: Use str_error_r() Steven Rostedt <rostedt@goodmis.org> - 2016-07-14 03:30 +0200
                Re: [PATCH 29/66] tools lib traceevent: Use str_error_r() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-14 03:40 +0200
                Re: [PATCH 29/66] tools lib traceevent: Use str_error_r() Jiri Olsa <jolsa@redhat.com> - 2016-07-17 20:50 +0200
  Re: [PATCH 29/66] tools lib traceevent: Use str_error_r() Steven Rostedt <rostedt@goodmis.org> - 2016-07-13 01:20 +0200

csiph-web