Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #undef TRACE_SYSTEM
0003 #define TRACE_SYSTEM hda
0004 
0005 #if !defined(__HDAC_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
0006 #define __HDAC_TRACE_H
0007 
0008 #include <linux/tracepoint.h>
0009 #include <linux/device.h>
0010 #include <sound/hdaudio.h>
0011 
0012 #ifndef HDAC_MSG_MAX
0013 #define HDAC_MSG_MAX    500
0014 #endif
0015 
0016 struct hdac_bus;
0017 struct hdac_codec;
0018 
0019 TRACE_EVENT(hda_send_cmd,
0020     TP_PROTO(struct hdac_bus *bus, unsigned int cmd),
0021     TP_ARGS(bus, cmd),
0022     TP_STRUCT__entry(
0023         __string(name, dev_name((bus)->dev))
0024         __field(u32, cmd)
0025     ),
0026     TP_fast_assign(
0027         __assign_str(name, dev_name((bus)->dev));
0028         __entry->cmd = cmd;
0029     ),
0030     TP_printk("[%s:%d] val=0x%08x", __get_str(name), __entry->cmd >> 28, __entry->cmd)
0031 );
0032 
0033 TRACE_EVENT(hda_get_response,
0034     TP_PROTO(struct hdac_bus *bus, unsigned int addr, unsigned int res),
0035     TP_ARGS(bus, addr, res),
0036     TP_STRUCT__entry(
0037         __string(name, dev_name((bus)->dev))
0038         __field(u32, addr)
0039         __field(u32, res)
0040     ),
0041     TP_fast_assign(
0042         __assign_str(name, dev_name((bus)->dev));
0043         __entry->addr = addr;
0044         __entry->res = res;
0045     ),
0046     TP_printk("[%s:%d] val=0x%08x", __get_str(name), __entry->addr, __entry->res)
0047 );
0048 
0049 TRACE_EVENT(hda_unsol_event,
0050     TP_PROTO(struct hdac_bus *bus, u32 res, u32 res_ex),
0051     TP_ARGS(bus, res, res_ex),
0052     TP_STRUCT__entry(
0053         __string(name, dev_name((bus)->dev))
0054         __field(u32, res)
0055         __field(u32, res_ex)
0056     ),
0057     TP_fast_assign(
0058         __assign_str(name, dev_name((bus)->dev));
0059         __entry->res = res;
0060         __entry->res_ex = res_ex;
0061     ),
0062     TP_printk("[%s:%d] res=0x%08x, res_ex=0x%08x", __get_str(name),
0063           __entry->res_ex & 0x0f, __entry->res, __entry->res_ex)
0064 );
0065 
0066 DECLARE_EVENT_CLASS(hdac_stream,
0067     TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
0068 
0069     TP_ARGS(bus, azx_dev),
0070 
0071     TP_STRUCT__entry(
0072         __field(unsigned char, stream_tag)
0073     ),
0074 
0075     TP_fast_assign(
0076         __entry->stream_tag = (azx_dev)->stream_tag;
0077     ),
0078 
0079     TP_printk("stream_tag: %d", __entry->stream_tag)
0080 );
0081 
0082 DEFINE_EVENT(hdac_stream, snd_hdac_stream_start,
0083     TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
0084     TP_ARGS(bus, azx_dev)
0085 );
0086 
0087 DEFINE_EVENT(hdac_stream, snd_hdac_stream_stop,
0088     TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
0089     TP_ARGS(bus, azx_dev)
0090 );
0091 
0092 #endif /* __HDAC_TRACE_H */
0093 
0094 /* This part must be outside protection */
0095 #undef TRACE_INCLUDE_PATH
0096 #define TRACE_INCLUDE_PATH .
0097 
0098 #undef TRACE_INCLUDE_FILE
0099 #define TRACE_INCLUDE_FILE trace
0100 
0101 #include <trace/define_trace.h>