123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286 |
- /*
- * Copyright (c) 2021, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
- *
- * Permission to use, copy, modify, and/or distribute this software for
- * any purpose with or without fee is hereby granted, provided that the
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
- /**
- * DOC: qdf_tracepoint.h
- * This file defines HLOS agnostic functions providing external interface
- * for triggering tracepoints.
- */
- #if !defined(_QDF_TRACEPOINT_H)
- #define _QDF_TRACEPOINT_H
- #include <i_qdf_tracepoint.h>
- #include <qdf_nbuf.h>
- #include <qdf_trace.h>
- #ifdef WLAN_TRACEPOINTS
- /**
- * qdf_trace_dp_packet() - Trace packet in tx or rx path
- * @nbuf: network buffer pointer
- * @dir: tx or rx direction
- * @tso_desc: TSO descriptor
- * @enq_time: tx hw enqueue wall clock time in milliseconds
- *
- * Return: None
- */
- void qdf_trace_dp_packet(qdf_nbuf_t nbuf, enum qdf_proto_dir dir,
- struct qdf_tso_seg_elem_t *tso_desc,
- uint64_t enq_time);
- #else
- static inline
- void qdf_trace_dp_packet(qdf_nbuf_t nbuf, enum qdf_proto_dir dir,
- struct qdf_tso_seg_elem_t *tso_desc,
- uint64_t enq_time)
- {
- }
- #endif
- /**
- * qdf_trace_dp_rx_tcp_pkt_enabled() - Get the dp_rx_tcp_pkt tracepoint
- * enabled or disabled state
- *
- * Return: True if the tracepoint is enabled else false
- */
- static inline
- bool qdf_trace_dp_rx_tcp_pkt_enabled(void)
- {
- return __qdf_trace_dp_rx_tcp_pkt_enabled();
- }
- /**
- * qdf_trace_dp_rx_tcp_pkt() - Trace tcp packet in rx direction
- * @nbuf: pointer to network buffer
- * @tcp_seq_num: TCP sequence number
- * @tcp_ack_num: TCP acknowlegment number
- * @srcport: TCP source port
- * @dstport: TCP destination port
- * @latency: latency in milliseconds
- *
- * Return: None
- */
- static inline
- void qdf_trace_dp_rx_tcp_pkt(qdf_nbuf_t nbuf, uint32_t tcp_seq_num,
- uint32_t tcp_ack_num, uint16_t srcport,
- uint16_t dstport, uint64_t latency)
- {
- __qdf_trace_dp_rx_tcp_pkt(nbuf, tcp_seq_num, tcp_ack_num,
- srcport, dstport, latency);
- }
- /**
- * qdf_trace_dp_tx_comp_tcp_pkt_enabled() - Get the dp_tx_comp_tcp_pkt
- * tracepoint enabled or disabled state
- *
- * Return: True if the tracepoint is enabled else false
- */
- static inline
- bool qdf_trace_dp_tx_comp_tcp_pkt_enabled(void)
- {
- return __qdf_trace_dp_tx_comp_tcp_pkt_enabled();
- }
- /**
- * qdf_trace_dp_tx_comp_tcp_pkt() - Trace tcp packet in tx completion
- * @nbuf: pointer to network buffer
- * @tcp_seq_num: TCP sequence number
- * @tcp_ack_num: TCP acknowlegment number
- * @srcport: TCP source port
- * @dstport: TCP destination port
- * @latency: latency in milliseconds
- *
- * Return: None
- */
- static inline
- void qdf_trace_dp_tx_comp_tcp_pkt(qdf_nbuf_t nbuf, uint32_t tcp_seq_num,
- uint32_t tcp_ack_num, uint16_t srcport,
- uint16_t dstport, uint64_t latency)
- {
- __qdf_trace_dp_tx_comp_tcp_pkt(nbuf, tcp_seq_num, tcp_ack_num, srcport,
- dstport, latency);
- }
- /**
- * qdf_trace_dp_rx_udp_pkt_enabled() - Get the dp_rx_udp_pkt tracepoint
- * enabled or disabled state
- *
- * Return: True if the tracepoint is enabled else false
- */
- static inline
- bool qdf_trace_dp_rx_udp_pkt_enabled(void)
- {
- return __qdf_trace_dp_rx_udp_pkt_enabled();
- }
- /**
- * qdf_trace_dp_rx_udp_pkt() - Trace udp packet in rx direction
- * @nbuf: pointer to network buffer
- * @ip_id: ip identification field
- * @srcport: UDP source port
- * @dstport: UDP destination port
- * @latency: latency in milliseconds
- *
- * Return: None
- */
- static inline
- void qdf_trace_dp_rx_udp_pkt(qdf_nbuf_t nbuf, uint16_t ip_id,
- uint16_t srcport, uint16_t dstport,
- uint64_t latency)
- {
- __qdf_trace_dp_rx_udp_pkt(nbuf, ip_id, srcport, dstport, latency);
- }
- /**
- * qdf_trace_dp_tx_comp_udp_pkt_enabled() - Get the dp_tx_comp_udp_pkt
- * tracepoint enabled or disabled state
- *
- * Return: True if the tracepoint is enabled else false
- */
- static inline
- bool qdf_trace_dp_tx_comp_udp_pkt_enabled(void)
- {
- return __qdf_trace_dp_tx_comp_udp_pkt_enabled();
- }
- /**
- * qdf_trace_dp_tx_comp_udp_pkt() - Trace udp packet in tx completion
- * @nbuf: pointer to network buffer
- * @ip_id: ip identification field
- * @srcport: UDP source port
- * @dstport: UDP destination port
- * @latency: latency in milliseconds
- *
- * Return: None
- */
- static inline
- void qdf_trace_dp_tx_comp_udp_pkt(qdf_nbuf_t nbuf, uint16_t ip_id,
- uint16_t srcport, uint16_t dstport,
- uint64_t latency)
- {
- __qdf_trace_dp_tx_comp_udp_pkt(nbuf, ip_id, srcport, dstport, latency);
- }
- /**
- * qdf_trace_dp_rx_pkt_enabled() - Get the dp_rx_pkt tracepoint
- * enabled or disabled state
- *
- * Return: True if the tracepoint is enabled else false
- */
- static inline
- bool qdf_trace_dp_rx_pkt_enabled(void)
- {
- return __qdf_trace_dp_rx_pkt_enabled();
- }
- /**
- * qdf_trace_dp_rx_pkt() - Trace non-tcp/udp packet in rx direction
- * @nbuf: pointer to network buffer
- * @ether_type: type in ethernet header
- * @latency: latency in milliseconds
- *
- * Return: None
- */
- static inline
- void qdf_trace_dp_rx_pkt(qdf_nbuf_t nbuf, uint16_t ether_type,
- uint64_t latency)
- {
- __qdf_trace_dp_rx_pkt(nbuf, ether_type, latency);
- }
- /**
- * qdf_trace_dp_tx_comp_pkt_enabled() - Get the dp_tx_comp_pkt tracepoint
- * enabled or disabled state
- *
- * Return: True if the tracepoint is enabled else false
- */
- static inline
- bool qdf_trace_dp_tx_comp_pkt_enabled(void)
- {
- return __qdf_trace_dp_tx_comp_pkt_enabled();
- }
- /**
- * qdf_trace_dp_tx_comp_pkt() - Trace non-tcp/udp packet in rx direction
- * @nbuf: pointer to network buffer
- * @ether_type: type in ethernet header
- * @latency: latency in milliseconds
- *
- * Return: None
- */
- static inline
- void qdf_trace_dp_tx_comp_pkt(qdf_nbuf_t nbuf, uint16_t ether_type,
- uint64_t latency)
- {
- __qdf_trace_dp_tx_comp_pkt(nbuf, ether_type, latency);
- }
- /**
- * qdf_trace_dp_del_reg_write_enabled() - Get the dp_del_reg_write tracepoint
- * enabled or disabled state
- *
- * Return: True if the tracepoint is enabled else false
- */
- static inline
- bool qdf_trace_dp_del_reg_write_enabled(void)
- {
- return __qdf_trace_dp_del_reg_write_enabled();
- }
- /**
- * qdf_trace_dp_del_reg_write() - Trace delayed register writes
- * @srng_id: srng id
- * @enq_val: enqueue value
- * @deq_val: dequeue value
- * @enq_time: enqueue time in qtimer ticks
- * @deq_time: dequeue time in qtimer ticks
- *
- * Return: None
- */
- static inline
- void qdf_trace_dp_del_reg_write(uint8_t srng_id, uint32_t enq_val,
- uint32_t deq_val, uint64_t enq_time,
- uint64_t deq_time)
- {
- __qdf_trace_dp_del_reg_write(srng_id, enq_val, deq_val, enq_time,
- deq_time);
- }
- /**
- * qdf_trace_dp_ce_tasklet_sched_latency_enabled() - Get the
- * dp_ce_tasklet_sched_latency tracepoint enabled or disabled state
- *
- * Return: True if the tracepoint is enabled else false
- */
- static inline
- bool qdf_trace_dp_ce_tasklet_sched_latency_enabled(void)
- {
- return __qdf_trace_dp_ce_tasklet_sched_latency_enabled();
- }
- /**
- * qdf_trace_dp_ce_tasklet_sched_latency() - Trace ce tasklet scheduling
- * latency
- * @ce_id: ce id
- * @sched_latency: ce tasklet sched latency in nanoseconds
- *
- * Return: None
- */
- static inline void
- qdf_trace_dp_ce_tasklet_sched_latency(uint8_t ce_id, uint64_t sched_latency)
- {
- __qdf_trace_dp_ce_tasklet_sched_latency(ce_id, sched_latency);
- }
- #endif /* _QDF_TRACEPOINT_H */
|