From: Christopher Bostic <cbostic@linux.vnet.ibm.com>
To: robh+dt@kernel.org, mark.rutland@arm.com, linux@armlinux.org.uk,
rostedt@goodmis.org, mingo@redhat.com,
gregkh@linuxfoundation.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Cc: Jeremy Kerr <jk@ozlabs.org>,
joel@jms.id.au, linux-kernel@vger.kernel.org, andrew@aj.id.au,
alistair@popple.id.au, benh@kernel.crashing.org,
Christopher Bostic <cbostic@linux.vnet.ibm.com>
Subject: [PATCH v8 20/24] drivers/fsi/gpio: Add tracepoints for GPIO master
Date: Tue, 6 Jun 2017 16:08:55 -0500 [thread overview]
Message-ID: <20170606210859.80431-21-cbostic@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170606210859.80431-1-cbostic@linux.vnet.ibm.com>
From: Jeremy Kerr <jk@ozlabs.org>
Trace low level input/output GPIO operations.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Christopher Bostic <cbostic@linux.vnet.ibm.com>
---
drivers/fsi/fsi-master-gpio.c | 9 +++++
include/trace/events/fsi_master_gpio.h | 68 ++++++++++++++++++++++++++++++++++
2 files changed, 77 insertions(+)
create mode 100644 include/trace/events/fsi_master_gpio.h
diff --git a/drivers/fsi/fsi-master-gpio.c b/drivers/fsi/fsi-master-gpio.c
index d467e61..a5d6e70 100644
--- a/drivers/fsi/fsi-master-gpio.c
+++ b/drivers/fsi/fsi-master-gpio.c
@@ -61,6 +61,9 @@ struct fsi_master_gpio {
struct gpio_desc *gpio_mux; /* Mux control */
};
+#define CREATE_TRACE_POINTS
+#include <trace/events/fsi_master_gpio.h>
+
#define to_fsi_master_gpio(m) container_of(m, struct fsi_master_gpio, master)
struct fsi_gpio_msg {
@@ -126,6 +129,8 @@ static void serial_in(struct fsi_master_gpio *master, struct fsi_gpio_msg *msg,
msg->msg |= ~in_bit & 0x1; /* Data is active low */
}
msg->bits += num_bits;
+
+ trace_fsi_master_gpio_in(master, num_bits, msg->msg);
}
static void serial_out(struct fsi_master_gpio *master,
@@ -137,6 +142,8 @@ static void serial_out(struct fsi_master_gpio *master,
uint64_t last_bit = ~0;
int next_bit;
+ trace_fsi_master_gpio_out(master, cmd->bits, cmd->msg);
+
if (!cmd->bits) {
dev_warn(master->dev, "trying to output 0 bits\n");
return;
@@ -458,6 +465,8 @@ static int fsi_master_gpio_break(struct fsi_master *_master, int link)
if (link != 0)
return -ENODEV;
+ trace_fsi_master_gpio_break(master);
+
set_sda_output(master, 1);
sda_out(master, 1);
clock_toggle(master, FSI_PRE_BREAK_CLOCKS);
diff --git a/include/trace/events/fsi_master_gpio.h b/include/trace/events/fsi_master_gpio.h
new file mode 100644
index 0000000..11b36c1
--- /dev/null
+++ b/include/trace/events/fsi_master_gpio.h
@@ -0,0 +1,68 @@
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM fsi_master_gpio
+
+#if !defined(_TRACE_FSI_MASTER_GPIO_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_FSI_MASTER_GPIO_H
+
+#include <linux/tracepoint.h>
+
+TRACE_EVENT(fsi_master_gpio_in,
+ TP_PROTO(const struct fsi_master_gpio *master, int bits, uint64_t msg),
+ TP_ARGS(master, bits, msg),
+ TP_STRUCT__entry(
+ __field(int, master_idx)
+ __field(int, bits)
+ __field(uint64_t, msg)
+ ),
+ TP_fast_assign(
+ __entry->master_idx = master->master.idx;
+ __entry->bits = bits;
+ __entry->msg = msg & ((1ull<<bits) - 1);
+ ),
+ TP_printk("fsi-gpio%d => %0*llx[%d]",
+ __entry->master_idx,
+ (__entry->bits + 3) / 4,
+ __entry->msg,
+ __entry->bits
+ )
+);
+
+TRACE_EVENT(fsi_master_gpio_out,
+ TP_PROTO(const struct fsi_master_gpio *master, int bits, uint64_t msg),
+ TP_ARGS(master, bits, msg),
+ TP_STRUCT__entry(
+ __field(int, master_idx)
+ __field(int, bits)
+ __field(uint64_t, msg)
+ ),
+ TP_fast_assign(
+ __entry->master_idx = master->master.idx;
+ __entry->bits = bits;
+ __entry->msg = msg & ((1ull<<bits) - 1);
+ ),
+ TP_printk("fsi-gpio%d <= %0*llx[%d]",
+ __entry->master_idx,
+ (__entry->bits + 3) / 4,
+ __entry->msg,
+ __entry->bits
+ )
+);
+
+TRACE_EVENT(fsi_master_gpio_break,
+ TP_PROTO(const struct fsi_master_gpio *master),
+ TP_ARGS(master),
+ TP_STRUCT__entry(
+ __field(int, master_idx)
+ ),
+ TP_fast_assign(
+ __entry->master_idx = master->master.idx;
+ ),
+ TP_printk("fsi-gpio%d ----break---",
+ __entry->master_idx
+ )
+);
+
+#endif /* _TRACE_FSI_MASTER_GPIO_H */
+
+#include <trace/define_trace.h>
--
1.8.2.2
next prev parent reply other threads:[~2017-06-06 21:08 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-06 21:08 [PATCH v8 00/24] FSI device driver implementation Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 03/24] drivers/fsi: Add empty master scan Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 04/24] lib: Add crc4 module Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 05/24] drivers/fsi: Add slave & master read/write APIs Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 08/24] drivers/fsi: Set slave SMODE to init communication Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 09/24] drivers/fsi: scan slaves & register devices Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 10/24] drivers/fsi: Add device read/write/peek API Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 11/24] drivers/fsi: Add master unscan Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 12/24] drivers/fsi: Add documentation for GPIO bindings Christopher Bostic
[not found] ` <20170606210859.80431-1-cbostic-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2017-06-06 21:08 ` [PATCH v8 01/24] drivers/fsi: Add fsi master definition Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 02/24] drivers/fsi: Add slave definition Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 06/24] drivers/fsi: Set up links for slave communication Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 07/24] drivers/fsi: Implement slave initialisation Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 13/24] drivers/fsi: Add client driver register utilities Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 15/24] drivers/fsi: expose direct-access slave API Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 14/24] drivers/fsi: Add sysfs files for FSI master & slave accesses Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 16/24] drivers/fsi: Add tracepoints for low-level operations Christopher Bostic
2017-06-07 19:16 ` Steven Rostedt
[not found] ` <20170607151610.52f7bc88-f9ZlEuEWxVcJvu8Pb33WZ0EMvNT87kid@public.gmane.org>
2017-06-08 2:06 ` Jeremy Kerr
2017-06-06 21:08 ` [PATCH v8 17/24] drivers/fsi: Add error handling for slave Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 18/24] drivers/fsi: Document FSI master sysfs files in ABI Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 19/24] drivers/fsi: Add GPIO based FSI master Christopher Bostic
2017-06-06 21:08 ` Christopher Bostic [this message]
2017-06-06 21:08 ` [PATCH v8 21/24] drivers/fsi: Add SCOM FSI client device driver Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 22/24] drivers/fsi: Add hub master support Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 23/24] drivers/fsi: Use asynchronous slave mode Christopher Bostic
2017-06-06 21:08 ` [PATCH v8 24/24] drivers/fsi: Add module license to core driver Christopher Bostic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170606210859.80431-21-cbostic@linux.vnet.ibm.com \
--to=cbostic@linux.vnet.ibm.com \
--cc=alistair@popple.id.au \
--cc=andrew@aj.id.au \
--cc=benh@kernel.crashing.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jk@ozlabs.org \
--cc=joel@jms.id.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=robh+dt@kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).