Re: [PATCH v3 1/5] kernel-shark-qt: Add kshark_get_X_easy() functions.

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

 



On Fri, 5 Oct 2018 18:33:20 +0000
Yordan Karadzhov <ykaradzhov@xxxxxxxxxx> wrote:

> +/**
> + * @brief This function allows for an easy access to the original name of the
> + *	  trace event as recorded in the tep_record object. The record is read
> + *	  from the file only in the case of an entry being touched by a plugin.
> + *	  Be aware that using the kshark_get_X_easy functions can be
> + *	  inefficient if you need an access to more than one of the data fields
> + *	  of the record.
> + *
> + * @param entry: Input location for the KernelShark entry.
> + *
> + * @returns The mane of the trace event recorded in the tep_record object on
> + *	    success, otherwise "[UNKNOWN EVENT]" or NULL.
> + */
> +const char *kshark_get_event_name_easy(struct kshark_entry *entry)
> +{
> +	struct kshark_context *kshark_ctx = NULL;
> +	struct event_format *event;

I had to fix this up as it is now called tep_event_format.

I applied this series and pushed it out. You may want to rebase and do a
make clean on your repo.

Thanks!

-- Steve

> +
> +	int event_id = kshark_get_event_id_easy(entry);
> +
> +	if (event_id < 0)
> +		return NULL;
> +
> +	kshark_instance(&kshark_ctx);
> +	event = tep_data_event_from_type(kshark_ctx->pevent, event_id);
> +	if (event)
> +		return event->name;
> +
> +	return "[UNKNOWN EVENT]";
> +}
> +



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

  Powered by Linux