[lkml]   [2018]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v4] tools/lib/traceevent: Separate out tep_strerror() for strerror_r() issues
Em Fri, Oct 05, 2018 at 12:18:16PM -0400, Steven Rostedt escreveu:
> From: "Steven Rostedt (VMware)" <>
> While working on having PowerTop use libtracevent as a shared object
> library, Tzvetomir hit "str_error_r not defined". This was added by commit
> c3cec9e68f12d ("tools lib traceevent: Use str_error_r()") because
> strerror_r() has two definitions, where one is GNU specific, and the other
> is XSI complient. The strerror_r() is in a wrapper str_error_r() to keep the
> code from having to worry about which compiler is being used.
> The problem is that str_error_r() is external to libtraceevent, and not part
> of the library. If it is used as a shared object then the tools using it
> will need to define that function. I do not want that function defined in
> libtraceevent itself, as it is out of scope for that library.
> As there's only a single instance of this call, and its in the traceevent
> library's own tep_strerror() function, we can copy what was done in perf,
> and create yet another external file that undefs _GNU_SOURCE to use the more
> portable version of the function. We don't need to worry about the errors
> that strerror_r() returns. If the buffer isn't big enough, we simply
> truncate it.

Thanks, applied, replacing the previous version since this is still not
in tip.

- Arnaldo

 \ /
  Last update: 2018-10-08 19:27    [W:0.064 / U:4.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site