| .. | .. |
|---|
| 53 | 53 | #include "hfi.h" |
|---|
| 54 | 54 | #include "mad.h" |
|---|
| 55 | 55 | #include "sdma.h" |
|---|
| 56 | +#include "ipoib.h" |
|---|
| 57 | +#include "user_sdma.h" |
|---|
| 56 | 58 | |
|---|
| 57 | 59 | const char *parse_sdma_flags(struct trace_seq *p, u64 desc0, u64 desc1); |
|---|
| 58 | 60 | |
|---|
| .. | .. |
|---|
| 653 | 655 | __entry->code) |
|---|
| 654 | 656 | ); |
|---|
| 655 | 657 | |
|---|
| 658 | +TRACE_EVENT(hfi1_usdma_defer, |
|---|
| 659 | + TP_PROTO(struct hfi1_user_sdma_pkt_q *pq, |
|---|
| 660 | + struct sdma_engine *sde, |
|---|
| 661 | + struct iowait *wait), |
|---|
| 662 | + TP_ARGS(pq, sde, wait), |
|---|
| 663 | + TP_STRUCT__entry(DD_DEV_ENTRY(pq->dd) |
|---|
| 664 | + __field(struct hfi1_user_sdma_pkt_q *, pq) |
|---|
| 665 | + __field(struct sdma_engine *, sde) |
|---|
| 666 | + __field(struct iowait *, wait) |
|---|
| 667 | + __field(int, engine) |
|---|
| 668 | + __field(int, empty) |
|---|
| 669 | + ), |
|---|
| 670 | + TP_fast_assign(DD_DEV_ASSIGN(pq->dd); |
|---|
| 671 | + __entry->pq = pq; |
|---|
| 672 | + __entry->sde = sde; |
|---|
| 673 | + __entry->wait = wait; |
|---|
| 674 | + __entry->engine = sde->this_idx; |
|---|
| 675 | + __entry->empty = list_empty(&__entry->wait->list); |
|---|
| 676 | + ), |
|---|
| 677 | + TP_printk("[%s] pq %llx sde %llx wait %llx engine %d empty %d", |
|---|
| 678 | + __get_str(dev), |
|---|
| 679 | + (unsigned long long)__entry->pq, |
|---|
| 680 | + (unsigned long long)__entry->sde, |
|---|
| 681 | + (unsigned long long)__entry->wait, |
|---|
| 682 | + __entry->engine, |
|---|
| 683 | + __entry->empty |
|---|
| 684 | + ) |
|---|
| 685 | +); |
|---|
| 686 | + |
|---|
| 687 | +TRACE_EVENT(hfi1_usdma_activate, |
|---|
| 688 | + TP_PROTO(struct hfi1_user_sdma_pkt_q *pq, |
|---|
| 689 | + struct iowait *wait, |
|---|
| 690 | + int reason), |
|---|
| 691 | + TP_ARGS(pq, wait, reason), |
|---|
| 692 | + TP_STRUCT__entry(DD_DEV_ENTRY(pq->dd) |
|---|
| 693 | + __field(struct hfi1_user_sdma_pkt_q *, pq) |
|---|
| 694 | + __field(struct iowait *, wait) |
|---|
| 695 | + __field(int, reason) |
|---|
| 696 | + ), |
|---|
| 697 | + TP_fast_assign(DD_DEV_ASSIGN(pq->dd); |
|---|
| 698 | + __entry->pq = pq; |
|---|
| 699 | + __entry->wait = wait; |
|---|
| 700 | + __entry->reason = reason; |
|---|
| 701 | + ), |
|---|
| 702 | + TP_printk("[%s] pq %llx wait %llx reason %d", |
|---|
| 703 | + __get_str(dev), |
|---|
| 704 | + (unsigned long long)__entry->pq, |
|---|
| 705 | + (unsigned long long)__entry->wait, |
|---|
| 706 | + __entry->reason |
|---|
| 707 | + ) |
|---|
| 708 | +); |
|---|
| 709 | + |
|---|
| 710 | +TRACE_EVENT(hfi1_usdma_we, |
|---|
| 711 | + TP_PROTO(struct hfi1_user_sdma_pkt_q *pq, |
|---|
| 712 | + int we_ret), |
|---|
| 713 | + TP_ARGS(pq, we_ret), |
|---|
| 714 | + TP_STRUCT__entry(DD_DEV_ENTRY(pq->dd) |
|---|
| 715 | + __field(struct hfi1_user_sdma_pkt_q *, pq) |
|---|
| 716 | + __field(int, state) |
|---|
| 717 | + __field(int, we_ret) |
|---|
| 718 | + ), |
|---|
| 719 | + TP_fast_assign(DD_DEV_ASSIGN(pq->dd); |
|---|
| 720 | + __entry->pq = pq; |
|---|
| 721 | + __entry->state = pq->state; |
|---|
| 722 | + __entry->we_ret = we_ret; |
|---|
| 723 | + ), |
|---|
| 724 | + TP_printk("[%s] pq %llx state %d we_ret %d", |
|---|
| 725 | + __get_str(dev), |
|---|
| 726 | + (unsigned long long)__entry->pq, |
|---|
| 727 | + __entry->state, |
|---|
| 728 | + __entry->we_ret |
|---|
| 729 | + ) |
|---|
| 730 | +); |
|---|
| 731 | + |
|---|
| 656 | 732 | const char *print_u32_array(struct trace_seq *, u32 *, int); |
|---|
| 657 | 733 | #define __print_u32_hex(arr, len) print_u32_array(p, arr, len) |
|---|
| 658 | 734 | |
|---|
| .. | .. |
|---|
| 858 | 934 | TP_ARGS(qp, flag) |
|---|
| 859 | 935 | ); |
|---|
| 860 | 936 | |
|---|
| 937 | +DECLARE_EVENT_CLASS(/* AIP */ |
|---|
| 938 | + hfi1_ipoib_txq_template, |
|---|
| 939 | + TP_PROTO(struct hfi1_ipoib_txq *txq), |
|---|
| 940 | + TP_ARGS(txq), |
|---|
| 941 | + TP_STRUCT__entry(/* entry */ |
|---|
| 942 | + DD_DEV_ENTRY(txq->priv->dd) |
|---|
| 943 | + __field(struct hfi1_ipoib_txq *, txq) |
|---|
| 944 | + __field(struct sdma_engine *, sde) |
|---|
| 945 | + __field(ulong, head) |
|---|
| 946 | + __field(ulong, tail) |
|---|
| 947 | + __field(uint, used) |
|---|
| 948 | + __field(uint, flow) |
|---|
| 949 | + __field(int, stops) |
|---|
| 950 | + __field(int, no_desc) |
|---|
| 951 | + __field(u8, idx) |
|---|
| 952 | + __field(u8, stopped) |
|---|
| 953 | + ), |
|---|
| 954 | + TP_fast_assign(/* assign */ |
|---|
| 955 | + DD_DEV_ASSIGN(txq->priv->dd) |
|---|
| 956 | + __entry->txq = txq; |
|---|
| 957 | + __entry->sde = txq->sde; |
|---|
| 958 | + __entry->head = txq->tx_ring.head; |
|---|
| 959 | + __entry->tail = txq->tx_ring.tail; |
|---|
| 960 | + __entry->idx = txq->q_idx; |
|---|
| 961 | + __entry->used = |
|---|
| 962 | + txq->sent_txreqs - |
|---|
| 963 | + atomic64_read(&txq->complete_txreqs); |
|---|
| 964 | + __entry->flow = txq->flow.as_int; |
|---|
| 965 | + __entry->stops = atomic_read(&txq->stops); |
|---|
| 966 | + __entry->no_desc = atomic_read(&txq->no_desc); |
|---|
| 967 | + __entry->stopped = |
|---|
| 968 | + __netif_subqueue_stopped(txq->priv->netdev, txq->q_idx); |
|---|
| 969 | + ), |
|---|
| 970 | + TP_printk(/* print */ |
|---|
| 971 | + "[%s] txq %llx idx %u sde %llx head %lx tail %lx flow %x used %u stops %d no_desc %d stopped %u", |
|---|
| 972 | + __get_str(dev), |
|---|
| 973 | + (unsigned long long)__entry->txq, |
|---|
| 974 | + __entry->idx, |
|---|
| 975 | + (unsigned long long)__entry->sde, |
|---|
| 976 | + __entry->head, |
|---|
| 977 | + __entry->tail, |
|---|
| 978 | + __entry->flow, |
|---|
| 979 | + __entry->used, |
|---|
| 980 | + __entry->stops, |
|---|
| 981 | + __entry->no_desc, |
|---|
| 982 | + __entry->stopped |
|---|
| 983 | + ) |
|---|
| 984 | +); |
|---|
| 985 | + |
|---|
| 986 | +DEFINE_EVENT(/* queue stop */ |
|---|
| 987 | + hfi1_ipoib_txq_template, hfi1_txq_stop, |
|---|
| 988 | + TP_PROTO(struct hfi1_ipoib_txq *txq), |
|---|
| 989 | + TP_ARGS(txq) |
|---|
| 990 | +); |
|---|
| 991 | + |
|---|
| 992 | +DEFINE_EVENT(/* queue wake */ |
|---|
| 993 | + hfi1_ipoib_txq_template, hfi1_txq_wake, |
|---|
| 994 | + TP_PROTO(struct hfi1_ipoib_txq *txq), |
|---|
| 995 | + TP_ARGS(txq) |
|---|
| 996 | +); |
|---|
| 997 | + |
|---|
| 998 | +DEFINE_EVENT(/* flow flush */ |
|---|
| 999 | + hfi1_ipoib_txq_template, hfi1_flow_flush, |
|---|
| 1000 | + TP_PROTO(struct hfi1_ipoib_txq *txq), |
|---|
| 1001 | + TP_ARGS(txq) |
|---|
| 1002 | +); |
|---|
| 1003 | + |
|---|
| 1004 | +DEFINE_EVENT(/* flow switch */ |
|---|
| 1005 | + hfi1_ipoib_txq_template, hfi1_flow_switch, |
|---|
| 1006 | + TP_PROTO(struct hfi1_ipoib_txq *txq), |
|---|
| 1007 | + TP_ARGS(txq) |
|---|
| 1008 | +); |
|---|
| 1009 | + |
|---|
| 1010 | +DEFINE_EVENT(/* wakeup */ |
|---|
| 1011 | + hfi1_ipoib_txq_template, hfi1_txq_wakeup, |
|---|
| 1012 | + TP_PROTO(struct hfi1_ipoib_txq *txq), |
|---|
| 1013 | + TP_ARGS(txq) |
|---|
| 1014 | +); |
|---|
| 1015 | + |
|---|
| 1016 | +DEFINE_EVENT(/* full */ |
|---|
| 1017 | + hfi1_ipoib_txq_template, hfi1_txq_full, |
|---|
| 1018 | + TP_PROTO(struct hfi1_ipoib_txq *txq), |
|---|
| 1019 | + TP_ARGS(txq) |
|---|
| 1020 | +); |
|---|
| 1021 | + |
|---|
| 1022 | +DEFINE_EVENT(/* queued */ |
|---|
| 1023 | + hfi1_ipoib_txq_template, hfi1_txq_queued, |
|---|
| 1024 | + TP_PROTO(struct hfi1_ipoib_txq *txq), |
|---|
| 1025 | + TP_ARGS(txq) |
|---|
| 1026 | +); |
|---|
| 1027 | + |
|---|
| 1028 | +DEFINE_EVENT(/* xmit_stopped */ |
|---|
| 1029 | + hfi1_ipoib_txq_template, hfi1_txq_xmit_stopped, |
|---|
| 1030 | + TP_PROTO(struct hfi1_ipoib_txq *txq), |
|---|
| 1031 | + TP_ARGS(txq) |
|---|
| 1032 | +); |
|---|
| 1033 | + |
|---|
| 1034 | +DEFINE_EVENT(/* xmit_unstopped */ |
|---|
| 1035 | + hfi1_ipoib_txq_template, hfi1_txq_xmit_unstopped, |
|---|
| 1036 | + TP_PROTO(struct hfi1_ipoib_txq *txq), |
|---|
| 1037 | + TP_ARGS(txq) |
|---|
| 1038 | +); |
|---|
| 1039 | + |
|---|
| 861 | 1040 | #endif /* __HFI1_TRACE_TX_H */ |
|---|
| 862 | 1041 | |
|---|
| 863 | 1042 | #undef TRACE_INCLUDE_PATH |
|---|