linux/tools/perf
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
..
arch perf event: Remove needless include directives from event.h 2019-08-31 22:19:24 -03:00
bench perf tools: Remove perf.h from source files not needing it 2019-08-29 17:38:32 -03:00
Documentation perf report: Add --switch-on/--switch-off events 2019-08-16 12:14:33 -03:00
examples/bpf perf augmented_raw_syscalls: Reduce perf_event_output() boilerplate 2019-08-26 11:58:29 -03:00
include/bpf perf include bpf: Add bpf_tail_call() prototype 2019-07-29 18:34:40 -03:00
jvmti tools build: Check if gettid() is available before providing helper 2019-07-07 17:53:09 -03:00
lib libperf: Warn when exceeding MAX_NR_CPUS in cpumap 2019-08-29 17:38:32 -03:00
pmu-events perf vendor events intel: Add Tremontx event file v1.02 2019-08-15 12:04:04 -03:00
python treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 407 2019-06-05 17:37:14 +02:00
scripts perf tools: Remove perf.h from source files not needing it 2019-08-29 17:38:32 -03:00
tests perf env: Remove env.h from other headers where just a fwd decl is needed 2019-08-31 19:10:40 -03:00
trace perf trace beauty ioctl: Fix off-by-one error in cmd->string table 2019-08-26 11:58:29 -03:00
ui perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
util libtraceevent, perf tools: Changes in tep_print_event_* APIs 2019-08-31 22:19:28 -03:00
.gitignore
Build perf tools: Rename build libperf to perf 2019-02-14 15:18:08 -03:00
builtin-annotate.c perf evsel: Rename struct perf_evsel to struct evsel 2019-07-29 18:34:42 -03:00
builtin-bench.c perf tools: Remove perf.h from source files not needing it 2019-08-29 17:38:32 -03:00
builtin-buildid-cache.c perf tools: Remove perf.h from source files not needing it 2019-08-29 17:38:32 -03:00
builtin-buildid-list.c perf tools: Remove perf.h from source files not needing it 2019-08-29 17:38:32 -03:00
builtin-c2c.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
builtin-config.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
builtin-data.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
builtin-diff.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
builtin-evlist.c libperf: Move perf_event_attr field from perf's evsel to libperf's perf_evsel 2019-07-29 18:34:45 -03:00
builtin-ftrace.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
builtin-help.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
builtin-inject.c perf tools: Remove perf.h from source files not needing it 2019-08-29 17:38:32 -03:00
builtin-kallsyms.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 251 2019-06-05 17:30:26 +02:00
builtin-kmem.c libtraceevent, perf tools: Changes in tep_print_event_* APIs 2019-08-31 22:19:28 -03:00
builtin-kvm.c libperf: Add threads to struct perf_evlist 2019-07-29 18:34:45 -03:00
builtin-list.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
builtin-lock.c perf evsel: Rename struct perf_evsel to struct evsel 2019-07-29 18:34:42 -03:00
builtin-mem.c perf evsel: Rename struct perf_evsel to struct evsel 2019-07-29 18:34:42 -03:00
builtin-probe.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
builtin-record.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
builtin-report.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
builtin-sched.c perf tools: Move everything related to sys_perf_event_open() to perf-sys.h 2019-08-29 17:38:32 -03:00
builtin-script.c perf tools: Remove needless perf.h include directive from headers 2019-08-29 17:38:32 -03:00
builtin-stat.c perf tools: Remove needless perf.h include directive from headers 2019-08-29 17:38:32 -03:00
builtin-timechart.c perf tools: Remove needless libtraceevent include directives 2019-08-29 17:38:32 -03:00
builtin-top.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
builtin-trace.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
builtin-version.c perf version: Fix segfault due to missing OPT_END() 2019-07-15 07:59:05 -03:00
builtin.h perf tools: Remove needless util.h include from builtin.h 2019-08-28 17:19:34 -03:00
check-headers.sh tools headers: Grab copy of linux/const.h, needed by linux/bits.h 2019-08-20 12:08:23 -03:00
command-list.txt perf help: Add missing subcommand version 2018-09-19 14:53:36 -03:00
CREDITS
design.txt perf/doc: Update design.txt for exclude_{host|guest} flags 2019-01-21 11:01:18 +01:00
Makefile perf tools: Disable parallelism for 'make clean' 2018-08-20 08:54:58 -03:00
Makefile.config perf tools: tools/include should come before tools/uapi/include 2019-08-20 12:07:22 -03:00
Makefile.perf tools build: Add capability-related feature detection 2019-08-12 17:14:14 -03:00
MANIFEST tools lib: Adopt zalloc()/zfree() from tools/perf 2019-07-09 10:13:26 -03:00
perf-archive.sh
perf-completion.sh
perf-read-vdso.c perf tools: Make find_vdso_map() more modular 2019-01-08 13:28:13 -03:00
perf-sys.h perf tools: Move everything related to sys_perf_event_open() to perf-sys.h 2019-08-29 17:38:32 -03:00
perf-with-kcore.sh Merge branch 'x86/cpu' into perf/core, to pick up dependent changes 2019-06-17 12:29:16 +02:00
perf.c perf event: Remove needless include directives from event.h 2019-08-31 22:19:24 -03:00
perf.h perf time-utils: Adopt rdclock() from perf.h 2019-08-29 17:38:32 -03:00