linux/tools/lib/traceevent
Tzvetomir Stoyanov 38847db974 libtraceevent, perf tools: Changes in tep_print_event_* APIs
Libtraceevent APIs for printing various trace events information are
complicated, there are complex extra parameters. To control the way
event information is printed, the user should call a set of functions in
a specific sequence.

These APIs are reimplemented to provide a more simple interface for
printing event information.

Removed APIs:

 	tep_print_event_task()
	tep_print_event_time()
	tep_print_event_data()
	tep_event_info()
	tep_is_latency_format()
	tep_set_latency_format()
	tep_data_latency_format()
	tep_set_print_raw()

A new API for printing event information is introduced:
   void tep_print_event(struct tep_handle *tep, struct trace_seq *s,
		        struct tep_record *record, const char *fmt, ...);
where "fmt" is a printf-like format string, followed by the event
fields to be printed. Supported fields:
 TEP_PRINT_PID, "%d" - event PID
 TEP_PRINT_CPU, "%d" - event CPU
 TEP_PRINT_COMM, "%s" - event command string
 TEP_PRINT_NAME, "%s" - event name
 TEP_PRINT_LATENCY, "%s" - event latency
 TEP_PRINT_TIME, %d - event time stamp. A divisor and precision
   can be specified as part of this format string:
   "%precision.divisord". Example:
   "%3.1000d" - divide the time by 1000 and print the first 3 digits
   before the dot. Thus, the time stamp "123456000" will be printed as
   "123.456"
 TEP_PRINT_INFO, "%s" - event information.
 TEP_PRINT_INFO_RAW, "%s" - event information, in raw format.

Example:
  tep_print_event(tep, s, record, "%16s-%-5d [%03d] %s %6.1000d %s %s",
		  TEP_PRINT_COMM, TEP_PRINT_PID, TEP_PRINT_CPU,
		  TEP_PRINT_LATENCY, TEP_PRINT_TIME, TEP_PRINT_NAME, TEP_PRINT_INFO);
Output:
	ls-11314 [005] d.h. 185207.366383 function __wake_up

Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: linux-trace-devel@vger.kernel.org
Cc: Patrick McLean <chutzpah@gentoo.org>
Link: http://lore.kernel.org/linux-trace-devel/20190801074959.22023-2-tz.stoyanov@gmail.com
Link: http://lore.kernel.org/lkml/20190805204355.041132030@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-08-31 22:19:28 -03:00
..
Documentation tools lib traceevent: Man pages for trace sequences APIs 2019-05-15 16:36:48 -03:00
.gitignore tools lib traceevent: Ignore generated library files 2016-08-02 12:16:13 -03:00
Build tools lib traceevent, perf tools: Move struct tep_handler definition in a local header file 2018-10-08 15:05:37 -03:00
event-parse-api.c libtraceevent, perf tools: Changes in tep_print_event_* APIs 2019-08-31 22:19:28 -03:00
event-parse-local.h libtraceevent, perf tools: Changes in tep_print_event_* APIs 2019-08-31 22:19:28 -03:00
event-parse.c libtraceevent, perf tools: Changes in tep_print_event_* APIs 2019-08-31 22:19:28 -03:00
event-parse.h libtraceevent, perf tools: Changes in tep_print_event_* APIs 2019-08-31 22:19:28 -03:00
event-plugin.c tools lib traceevent: Rename input arguments and local variables of libtraceevent from pevent to tep 2019-04-01 15:18:10 -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: Add more debugging to see various internal ring buffer entries 2019-04-01 15:18:09 -03:00
kbuffer.h tools lib traceevent: Add more debugging to see various internal ring buffer entries 2019-04-01 15:18:09 -03:00
libtraceevent.pc.template tools lib traceevent: Remove hard coded install paths from pkg-config file 2019-05-15 16:36:46 -03:00
Makefile tools lib traceevent: Fix "robust" test of do_generate_dynamic_list_file 2019-08-20 12:18:54 -03:00
parse-filter.c tools lib traceevent: Rename input arguments and local variables of libtraceevent from pevent to tep 2019-04-01 15:18:10 -03:00
parse-utils.c tools lib traceevent: Change tag string for error 2019-05-02 16:00:19 -04:00
plugin_cfg80211.c tools lib traceevent: Rename input arguments of libtraceevent APIs from pevent to tep 2019-04-01 15:18:09 -03:00
plugin_function.c tools lib traceevent: Rename input arguments and local variables of libtraceevent from pevent to tep 2019-04-01 15:18:10 -03:00
plugin_hrtimer.c tools lib traceevent: Rename input arguments of libtraceevent APIs from pevent to tep 2019-04-01 15:18:09 -03:00
plugin_jbd2.c tools lib traceevent: Rename input arguments of libtraceevent APIs from pevent to tep 2019-04-01 15:18:09 -03:00
plugin_kmem.c perf tools, tools lib traceevent: Rename "pevent" member of struct tep_event to "tep" 2019-04-01 15:18:10 -03:00
plugin_kvm.c perf tools, tools lib traceevent: Rename "pevent" member of struct tep_event to "tep" 2019-04-01 15:18:10 -03:00
plugin_mac80211.c tools lib traceevent: Rename input arguments of libtraceevent APIs from pevent to tep 2019-04-01 15:18:09 -03:00
plugin_sched_switch.c perf tools, tools lib traceevent: Rename "pevent" member of struct tep_event to "tep" 2019-04-01 15:18:10 -03:00
plugin_scsi.c tools lib traceevent: Rename input arguments of libtraceevent APIs from pevent to tep 2019-04-01 15:18:09 -03:00
plugin_xen.c tools lib traceevent: Rename input arguments of libtraceevent APIs from pevent to tep 2019-04-01 15:18:09 -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: Changed return logic of trace_seq_printf() and trace_seq_vprintf() APIs 2019-01-08 13:28:13 -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