^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #undef TRACE_SYSTEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define TRACE_SYSTEM hda
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #if !defined(__HDAC_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #define __HDAC_TRACE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/tracepoint.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <sound/hdaudio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #ifndef HDAC_MSG_MAX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #define HDAC_MSG_MAX 500
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) struct hdac_bus;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct hdac_codec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) TRACE_EVENT(hda_send_cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) TP_PROTO(struct hdac_bus *bus, unsigned int cmd),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) TP_ARGS(bus, cmd),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) TP_STRUCT__entry(__dynamic_array(char, msg, HDAC_MSG_MAX)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) snprintf(__get_str(msg), HDAC_MSG_MAX,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) "[%s:%d] val=0x%08x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) dev_name((bus)->dev), (cmd) >> 28, cmd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) TP_printk("%s", __get_str(msg))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) TRACE_EVENT(hda_get_response,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) TP_PROTO(struct hdac_bus *bus, unsigned int addr, unsigned int res),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) TP_ARGS(bus, addr, res),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) TP_STRUCT__entry(__dynamic_array(char, msg, HDAC_MSG_MAX)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) snprintf(__get_str(msg), HDAC_MSG_MAX,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) "[%s:%d] val=0x%08x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) dev_name((bus)->dev), addr, res);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) TP_printk("%s", __get_str(msg))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) TRACE_EVENT(hda_unsol_event,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) TP_PROTO(struct hdac_bus *bus, u32 res, u32 res_ex),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) TP_ARGS(bus, res, res_ex),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) TP_STRUCT__entry(__dynamic_array(char, msg, HDAC_MSG_MAX)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) snprintf(__get_str(msg), HDAC_MSG_MAX,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) "[%s:%d] res=0x%08x, res_ex=0x%08x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) dev_name((bus)->dev), res_ex & 0x0f, res, res_ex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) TP_printk("%s", __get_str(msg))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) DECLARE_EVENT_CLASS(hdac_stream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) TP_ARGS(bus, azx_dev),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) __field(unsigned char, stream_tag)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) __entry->stream_tag = (azx_dev)->stream_tag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) TP_printk("stream_tag: %d", __entry->stream_tag)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) DEFINE_EVENT(hdac_stream, snd_hdac_stream_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) TP_ARGS(bus, azx_dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) DEFINE_EVENT(hdac_stream, snd_hdac_stream_stop,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) TP_ARGS(bus, azx_dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) #endif /* __HDAC_TRACE_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) /* This part must be outside protection */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) #undef TRACE_INCLUDE_PATH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) #define TRACE_INCLUDE_PATH .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) #undef TRACE_INCLUDE_FILE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) #define TRACE_INCLUDE_FILE trace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) #include <trace/define_trace.h>