Re: [RFC PATCH] libtraceevent: Add tep_print_selected_fields()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2.08.21 г. 19:29, Steven Rostedt wrote:
What I was talking about is to change tep_print_field() to do something like:

Take the current tep_print_field() and turn it into static _tep_print_field().

  [ Not even compiled tested ]


Hi Steven,

I am not able to make sense from the code below.

void tep_print_field(struct trace_seq *s, void *data,
		     struct tep_format_field *field)
{
	struct tep_event = field->event;
	struct tep_print_parse = event->print_fmt.print_cache;
	struct tep_handle *tep = event->tep;
	unsigned int offset, len;

	if (event->flags & TEP_EVENT_FL_FAILED)
		goto out;

	if (field->flags & TEP_FIELD_IS_DYNAMIC)
		dynamic_offset(tep, field, data, &offset, &len);

	for (;parse; parse = parse->next) {

You need
        if (!parse->arg)
			continue;

		if (parse->type == PRINT_FMT_STRING)
			continue;
		if (parse->arg->type != TEP_PRINT_FIELD)
			continue;

I can't understand the idea of those two checks. I printed the values and they don't seem to have any selective power.

		if (parse->arg->field.field->field != field)
			continue;


This does not compile. I guess you mean
 		if (parse->arg->field.field != field)
 			continue;

however "parse->arg->field.field" looks like unused memory (NULL or 0xffffffff) and this check always fails.

Maybe we must call some of the process_XXX()static functions first in order to make your new version of tep_print_field() works?

Thanks!
Yordan

		print_parse_data(parse, s, data, size, event);
		return;
	}

  out:
	/* Not found */
	



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux