All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cezary Rojewski <cezary.rojewski@intel.com>
To: alsa-devel@alsa-project.org
Cc: pierre-louis.bossart@linux.intel.com,
	Cezary Rojewski <cezary.rojewski@intel.com>,
	andriy.shevchenko@intel.com, filip.kaczmarski@intel.com,
	harshapriya.n@intel.com, marcin.barlik@intel.com,
	zwisler@google.com, lgirdwood@gmail.com, tiwai@suse.com,
	filip.proborszcz@intel.com, broonie@kernel.org,
	amadeuszx.slawinski@linux.intel.com, michal.wasko@intel.com,
	cujomalainey@chromium.org, krzysztof.hejmowski@intel.com,
	ppapierkowski@habana.ai, vamshi.krishna.gopal@intel.com
Subject: [PATCH v2 07/13] ASoC: Intel: catpt: Event tracing
Date: Tue, 11 Aug 2020 12:00:28 +0200	[thread overview]
Message-ID: <20200811100034.6875-8-cezary.rojewski@intel.com> (raw)
In-Reply-To: <20200811100034.6875-1-cezary.rojewski@intel.com>

Define tracing macros for easy catpt debug. These cover all IPC message
types: requests, replies and notifications.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
 sound/soc/intel/catpt/trace.h | 83 +++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)
 create mode 100644 sound/soc/intel/catpt/trace.h

diff --git a/sound/soc/intel/catpt/trace.h b/sound/soc/intel/catpt/trace.h
new file mode 100644
index 000000000000..bb3d627dbeaf
--- /dev/null
+++ b/sound/soc/intel/catpt/trace.h
@@ -0,0 +1,83 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright(c) 2020 Intel Corporation. All rights reserved.
+ *
+ * Author: Cezary Rojewski <cezary.rojewski@intel.com>
+ */
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM intel_catpt
+
+#if !defined(__SND_SOC_INTEL_CATPT_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
+#define __SND_SOC_INTEL_CATPT_TRACE_H
+
+#include <linux/types.h>
+#include <linux/tracepoint.h>
+
+DECLARE_EVENT_CLASS(catpt_ipc_msg,
+
+	TP_PROTO(u32 header),
+
+	TP_ARGS(header),
+
+	TP_STRUCT__entry(
+		__field(u32, header)
+	),
+
+	TP_fast_assign(
+		__entry->header = header;
+	),
+
+	TP_printk("0x%08x", __entry->header)
+);
+
+DEFINE_EVENT(catpt_ipc_msg, catpt_irq,
+	TP_PROTO(u32 header),
+	TP_ARGS(header)
+);
+
+DEFINE_EVENT(catpt_ipc_msg, catpt_ipc_request,
+	TP_PROTO(u32 header),
+	TP_ARGS(header)
+);
+
+DEFINE_EVENT(catpt_ipc_msg, catpt_ipc_reply,
+	TP_PROTO(u32 header),
+	TP_ARGS(header)
+);
+
+DEFINE_EVENT(catpt_ipc_msg, catpt_ipc_notify,
+	TP_PROTO(u32 header),
+	TP_ARGS(header)
+);
+
+TRACE_EVENT_CONDITION(catpt_ipc_payload,
+
+	TP_PROTO(const u8 *data, size_t size),
+
+	TP_ARGS(data, size),
+
+	TP_CONDITION(data && size),
+
+	TP_STRUCT__entry(
+		__dynamic_array(u8, buf, size)
+	),
+
+	TP_fast_assign(
+		memcpy(__get_dynamic_array(buf), data, size);
+	),
+
+	TP_printk("%u byte(s)%s",
+		  __get_dynamic_array_len(buf),
+		  __print_hex_dump("", DUMP_PREFIX_NONE, 16, 4,
+				   __get_dynamic_array(buf),
+				   __get_dynamic_array_len(buf), false))
+);
+
+#endif /* __SND_SOC_INTEL_CATPT_TRACE_H */
+
+/* This part must be outside protection */
+#undef TRACE_INCLUDE_PATH
+#define TRACE_INCLUDE_PATH .
+#define TRACE_INCLUDE_FILE trace
+#include <trace/define_trace.h>
-- 
2.17.1


  parent reply	other threads:[~2020-08-11 10:07 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11 10:00 [PATCH v2 00/13] ASoC: Intel: Catpt - Lynx and Wildcat point Cezary Rojewski
2020-08-11 10:00 ` [PATCH v2 01/13] ASoC: Intel: Add catpt device Cezary Rojewski
2020-08-11 12:17   ` Amadeusz Sławiński
2020-08-11 12:24     ` Mark Brown
2020-08-11 12:45     ` Cezary Rojewski
2020-08-11 10:00 ` [PATCH v2 02/13] ASoC: Intel: catpt: Define DSP operations Cezary Rojewski
2020-08-11 12:17   ` Amadeusz Sławiński
2020-08-11 12:49     ` Cezary Rojewski
2020-08-11 10:00 ` [PATCH v2 03/13] ASoC: Intel: catpt: Firmware loading and context restore Cezary Rojewski
2020-08-11 10:00 ` [PATCH v2 04/13] ASoC: Intel: catpt: Implement IPC protocol Cezary Rojewski
2020-08-11 10:00 ` [PATCH v2 05/13] ASoC: Intel: catpt: Add IPC messages Cezary Rojewski
2020-08-11 10:00 ` [PATCH v2 06/13] ASoC: Intel: catpt: PCM operations Cezary Rojewski
2020-08-11 12:17   ` Amadeusz Sławiński
2020-08-11 12:44     ` Cezary Rojewski
2020-08-11 10:00 ` Cezary Rojewski [this message]
2020-08-11 10:00 ` [PATCH v2 08/13] ASoC: Intel: catpt: Simple sysfs attributes Cezary Rojewski
2020-08-11 10:00 ` [PATCH v2 09/13] ASoC: Intel: Select catpt and deprecate haswell Cezary Rojewski
2020-08-11 13:08   ` kernel test robot
2020-08-11 13:08     ` kernel test robot
2020-08-11 13:38     ` Andy Shevchenko
2020-08-11 13:38       ` Andy Shevchenko
2020-08-11 14:09       ` Cezary Rojewski
2020-08-11 14:09         ` Cezary Rojewski
2020-08-11 14:41         ` Andy Shevchenko
2020-08-11 14:41           ` Andy Shevchenko
2020-08-11 10:00 ` [PATCH v2 10/13] ASoC: Intel: haswell: Remove haswell-solution specific code Cezary Rojewski
2020-08-11 10:00 ` [PATCH v2 11/13] ASoC: Intel: broadwell: " Cezary Rojewski
2020-08-11 10:00 ` [PATCH v2 12/13] ASoC: Intel: bdw-5650: " Cezary Rojewski
2020-08-11 10:00 ` [PATCH v2 13/13] ASoC: Intel: bdw-5677: " Cezary Rojewski

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=20200811100034.6875-8-cezary.rojewski@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=broonie@kernel.org \
    --cc=cujomalainey@chromium.org \
    --cc=filip.kaczmarski@intel.com \
    --cc=filip.proborszcz@intel.com \
    --cc=harshapriya.n@intel.com \
    --cc=krzysztof.hejmowski@intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=marcin.barlik@intel.com \
    --cc=michal.wasko@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ppapierkowski@habana.ai \
    --cc=tiwai@suse.com \
    --cc=vamshi.krishna.gopal@intel.com \
    --cc=zwisler@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.