From: Bryan O'Donoghue Date: Fri, 18 Sep 2015 15:38:44 +0000 (+0100) Subject: greybus: tracepoints: add tracepoint definitions X-Git-Tag: v4.9.8~1233^2~378^2~21^2~1173 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb03ed920166a1fa2df77d5ef96ff1d749fa2967;p=platform%2Fkernel%2Flinux-rpi3.git greybus: tracepoints: add tracepoint definitions This patch adds greybus_trace.h with the following trace definitions - trace_gb_message_send - trace_gb_message_recv_request - trace_gb_message_recv_response - trace_gb_message_cancel_incoming - trace_gb_message_cancel_outgoing Signed-off-by: Bryan O'Donoghue Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/greybus_trace.h b/drivers/staging/greybus/greybus_trace.h new file mode 100644 index 0000000..abceb3a --- /dev/null +++ b/drivers/staging/greybus/greybus_trace.h @@ -0,0 +1,120 @@ +/* + * Greybus driver and device API + * + * Copyright 2015 Google Inc. + * Copyright 2015 Linaro Ltd. + * + * Released under the GPLv2 only. + */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM greybus + +#if !defined(_TRACE_GREYBUS_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_GREYBUS_H + +#include + +struct gb_message; + +DECLARE_EVENT_CLASS(gb_message, + + TP_PROTO(struct gb_message *message), + + TP_ARGS(message), + + TP_STRUCT__entry( + __string(name, dev_name(&message->operation->connection->dev)) + __field(u16, op_id) + __field(u16, intf_cport_id) + __field(u16, hd_cport_id) + __field(size_t, payload_size) + ), + + TP_fast_assign( + __assign_str(name, dev_name(&message->operation->connection->dev)) + __entry->op_id = message->operation->id; + __entry->intf_cport_id = + message->operation->connection->intf_cport_id; + __entry->hd_cport_id = + message->operation->connection->hd_cport_id; + __entry->payload_size = message->payload_size; + ), + + TP_printk("greybus:%s op=%04x if_id=%04x hd_id=%04x l=%zu", + __get_str(name), __entry->op_id, __entry->intf_cport_id, + __entry->hd_cport_id, __entry->payload_size) +); + +/* + * tracepoint name greybus:gb_message_send + * description send a greybus message + * location operation.c:gb_message_send + */ +DEFINE_EVENT(gb_message, gb_message_send, + + TP_PROTO(struct gb_message *message), + + TP_ARGS(message) +); + +/* + * tracepoint name greybus:gb_message_recv_request + * description receive a greybus request + * location operation.c:gb_connection_recv_request + */ +DEFINE_EVENT(gb_message, gb_message_recv_request, + + TP_PROTO(struct gb_message *message), + + TP_ARGS(message) +); + +/* + * tracepoint name greybus:gb_message_recv_response + * description receive a greybus response + * location operation.c:gb_connection_recv_response + */ +DEFINE_EVENT(gb_message, gb_message_recv_response, + + TP_PROTO(struct gb_message *message), + + TP_ARGS(message) +); + +/* + * tracepoint name greybus:gb_message_cancel_outgoing + * description cancel outgoing greybus request + * location operation.c:gb_message_cancel + */ +DEFINE_EVENT(gb_message, gb_message_cancel_outgoing, + + TP_PROTO(struct gb_message *message), + + TP_ARGS(message) +); + +/* + * tracepoint name greybus:gb_message_cancel_incoming + * description cancel incoming greybus request + * location operation.c:gb_message_cancel_incoming + */ +DEFINE_EVENT(gb_message, gb_message_cancel_incoming, + + TP_PROTO(struct gb_message *message), + + TP_ARGS(message) +); + +#endif /* _TRACE_GREYBUS_H */ + +/* This part must be outside protection */ +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH . + +/* + * TRACE_INCLUDE_FILE is not needed if the filename and TRACE_SYSTEM are equal + */ +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE greybus_trace +#include +