Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tzvetomir Stoyanov and committed by
Arnaldo Carvalho de Melo
38847db9 4cb3c6d5

+215 -212
-40
tools/lib/traceevent/event-parse-api.c
··· 303 303 } 304 304 305 305 /** 306 - * tep_is_latency_format - get if the latency output format is configured 307 - * @tep: a handle to the tep_handle 308 - * 309 - * This returns true if the latency output format is configured 310 - * If @tep is NULL, false is returned. 311 - */ 312 - bool tep_is_latency_format(struct tep_handle *tep) 313 - { 314 - if (tep) 315 - return (tep->latency_format); 316 - return false; 317 - } 318 - 319 - /** 320 - * tep_set_latency_format - set the latency output format 321 - * @tep: a handle to the tep_handle 322 - * @lat: non zero for latency output format 323 - * 324 - * This sets the latency output format 325 - */ 326 - void tep_set_latency_format(struct tep_handle *tep, int lat) 327 - { 328 - if (tep) 329 - tep->latency_format = lat; 330 - } 331 - 332 - /** 333 306 * tep_is_old_format - get if an old kernel is used 334 307 * @tep: a handle to the tep_handle 335 308 * ··· 315 342 if (tep) 316 343 return tep->old_format; 317 344 return false; 318 - } 319 - 320 - /** 321 - * tep_set_print_raw - set a flag to force print in raw format 322 - * @tep: a handle to the tep_handle 323 - * @print_raw: the new value of the print_raw flag 324 - * 325 - * This sets a flag to force print in raw format 326 - */ 327 - void tep_set_print_raw(struct tep_handle *tep, int print_raw) 328 - { 329 - if (tep) 330 - tep->print_raw = print_raw; 331 345 } 332 346 333 347 /**
-4
tools/lib/traceevent/event-parse-local.h
··· 28 28 enum tep_endian file_bigendian; 29 29 enum tep_endian host_bigendian; 30 30 31 - int latency_format; 32 - 33 31 int old_format; 34 32 35 33 int cpus; ··· 67 69 68 70 int ld_offset; 69 71 int ld_size; 70 - 71 - int print_raw; 72 72 73 73 int test_filters; 74 74
+199 -147
tools/lib/traceevent/event-parse.c
··· 5212 5212 } 5213 5213 } 5214 5214 5215 - /** 5216 - * tep_data_latency_format - parse the data for the latency format 5217 - * @tep: a handle to the trace event parser context 5218 - * @s: the trace_seq to write to 5219 - * @record: the record to read from 5220 - * 5215 + /* 5221 5216 * This parses out the Latency format (interrupts disabled, 5222 5217 * need rescheduling, in hard/soft interrupt, preempt count 5223 5218 * and lock depth) and places it into the trace_seq. 5224 5219 */ 5225 - void tep_data_latency_format(struct tep_handle *tep, 5226 - struct trace_seq *s, struct tep_record *record) 5220 + static void data_latency_format(struct tep_handle *tep, struct trace_seq *s, 5221 + char *format, struct tep_record *record) 5227 5222 { 5228 5223 static int check_lock_depth = 1; 5229 5224 static int check_migrate_disable = 1; 5230 5225 static int lock_depth_exists; 5231 5226 static int migrate_disable_exists; 5232 5227 unsigned int lat_flags; 5228 + struct trace_seq sq; 5233 5229 unsigned int pc; 5234 5230 int lock_depth = 0; 5235 5231 int migrate_disable = 0; ··· 5233 5237 int softirq; 5234 5238 void *data = record->data; 5235 5239 5240 + trace_seq_init(&sq); 5236 5241 lat_flags = parse_common_flags(tep, data); 5237 5242 pc = parse_common_pc(tep, data); 5238 5243 /* lock_depth may not always exist */ ··· 5261 5264 hardirq = lat_flags & TRACE_FLAG_HARDIRQ; 5262 5265 softirq = lat_flags & TRACE_FLAG_SOFTIRQ; 5263 5266 5264 - trace_seq_printf(s, "%c%c%c", 5267 + trace_seq_printf(&sq, "%c%c%c", 5265 5268 (lat_flags & TRACE_FLAG_IRQS_OFF) ? 'd' : 5266 5269 (lat_flags & TRACE_FLAG_IRQS_NOSUPPORT) ? 5267 5270 'X' : '.', ··· 5271 5274 hardirq ? 'h' : softirq ? 's' : '.'); 5272 5275 5273 5276 if (pc) 5274 - trace_seq_printf(s, "%x", pc); 5277 + trace_seq_printf(&sq, "%x", pc); 5275 5278 else 5276 - trace_seq_putc(s, '.'); 5279 + trace_seq_printf(&sq, "."); 5277 5280 5278 5281 if (migrate_disable_exists) { 5279 5282 if (migrate_disable < 0) 5280 - trace_seq_putc(s, '.'); 5283 + trace_seq_printf(&sq, "."); 5281 5284 else 5282 - trace_seq_printf(s, "%d", migrate_disable); 5285 + trace_seq_printf(&sq, "%d", migrate_disable); 5283 5286 } 5284 5287 5285 5288 if (lock_depth_exists) { 5286 5289 if (lock_depth < 0) 5287 - trace_seq_putc(s, '.'); 5290 + trace_seq_printf(&sq, "."); 5288 5291 else 5289 - trace_seq_printf(s, "%d", lock_depth); 5292 + trace_seq_printf(&sq, "%d", lock_depth); 5290 5293 } 5291 5294 5295 + if (sq.state == TRACE_SEQ__MEM_ALLOC_FAILED) { 5296 + s->state = TRACE_SEQ__MEM_ALLOC_FAILED; 5297 + return; 5298 + } 5299 + 5300 + trace_seq_terminate(&sq); 5301 + trace_seq_puts(s, sq.buffer); 5302 + trace_seq_destroy(&sq); 5292 5303 trace_seq_terminate(s); 5293 5304 } 5294 5305 ··· 5457 5452 return cmdline->pid; 5458 5453 } 5459 5454 5460 - /** 5461 - * tep_event_info - parse the data into the print format 5462 - * @s: the trace_seq to write to 5463 - * @event: the handle to the event 5464 - * @record: the record to read from 5465 - * 5455 + /* 5466 5456 * This parses the raw @data using the given @event information and 5467 5457 * writes the print format into the trace_seq. 5468 5458 */ 5469 - void tep_event_info(struct trace_seq *s, struct tep_event *event, 5470 - struct tep_record *record) 5459 + static void print_event_info(struct trace_seq *s, char *format, bool raw, 5460 + struct tep_event *event, struct tep_record *record) 5471 5461 { 5472 5462 int print_pretty = 1; 5473 5463 5474 - if (event->tep->print_raw || (event->flags & TEP_EVENT_FL_PRINTRAW)) 5464 + if (raw || (event->flags & TEP_EVENT_FL_PRINTRAW)) 5475 5465 tep_print_fields(s, record->data, record->size, event); 5476 5466 else { 5477 5467 ··· 5479 5479 } 5480 5480 5481 5481 trace_seq_terminate(s); 5482 - } 5483 - 5484 - static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock) 5485 - { 5486 - if (!trace_clock || !use_trace_clock) 5487 - return true; 5488 - 5489 - if (!strcmp(trace_clock, "local") || !strcmp(trace_clock, "global") 5490 - || !strcmp(trace_clock, "uptime") || !strcmp(trace_clock, "perf") 5491 - || !strncmp(trace_clock, "mono", 4)) 5492 - return true; 5493 - 5494 - /* trace_clock is setting in tsc or counter mode */ 5495 - return false; 5496 5482 } 5497 5483 5498 5484 /** ··· 5504 5518 return tep_find_event(tep, type); 5505 5519 } 5506 5520 5507 - /** 5508 - * tep_print_event_task - Write the event task comm, pid and CPU 5509 - * @tep: a handle to the trace event parser context 5510 - * @s: the trace_seq to write to 5511 - * @event: the handle to the record's event 5512 - * @record: The record to get the event from 5513 - * 5514 - * Writes the tasks comm, pid and CPU to @s. 5521 + /* 5522 + * Writes the timestamp of the record into @s. Time divisor and precision can be 5523 + * specified as part of printf @format string. Example: 5524 + * "%3.1000d" - divide the time by 1000 and print the first 3 digits 5525 + * before the dot. Thus, the timestamp "123456000" will be printed as 5526 + * "123.456" 5515 5527 */ 5516 - void tep_print_event_task(struct tep_handle *tep, struct trace_seq *s, 5517 - struct tep_event *event, 5518 - struct tep_record *record) 5528 + static void print_event_time(struct tep_handle *tep, struct trace_seq *s, 5529 + char *format, struct tep_event *event, 5530 + struct tep_record *record) 5519 5531 { 5520 - void *data = record->data; 5532 + unsigned long long time; 5533 + char *divstr; 5534 + int prec = 0, pr; 5535 + int div = 0; 5536 + int p10 = 1; 5537 + 5538 + if (isdigit(*(format + 1))) 5539 + prec = atoi(format + 1); 5540 + divstr = strchr(format, '.'); 5541 + if (divstr && isdigit(*(divstr + 1))) 5542 + div = atoi(divstr + 1); 5543 + time = record->ts; 5544 + if (div) 5545 + time /= div; 5546 + pr = prec; 5547 + while (pr--) 5548 + p10 *= 10; 5549 + 5550 + if (p10 > 1 && p10 < time) 5551 + trace_seq_printf(s, "%5llu.%0*llu", time / p10, prec, time % p10); 5552 + else 5553 + trace_seq_printf(s, "%12llu\n", time); 5554 + } 5555 + 5556 + struct print_event_type { 5557 + enum { 5558 + EVENT_TYPE_INT = 1, 5559 + EVENT_TYPE_STRING, 5560 + EVENT_TYPE_UNKNOWN, 5561 + } type; 5562 + char format[32]; 5563 + }; 5564 + 5565 + static void print_string(struct tep_handle *tep, struct trace_seq *s, 5566 + struct tep_record *record, struct tep_event *event, 5567 + const char *arg, struct print_event_type *type) 5568 + { 5521 5569 const char *comm; 5522 5570 int pid; 5523 5571 5524 - pid = parse_common_pid(tep, data); 5525 - comm = find_cmdline(tep, pid); 5526 - 5527 - if (tep->latency_format) 5528 - trace_seq_printf(s, "%8.8s-%-5d %3d", comm, pid, record->cpu); 5529 - else 5530 - trace_seq_printf(s, "%16s-%-5d [%03d]", comm, pid, record->cpu); 5531 - } 5532 - 5533 - /** 5534 - * tep_print_event_time - Write the event timestamp 5535 - * @tep: a handle to the trace event parser context 5536 - * @s: the trace_seq to write to 5537 - * @event: the handle to the record's event 5538 - * @record: The record to get the event from 5539 - * @use_trace_clock: Set to parse according to the @tep->trace_clock 5540 - * 5541 - * Writes the timestamp of the record into @s. 5542 - */ 5543 - void tep_print_event_time(struct tep_handle *tep, struct trace_seq *s, 5544 - struct tep_event *event, 5545 - struct tep_record *record, 5546 - bool use_trace_clock) 5547 - { 5548 - unsigned long secs; 5549 - unsigned long usecs; 5550 - unsigned long nsecs; 5551 - int p; 5552 - bool use_usec_format; 5553 - 5554 - use_usec_format = is_timestamp_in_us(tep->trace_clock, use_trace_clock); 5555 - if (use_usec_format) { 5556 - secs = record->ts / NSEC_PER_SEC; 5557 - nsecs = record->ts - secs * NSEC_PER_SEC; 5572 + if (strncmp(arg, TEP_PRINT_LATENCY, strlen(TEP_PRINT_LATENCY)) == 0) { 5573 + data_latency_format(tep, s, type->format, record); 5574 + } else if (strncmp(arg, TEP_PRINT_COMM, strlen(TEP_PRINT_COMM)) == 0) { 5575 + pid = parse_common_pid(tep, record->data); 5576 + comm = find_cmdline(tep, pid); 5577 + trace_seq_printf(s, type->format, comm); 5578 + } else if (strncmp(arg, TEP_PRINT_INFO_RAW, strlen(TEP_PRINT_INFO_RAW)) == 0) { 5579 + print_event_info(s, type->format, true, event, record); 5580 + } else if (strncmp(arg, TEP_PRINT_INFO, strlen(TEP_PRINT_INFO)) == 0) { 5581 + print_event_info(s, type->format, false, event, record); 5582 + } else if (strncmp(arg, TEP_PRINT_NAME, strlen(TEP_PRINT_NAME)) == 0) { 5583 + trace_seq_printf(s, type->format, event->name); 5584 + } else { 5585 + trace_seq_printf(s, "[UNKNOWN TEP TYPE %s]", arg); 5558 5586 } 5559 5587 5560 - if (tep->latency_format) { 5561 - tep_data_latency_format(tep, s, record); 5562 - } 5563 - 5564 - if (use_usec_format) { 5565 - if (tep->flags & TEP_NSEC_OUTPUT) { 5566 - usecs = nsecs; 5567 - p = 9; 5568 - } else { 5569 - usecs = (nsecs + 500) / NSEC_PER_USEC; 5570 - /* To avoid usecs larger than 1 sec */ 5571 - if (usecs >= USEC_PER_SEC) { 5572 - usecs -= USEC_PER_SEC; 5573 - secs++; 5574 - } 5575 - p = 6; 5576 - } 5577 - 5578 - trace_seq_printf(s, " %5lu.%0*lu:", secs, p, usecs); 5579 - } else 5580 - trace_seq_printf(s, " %12llu:", record->ts); 5581 5588 } 5582 5589 5583 - /** 5584 - * tep_print_event_data - Write the event data section 5585 - * @tep: a handle to the trace event parser context 5586 - * @s: the trace_seq to write to 5587 - * @event: the handle to the record's event 5588 - * @record: The record to get the event from 5589 - * 5590 - * Writes the parsing of the record's data to @s. 5591 - */ 5592 - void tep_print_event_data(struct tep_handle *tep, struct trace_seq *s, 5593 - struct tep_event *event, 5594 - struct tep_record *record) 5590 + static void print_int(struct tep_handle *tep, struct trace_seq *s, 5591 + struct tep_record *record, struct tep_event *event, 5592 + int arg, struct print_event_type *type) 5595 5593 { 5596 - static const char *spaces = " "; /* 20 spaces */ 5597 - int len; 5594 + int param; 5598 5595 5599 - trace_seq_printf(s, " %s: ", event->name); 5600 - 5601 - /* Space out the event names evenly. */ 5602 - len = strlen(event->name); 5603 - if (len < 20) 5604 - trace_seq_printf(s, "%.*s", 20 - len, spaces); 5605 - 5606 - tep_event_info(s, event, record); 5607 - } 5608 - 5609 - void tep_print_event(struct tep_handle *tep, struct trace_seq *s, 5610 - struct tep_record *record, bool use_trace_clock) 5611 - { 5612 - struct tep_event *event; 5613 - 5614 - event = tep_find_event_by_record(tep, record); 5615 - if (!event) { 5616 - int i; 5617 - int type = trace_parse_common_type(tep, record->data); 5618 - 5619 - do_warning("ug! no event found for type %d", type); 5620 - trace_seq_printf(s, "[UNKNOWN TYPE %d]", type); 5621 - for (i = 0; i < record->size; i++) 5622 - trace_seq_printf(s, " %02x", 5623 - ((unsigned char *)record->data)[i]); 5596 + switch (arg) { 5597 + case TEP_PRINT_CPU: 5598 + param = record->cpu; 5599 + break; 5600 + case TEP_PRINT_PID: 5601 + param = parse_common_pid(tep, record->data); 5602 + break; 5603 + case TEP_PRINT_TIME: 5604 + return print_event_time(tep, s, type->format, event, record); 5605 + default: 5624 5606 return; 5625 5607 } 5608 + trace_seq_printf(s, type->format, param); 5609 + } 5626 5610 5627 - tep_print_event_task(tep, s, event, record); 5628 - tep_print_event_time(tep, s, event, record, use_trace_clock); 5629 - tep_print_event_data(tep, s, event, record); 5611 + static int tep_print_event_param_type(char *format, 5612 + struct print_event_type *type) 5613 + { 5614 + char *str = format + 1; 5615 + int i = 1; 5616 + 5617 + type->type = EVENT_TYPE_UNKNOWN; 5618 + while (*str) { 5619 + switch (*str) { 5620 + case 'd': 5621 + case 'u': 5622 + case 'i': 5623 + case 'x': 5624 + case 'X': 5625 + case 'o': 5626 + type->type = EVENT_TYPE_INT; 5627 + break; 5628 + case 's': 5629 + type->type = EVENT_TYPE_STRING; 5630 + break; 5631 + } 5632 + str++; 5633 + i++; 5634 + if (type->type != EVENT_TYPE_UNKNOWN) 5635 + break; 5636 + } 5637 + memset(type->format, 0, 32); 5638 + memcpy(type->format, format, i < 32 ? i : 31); 5639 + return i; 5640 + } 5641 + 5642 + /** 5643 + * tep_print_event - Write various event information 5644 + * @tep: a handle to the trace event parser context 5645 + * @s: the trace_seq to write to 5646 + * @record: The record to get the event from 5647 + * @format: a printf format string. Supported event fileds: 5648 + * TEP_PRINT_PID, "%d" - event PID 5649 + * TEP_PRINT_CPU, "%d" - event CPU 5650 + * TEP_PRINT_COMM, "%s" - event command string 5651 + * TEP_PRINT_NAME, "%s" - event name 5652 + * TEP_PRINT_LATENCY, "%s" - event latency 5653 + * TEP_PRINT_TIME, %d - event time stamp. A divisor and precision 5654 + * can be specified as part of this format string: 5655 + * "%precision.divisord". Example: 5656 + * "%3.1000d" - divide the time by 1000 and print the first 5657 + * 3 digits before the dot. Thus, the time stamp 5658 + * "123456000" will be printed as "123.456" 5659 + * TEP_PRINT_INFO, "%s" - event information. If any width is specified in 5660 + * the format string, the event information will be printed 5661 + * in raw format. 5662 + * Writes the specified event information into @s. 5663 + */ 5664 + void tep_print_event(struct tep_handle *tep, struct trace_seq *s, 5665 + struct tep_record *record, const char *fmt, ...) 5666 + { 5667 + struct print_event_type type; 5668 + char *format = strdup(fmt); 5669 + char *current = format; 5670 + char *str = format; 5671 + int offset; 5672 + va_list args; 5673 + struct tep_event *event; 5674 + 5675 + if (!format) 5676 + return; 5677 + 5678 + event = tep_find_event_by_record(tep, record); 5679 + va_start(args, fmt); 5680 + while (*current) { 5681 + current = strchr(str, '%'); 5682 + if (!current) { 5683 + trace_seq_puts(s, str); 5684 + break; 5685 + } 5686 + memset(&type, 0, sizeof(type)); 5687 + offset = tep_print_event_param_type(current, &type); 5688 + *current = '\0'; 5689 + trace_seq_puts(s, str); 5690 + current += offset; 5691 + switch (type.type) { 5692 + case EVENT_TYPE_STRING: 5693 + print_string(tep, s, record, event, 5694 + va_arg(args, char*), &type); 5695 + break; 5696 + case EVENT_TYPE_INT: 5697 + print_int(tep, s, record, event, 5698 + va_arg(args, int), &type); 5699 + break; 5700 + case EVENT_TYPE_UNKNOWN: 5701 + default: 5702 + trace_seq_printf(s, "[UNKNOWN TYPE]"); 5703 + break; 5704 + } 5705 + str = current; 5706 + 5707 + } 5708 + va_end(args); 5709 + free(format); 5630 5710 } 5631 5711 5632 5712 static int events_id_cmp(const void *a, const void *b)
+11 -18
tools/lib/traceevent/event-parse.h
··· 442 442 unsigned long long addr); 443 443 bool tep_is_pid_registered(struct tep_handle *tep, int pid); 444 444 445 - void tep_print_event_task(struct tep_handle *tep, struct trace_seq *s, 446 - struct tep_event *event, 447 - struct tep_record *record); 448 - void tep_print_event_time(struct tep_handle *tep, struct trace_seq *s, 449 - struct tep_event *event, 450 - struct tep_record *record, 451 - bool use_trace_clock); 452 - void tep_print_event_data(struct tep_handle *tep, struct trace_seq *s, 453 - struct tep_event *event, 454 - struct tep_record *record); 445 + #define TEP_PRINT_INFO "INFO" 446 + #define TEP_PRINT_INFO_RAW "INFO_RAW" 447 + #define TEP_PRINT_COMM "COMM" 448 + #define TEP_PRINT_LATENCY "LATENCY" 449 + #define TEP_PRINT_NAME "NAME" 450 + #define TEP_PRINT_PID 1U 451 + #define TEP_PRINT_TIME 2U 452 + #define TEP_PRINT_CPU 3U 453 + 455 454 void tep_print_event(struct tep_handle *tep, struct trace_seq *s, 456 - struct tep_record *record, bool use_trace_clock); 455 + struct tep_record *record, const char *fmt, ...) 456 + __attribute__ ((format (printf, 4, 5))); 457 457 458 458 int tep_parse_header_page(struct tep_handle *tep, char *buf, unsigned long size, 459 459 int long_size); ··· 525 525 struct tep_event * 526 526 tep_find_event_by_record(struct tep_handle *tep, struct tep_record *record); 527 527 528 - void tep_data_latency_format(struct tep_handle *tep, 529 - struct trace_seq *s, struct tep_record *record); 530 528 int tep_data_type(struct tep_handle *tep, struct tep_record *rec); 531 529 int tep_data_pid(struct tep_handle *tep, struct tep_record *rec); 532 530 int tep_data_preempt_count(struct tep_handle *tep, struct tep_record *rec); ··· 539 541 struct tep_format_field *field); 540 542 void tep_print_fields(struct trace_seq *s, void *data, 541 543 int size __maybe_unused, struct tep_event *event); 542 - void tep_event_info(struct trace_seq *s, struct tep_event *event, 543 - struct tep_record *record); 544 544 int tep_strerror(struct tep_handle *tep, enum tep_errno errnum, 545 545 char *buf, size_t buflen); 546 546 ··· 562 566 void tep_set_file_bigendian(struct tep_handle *tep, enum tep_endian endian); 563 567 bool tep_is_local_bigendian(struct tep_handle *tep); 564 568 void tep_set_local_bigendian(struct tep_handle *tep, enum tep_endian endian); 565 - bool tep_is_latency_format(struct tep_handle *tep); 566 - void tep_set_latency_format(struct tep_handle *tep, int lat); 567 569 int tep_get_header_page_size(struct tep_handle *tep); 568 570 int tep_get_header_timestamp_size(struct tep_handle *tep); 569 571 bool tep_is_old_format(struct tep_handle *tep); 570 - void tep_set_print_raw(struct tep_handle *tep, int print_raw); 571 572 void tep_set_test_filters(struct tep_handle *tep, int test_filters); 572 573 573 574 struct tep_handle *tep_alloc(void);
+2 -1
tools/perf/builtin-kmem.c
··· 750 750 } 751 751 752 752 trace_seq_init(&seq); 753 - tep_event_info(&seq, evsel->tp_format, &record); 753 + tep_print_event(evsel->tp_format->tep, 754 + &seq, &record, "%s", TEP_PRINT_INFO); 754 755 755 756 str = strtok_r(seq.buffer, " ", &pos); 756 757 while (str) {
+2 -1
tools/perf/util/sort.c
··· 709 709 tep_print_fields(&seq, he->raw_data, he->raw_size, 710 710 evsel->tp_format); 711 711 } else { 712 - tep_event_info(&seq, evsel->tp_format, &rec); 712 + tep_print_event(evsel->tp_format->tep, 713 + &seq, &rec, "%s", TEP_PRINT_INFO); 713 714 } 714 715 /* 715 716 * Trim the buffer, it starts at 4KB and we're not going to
+1 -1
tools/perf/util/trace-event-parse.c
··· 109 109 record.data = data; 110 110 111 111 trace_seq_init(&s); 112 - tep_event_info(&s, event, &record); 112 + tep_print_event(event->tep, &s, &record, "%s", TEP_PRINT_INFO); 113 113 trace_seq_do_fprintf(&s, fp); 114 114 trace_seq_destroy(&s); 115 115 }