linux_dsm_epyc7002/tools/lib/traceevent
Steven Rostedt (VMware) bbbab191c2 tools lib traceevent: Separate out tep_strerror() for strerror_r() issues
While working on having PowerTop use libtracevent as a shared object
library, Tzvetomir hit "str_error_r not defined". This was added by commit
c3cec9e68f ("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.

Reported-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Cc: linux trace devel <linux-trace-devel@vger.kernel.org>
Link: http://lkml.kernel.org/r/20181005121816.484e654f@gandalf.local.home
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-10-08 14:30:45 -03:00
..
.gitignore tools lib traceevent: Ignore generated library files 2016-08-02 12:16:13 -03:00
Build tools lib traceevent: Separate out tep_strerror() for strerror_r() issues 2018-10-08 14:30:45 -03:00
event-parse.c tools lib traceevent: Separate out tep_strerror() for strerror_r() issues 2018-10-08 14:30:45 -03:00
event-parse.h tools lib traceevent: Add prefix tep_ to enum filter_trivial_type 2018-09-19 17:30:46 -03:00
event-plugin.c tools lib traceevent: Rename struct plugin_list to struct tep_plugin_list 2018-09-19 17:29:26 -03:00
event-utils.h tools lib traceevent: Change to SPDX License format 2018-08-20 08:54:58 -03:00
kbuffer-parse.c tools lib traceevent: Change to SPDX License format 2018-08-20 08:54:58 -03:00
kbuffer.h tools lib traceevent: Add way to find sub buffer boundary 2015-03-24 12:22:09 -03:00
Makefile tools lib traceevent, tools lib lockdep: Rename 'enum pevent_errno' to 'enum tep_errno' 2018-08-13 15:23:07 -03:00
parse-filter.c tools lib traceevent: Add prefix tep_ to enum filter_trivial_type 2018-09-19 17:30:46 -03:00
parse-utils.c tools lib traceevent: Change to SPDX License format 2018-08-20 08:54:58 -03:00
plugin_cfg80211.c tools lib traceevent: Rename pevent_register / unregister APIs 2018-08-13 15:27:35 -03:00
plugin_function.c tools lib traceevent, perf tools: Rename struct event_format to struct tep_event_format 2018-09-19 17:11:50 -03:00
plugin_hrtimer.c tools lib traceevent, perf tools: Rename struct event_format to struct tep_event_format 2018-09-19 17:11:50 -03:00
plugin_jbd2.c tools lib traceevent, perf tools: Split trace-seq related APIs in a separate header file 2018-08-30 15:52:20 -03:00
plugin_kmem.c tools lib traceevent, perf tools: Rename struct format{_field} to struct tep_format{_field} 2018-09-19 17:13:15 -03:00
plugin_kvm.c tools lib traceevent, perf tools: Rename struct event_format to struct tep_event_format 2018-09-19 17:11:50 -03:00
plugin_mac80211.c tools lib traceevent, perf tools: Rename struct format{_field} to struct tep_format{_field} 2018-09-19 17:13:15 -03:00
plugin_sched_switch.c tools lib traceevent, perf tools: Rename struct format{_field} to struct tep_format{_field} 2018-09-19 17:13:15 -03:00
plugin_scsi.c tools lib traceevent, perf tools: Split trace-seq related APIs in a separate header file 2018-08-30 15:52:20 -03:00
plugin_xen.c tools lib traceevent, perf tools: Split trace-seq related APIs in a separate header file 2018-08-30 15:52:20 -03:00
tep_strerror.c tools lib traceevent: Separate out tep_strerror() for strerror_r() issues 2018-10-08 14:30:45 -03:00
trace-seq.c tools lib traceevent, perf tools: Split trace-seq related APIs in a separate header file 2018-08-30 15:52:20 -03:00
trace-seq.h tools lib traceevent, perf tools: Split trace-seq related APIs in a separate header file 2018-08-30 15:52:20 -03:00