Lines Matching refs:format

742  * @fmt: the string format to register
1597 * the format: type [] item;
1724 if (read_expected_item(TEP_EVENT_ITEM, "format") < 0)
1734 ret = event_read_fields(event, &event->format.common_fields);
1737 event->format.nr_common = ret;
1739 ret = event_read_fields(event, &event->format.fields);
1742 event->format.nr_fields = ret;
3321 event->print_fmt.format = token;
3334 if (asprintf(&cat, "%s%s", event->print_fmt.format, token) < 0)
3337 free_token(event->print_fmt.format);
3338 event->print_fmt.format = NULL;
3370 struct tep_format_field *format;
3372 for (format = event->format.common_fields;
3373 format; format = format->next) {
3374 if (strcmp(format->name, name) == 0)
3378 return format;
3392 struct tep_format_field *format;
3394 for (format = event->format.fields;
3395 format; format = format->next) {
3396 if (strcmp(format->name, name) == 0)
3400 return format;
3415 struct tep_format_field *format;
3417 format = tep_find_common_field(event, name);
3418 if (format)
3419 return format;
3895 * Some flags in the format files do not get converted.
3909 static void print_str_to_seq(struct trace_seq *s, const char *format,
3913 trace_seq_printf(s, format, len_arg, str);
3915 trace_seq_printf(s, format, str);
3919 struct trace_seq *s, const char *format,
3965 trace_seq_printf(s, format, len_arg, str);
3967 trace_seq_printf(s, format, str);
3973 struct tep_event *event, const char *format,
3992 print_str_to_seq(s, format, len_arg, arg->atom.atom);
4032 /* Check if it matches a print format */
4048 print_str_to_seq(s, format, len_arg, str);
4057 print_str_to_seq(s, format, len_arg, flag->str);
4063 print_str_to_seq(s, format, len_arg, flag->str);
4079 print_str_to_seq(s, format, len_arg, flag->str);
4174 print_str_to_seq(s, format, len_arg, ((char *)data) + str_offset);
4178 print_str_to_seq(s, format, len_arg, arg->string.string);
4193 print_bitmask_to_seq(tep, s, format, len_arg,
4206 format, len_arg, arg->op.right->op.left);
4209 format, len_arg, arg->op.right->op.right);
4519 char *format;
4526 do_warning_event(event, "can't find format field for binary printk");
4536 if (asprintf(&format, "%%ps: (NO FORMAT FOUND at %llx)\n", addr) < 0)
4538 return format;
4541 if (asprintf(&format, "%s: %s", "%ps", printk->printk) < 0)
4544 return format;
4547 static int print_mac_arg(struct trace_seq *s, const char *format,
4567 if (format[0] == 'm') {
4569 } else if (format[0] == 'M' && format[1] == 'F') {
4573 if (format[1] == 'R') {
4968 char *format = "%02x";
4975 format = "%02X";
4982 format = "%02X";
5017 trace_seq_printf(s, format, buf[index[i]] & 0xff);
5167 field = event->format.fields;
5175 static int print_function(struct trace_seq *s, const char *format,
5186 if (*format == 'F' || *format == 'S')
5198 static int print_arg_pointer(struct trace_seq *s, const char *format, int plen,
5209 while (*format) {
5210 if (*format == 'p') {
5211 format++;
5214 format++;
5217 switch (*format) {
5222 ret += print_function(s, format, data, size, event, arg);
5226 ret += print_mac_arg(s, format, data, size, event, arg);
5230 ret += print_ip_arg(s, format, data, size, event, arg);
5233 ret += print_uuid_arg(s, format, data, size, event, arg);
5236 ret += print_raw_buff_arg(s, format, data, size, event, arg, plen);
5249 static int print_arg_number(struct trace_seq *s, const char *format, int plen,
5260 trace_seq_printf(s, format, plen, (char)val);
5262 trace_seq_printf(s, format, (char)val);
5266 trace_seq_printf(s, format, plen, (short)val);
5268 trace_seq_printf(s, format, (short)val);
5272 trace_seq_printf(s, format, plen, (int)val);
5274 trace_seq_printf(s, format, (int)val);
5278 trace_seq_printf(s, format, plen, (long)val);
5280 trace_seq_printf(s, format, (long)val);
5284 trace_seq_printf(s, format, plen, (long long)val);
5286 trace_seq_printf(s, format, (long long)val);
5296 static void print_arg_string(struct trace_seq *s, const char *format, int plen,
5305 format, plen, arg);
5311 static int parse_arg_format_pointer(const char *format)
5317 switch (*format) {
5327 switch (format[1]) {
5339 switch (format[1]) {
5343 switch (format[index]) {
5358 switch (format[index]) {
5367 if (format[1] == '4') {
5374 if (format[index] == 'c')
5382 switch (format[1]) {
5393 switch (format[1]) {
5416 free(del->format);
5421 static int parse_arg_add(struct tep_print_parse **parse, char *format,
5432 parg->format = strdup(format);
5433 if (!parg->format)
5443 free(parg->format);
5451 const char *format, struct tep_print_arg **arg)
5455 const char *start = format;
5461 format++;
5463 for (; *format; format++) {
5464 switch (*format) {
5504 res = parse_arg_format_pointer(format + 1);
5506 format += res;
5509 len = ((unsigned long)format + 1) -
5513 do_warning_event(event, "bad format!");
5537 len = ((unsigned long)format + 1) -
5542 do_warning_event(event, "bad format!");
5574 len = ((unsigned long)format + 1) -
5579 do_warning_event(event, "bad format!");
5593 snprintf(print_format, 32, ">%c<", *format);
5607 static int parse_arg_string(struct tep_print_parse **parse, const char *format)
5613 for (; *format; format++) {
5614 if (*format == '\\') {
5615 format++;
5617 switch (*format) {
5631 trace_seq_putc(&s, *format);
5634 } else if (*format == '%') {
5635 if (*(format + 1) == '%') {
5637 format++;
5642 trace_seq_putc(&s, *format);
5654 parse_args(struct tep_event *event, const char *format, struct tep_print_arg *arg)
5661 len = strlen(format);
5662 while (*format) {
5665 if (*format == '%' && *(format + 1) != '%')
5666 ret = parse_arg_format(parse, event, format, &arg);
5668 ret = parse_arg_string(parse, format);
5674 format += ret;
5691 print_arg_number(s, parse->format,
5696 print_arg_pointer(s, parse->format,
5701 print_arg_string(s, parse->format,
5707 trace_seq_printf(s, "%s", parse->format);
5742 * This parses out the Latency format (interrupts disabled,
5747 char *format, struct tep_record *record)
5988 * writes the print format into the trace_seq.
5990 static void print_event_info(struct trace_seq *s, char *format, bool raw,
6035 * specified as part of printf @format string. Example:
6041 char *format, struct tep_event *event,
6050 if (isdigit(*(format + 1)))
6051 prec = atoi(format + 1);
6052 divstr = strchr(format, '.');
6076 char format[32];
6087 data_latency_format(tep, s, type->format, record);
6091 trace_seq_printf(s, type->format, comm);
6093 print_event_info(s, type->format, true, event, record);
6095 print_event_info(s, type->format, false, event, record);
6097 trace_seq_printf(s, type->format, event->name);
6118 return print_event_time(tep, s, type->format, event, record);
6122 trace_seq_printf(s, type->format, param);
6125 static int tep_print_event_param_type(char *format,
6128 char *str = format + 1;
6151 memset(type->format, 0, 32);
6152 memcpy(type->format, format, i < 32 ? i : 31);
6161 * @format: a printf format string. Supported event fileds:
6168 * can be specified as part of this format string:
6174 * the format string, the event information will be printed
6175 * in raw format.
6182 char *format = strdup(fmt);
6183 char *current = format;
6184 char *str = format;
6189 if (!format)
6223 free(format);
6427 event->format.nr_common,
6428 event->format.common_fields);
6441 event->format.nr_fields,
6442 event->format.fields);
6641 * @buf: the buffer storing the header page format string
6645 * This parses the header page format for information on the
6732 * parse_format - parse the event format
6733 * @buf: the buffer storing the event format string
6737 * This parses the event format and creates an event structure
6742 * /sys/kernel/debug/tracing/events/.../.../format
6798 * print format fails to parse.
6817 for (field = event->format.fields; field; field = field->next) {
6838 event->print_fmt.format,
6884 * tep_parse_format - parse the event format
6886 * @eventp: returned format
6887 * @buf: the buffer storing the event format string
6891 * This parses the event format and creates an event structure
6896 * /sys/kernel/debug/tracing/events/.../.../format
6907 * tep_parse_event - parse the event format
6909 * @buf: the buffer storing the event format string
6913 * This parses the event format and creates an event structure
6918 * /sys/kernel/debug/tracing/events/.../.../format
7072 * tep_print_num_field - print a field and a format
7074 * @fmt: The printf format to print the field with.
7105 * tep_print_func_field - print a field and a format for function pointers
7107 * @fmt: The printf format to print the field with.
7170 * Some events may have helper functions in the print format arguments.
7310 * a given event. If for some reason the default print format
7492 static void free_formats(struct tep_format *format)
7494 free_format_fields(format->common_fields);
7495 free_format_fields(format->fields);
7503 free_formats(&event->format);
7505 free(event->print_fmt.format);