Steven Rostedt (VMware) 9528c19507 tracing: Clean up alloc_synth_event()
alloc_synth_event() currently has the following code to initialize the
event fields and dynamic_fields:

	for (i = 0, j = 0; i < n_fields; i++) {
		event->fields[i] = fields[i];

		if (fields[i]->is_dynamic) {
			event->dynamic_fields[j] = fields[i];
			event->dynamic_fields[j]->field_pos = i;
			event->dynamic_fields[j++] = fields[i];
			event->n_dynamic_fields++;
		}
	}

1) It would make more sense to have all fields keep track of their
   field_pos.

2) event->dynmaic_fields[j] is assigned twice for no reason.

3) We can move updating event->n_dynamic_fields outside the loop, and just
   assign it to j.

This combination makes the code much cleaner.

Link: https://lkml.kernel.org/r/20210721195341.29bb0f77@oasis.local.home

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-07-23 08:45:30 -04:00
..
2021-07-02 13:31:08 -07:00
2021-07-09 15:35:13 +02:00
2021-04-27 18:14:38 -07:00
2021-07-11 11:06:09 -07:00
2021-06-29 12:07:18 -07:00
2021-07-11 11:13:57 -07:00
2021-06-10 20:59:05 -04:00
2021-04-08 16:04:20 -07:00
2021-06-18 11:43:08 +02:00
2021-06-28 11:45:29 -07:00
2021-05-07 00:26:33 -07:00
2021-07-11 11:06:09 -07:00
2020-12-14 16:40:27 -08:00
2020-12-17 13:01:31 -08:00
2020-12-14 16:40:27 -08:00
2021-06-18 11:43:09 +02:00
2020-12-01 10:30:28 +00:00
2021-06-18 11:43:07 +02:00
2021-05-07 00:26:34 -07:00
2020-08-19 14:13:20 +02:00