On 13.10.20 г. 3:44 ч., Steven Rostedt wrote:
On Mon, 12 Oct 2020 16:35:12 +0300 "Yordan Karadzhov (VMware)" <y.karadz@xxxxxxxxx> wrote:Here we provide an implementation of the Data stream interface that will process the trace-cmd (Ftrace) data. This can be considered the most essential change in the transformation of the C API towards version 2. However, for the moment we only have stand alone definitions that are not made functional yet. The actual integration with the API will be introduced in the following patches. Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@xxxxxxxxx> ---+ +static ssize_t get_records(struct kshark_context *kshark_ctx, + struct kshark_data_stream *stream, + struct rec_list ***rec_list, + enum rec_type type) +{ + struct tep_event_filter *adv_filter = NULL; + struct rec_list **temp_next;
....
+ ret = tep_read_number_field(evt_field, record->data, + (unsigned long long *) val); + free_record(record); + + return ret; +} + +/** Initialize all methods used by a stream of FTRACE data. */ +static void kshark_tep_init_methods(struct kshark_data_stream *stream) +{ + stream->interface.get_pid = tepdata_get_pid; + stream->interface.get_task = tepdata_get_task; + stream->interface.get_event_id = tepdata_get_event_id; + stream->interface.get_event_name = tepdata_get_event_name; + stream->interface.get_latency = tepdata_get_latency;Since "latency" is a very specific field, I wonder if we should call this "aux_field", and have a way to express what to show in the table. That is, if there's not a "aux_field" defined, it ignores it. Not all streams may have this.
This is a good idea. I will change it in v3 and will fix all the issues you pointed out above.
Thanks! Yordan
-- Steve+ stream->interface.get_info = tepdata_get_info; + stream->interface.find_event_id = tepdata_find_event_id; + stream->interface.get_all_event_ids = tepdata_get_event_ids; + stream->interface.dump_entry = tepdata_dump_entry; + stream->interface.get_all_field_names = tepdata_get_field_names; + stream->interface.get_event_field_type = tepdata_get_field_type; + stream->interface.read_record_field_int64 = tepdata_read_record_field; + stream->interface.read_event_field_int64 = tepdata_read_event_field; + stream->interface.load_entries = tepdata_load_entries; + stream->interface.load_matrix = tepdata_load_matrix; +} +