eventdev: add tracepoints
authorSunil Kumar Kori <skori@marvell.com>
Wed, 22 Apr 2020 19:03:46 +0000 (00:33 +0530)
committerDavid Marchand <david.marchand@redhat.com>
Thu, 23 Apr 2020 13:40:08 +0000 (15:40 +0200)
Add tracepoints at important and mandatory APIs for tracing support.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: David Marchand <david.marchand@redhat.com>
14 files changed:
lib/librte_eventdev/Makefile
lib/librte_eventdev/eventdev_trace_points.c [new file with mode: 0644]
lib/librte_eventdev/meson.build
lib/librte_eventdev/rte_event_crypto_adapter.c
lib/librte_eventdev/rte_event_eth_rx_adapter.c
lib/librte_eventdev/rte_event_eth_tx_adapter.c
lib/librte_eventdev/rte_event_eth_tx_adapter.h
lib/librte_eventdev/rte_event_timer_adapter.c
lib/librte_eventdev/rte_event_timer_adapter.h
lib/librte_eventdev/rte_eventdev.c
lib/librte_eventdev/rte_eventdev.h
lib/librte_eventdev/rte_eventdev_trace.h [new file with mode: 0644]
lib/librte_eventdev/rte_eventdev_trace_fp.h [new file with mode: 0644]
lib/librte_eventdev/rte_eventdev_version.map

index c85c0d3..0715256 100644 (file)
@@ -21,6 +21,7 @@ LDLIBS += -lrte_mbuf -lrte_cryptodev -lpthread
 # library source files
 SRCS-y += rte_eventdev.c
 SRCS-y += rte_event_ring.c
+SRCS-y += eventdev_trace_points.c
 SRCS-y += rte_event_eth_rx_adapter.c
 SRCS-y += rte_event_timer_adapter.c
 SRCS-y += rte_event_crypto_adapter.c
@@ -31,6 +32,8 @@ SYMLINK-y-include += rte_eventdev.h
 SYMLINK-y-include += rte_eventdev_pmd.h
 SYMLINK-y-include += rte_eventdev_pmd_pci.h
 SYMLINK-y-include += rte_eventdev_pmd_vdev.h
+SYMLINK-y-include += rte_eventdev_trace.h
+SYMLINK-y-include += rte_eventdev_trace_fp.h
 SYMLINK-y-include += rte_event_ring.h
 SYMLINK-y-include += rte_event_eth_rx_adapter.h
 SYMLINK-y-include += rte_event_timer_adapter.h
diff --git a/lib/librte_eventdev/eventdev_trace_points.c b/lib/librte_eventdev/eventdev_trace_points.c
new file mode 100644 (file)
index 0000000..2aa6e6b
--- /dev/null
@@ -0,0 +1,173 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2020 Marvell International Ltd.
+ */
+
+#define RTE_TRACE_POINT_REGISTER_SELECT
+
+#include "rte_eventdev_trace.h"
+
+/* Eventdev trace points */
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_configure);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_queue_setup);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_port_setup);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_port_link);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_port_unlink);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_start);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_stop);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_close);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_enq_burst);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_deq_burst);
+
+/* Eventdev Rx adapter trace points */
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_eth_rx_adapter_create);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_eth_rx_adapter_free);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_eth_rx_adapter_queue_add);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_eth_rx_adapter_queue_del);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_eth_rx_adapter_start);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_eth_rx_adapter_stop);
+
+/* Eventdev Tx adapter trace points */
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_eth_tx_adapter_create);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_eth_tx_adapter_free);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_eth_tx_adapter_queue_add);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_eth_tx_adapter_queue_del);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_eth_tx_adapter_start);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_eth_tx_adapter_stop);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_eth_tx_adapter_enqueue);
+
+/* Eventdev Timer adapter trace points */
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_timer_adapter_create);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_timer_adapter_start);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_timer_adapter_stop);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_timer_adapter_free);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_timer_arm_burst);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_timer_arm_tmo_tick_burst);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_timer_cancel_burst);
+
+/* Eventdev Crypto adapter trace points */
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_crypto_adapter_create);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_crypto_adapter_free);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_crypto_adapter_queue_pair_add);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_crypto_adapter_queue_pair_del);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_crypto_adapter_start);
+RTE_TRACE_POINT_DEFINE(rte_eventdev_trace_crypto_adapter_stop);
+
+RTE_INIT(eventdev_trace_init)
+{
+       /* Eventdev trace points */
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_configure,
+               lib.eventdev.configure);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_queue_setup,
+               lib.eventdev.queue.setup);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_port_setup,
+               lib.eventdev.port.setup);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_port_link,
+               lib.eventdev.port.link);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_port_unlink,
+               lib.eventdev.port.unlink);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_start,
+               lib.eventdev.start);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_stop,
+               lib.eventdev.stop);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_close,
+               lib.eventdev.close);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_enq_burst,
+               lib.eventdev.enq.burst);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_deq_burst,
+               lib.eventdev.deq.burst);
+
+
+       /* Eventdev Rx adapter trace points */
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_rx_adapter_create,
+               lib.eventdev.rx.adapter.create);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_rx_adapter_free,
+               lib.eventdev.rx.adapter.free);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_rx_adapter_queue_add,
+               lib.eventdev.rx.adapter.queue.add);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_rx_adapter_queue_del,
+               lib.eventdev.rx.adapter.queue.del);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_rx_adapter_start,
+               lib.eventdev.rx.adapter.start);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_rx_adapter_stop,
+               lib.eventdev.rx.adapter.stop);
+
+       /* Eventdev Tx adapter trace points */
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_tx_adapter_create,
+               lib.eventdev.tx.adapter.create);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_tx_adapter_free,
+               lib.eventdev.tx.adapter.free);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_tx_adapter_queue_add,
+               lib.eventdev.tx.adapter.queue.add);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_tx_adapter_queue_del,
+               lib.eventdev.tx.adapter.queue.del);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_tx_adapter_start,
+               lib.eventdev.tx.adapter.start);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_tx_adapter_stop,
+               lib.eventdev.tx.adapter.stop);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_tx_adapter_enqueue,
+               lib.eventdev.tx.adapter.enq);
+
+
+       /* Eventdev Timer adapter trace points */
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_timer_adapter_create,
+               lib.eventdev.timer.create);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_timer_adapter_start,
+               lib.eventdev.timer.start);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_timer_adapter_stop,
+               lib.eventdev.timer.stop);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_timer_adapter_free,
+               lib.eventdev.timer.free);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_timer_arm_burst,
+               lib.eventdev.timer.burst);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_timer_arm_tmo_tick_burst,
+               lib.eventdev.timer.tick.burst);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_timer_cancel_burst,
+               lib.eventdev.timer.cancel);
+
+       /* Eventdev Crypto adapter trace points */
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_crypto_adapter_create,
+               lib.eventdev.crypto.create);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_crypto_adapter_free,
+               lib.eventdev.crypto.free);
+
+       RTE_TRACE_POINT_REGISTER(
+                       rte_eventdev_trace_crypto_adapter_queue_pair_add,
+               lib.eventdev.crypto.queue.add);
+
+       RTE_TRACE_POINT_REGISTER(
+                       rte_eventdev_trace_crypto_adapter_queue_pair_del,
+               lib.eventdev.crypto.queue.del);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_crypto_adapter_start,
+               lib.eventdev.crypto.start);
+
+       RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_crypto_adapter_stop,
+               lib.eventdev.crypto.stop);
+}
index 16d8240..d1f25ee 100644 (file)
@@ -9,6 +9,7 @@ endif
 
 sources = files('rte_eventdev.c',
                'rte_event_ring.c',
+               'eventdev_trace_points.c',
                'rte_event_eth_rx_adapter.c',
                'rte_event_timer_adapter.c',
                'rte_event_crypto_adapter.c',
@@ -17,6 +18,8 @@ headers = files('rte_eventdev.h',
                'rte_eventdev_pmd.h',
                'rte_eventdev_pmd_pci.h',
                'rte_eventdev_pmd_vdev.h',
+               'rte_eventdev_trace.h',
+               'rte_eventdev_trace_fp.h',
                'rte_event_ring.h',
                'rte_event_eth_rx_adapter.h',
                'rte_event_timer_adapter.h',
index 22d9108..8f25933 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "rte_eventdev.h"
 #include "rte_eventdev_pmd.h"
+#include "rte_eventdev_trace.h"
 #include "rte_event_crypto_adapter.h"
 
 #define BATCH_SIZE 32
@@ -267,6 +268,8 @@ rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id,
 
        event_crypto_adapter[id] = adapter;
 
+       rte_eventdev_trace_crypto_adapter_create(id, dev_id, adapter, conf_arg,
+               mode);
        return 0;
 }
 
@@ -314,6 +317,7 @@ rte_event_crypto_adapter_free(uint8_t id)
                return -EBUSY;
        }
 
+       rte_eventdev_trace_crypto_adapter_free(id, adapter);
        if (adapter->default_cb_arg)
                rte_free(adapter->conf_arg);
        rte_free(adapter->cdevs);
@@ -874,6 +878,8 @@ rte_event_crypto_adapter_queue_pair_add(uint8_t id,
                rte_service_component_runstate_set(adapter->service_id, 1);
        }
 
+       rte_eventdev_trace_crypto_adapter_queue_pair_add(id, cdev_id, event,
+               queue_pair_id);
        return 0;
 }
 
@@ -959,6 +965,8 @@ rte_event_crypto_adapter_queue_pair_del(uint8_t id, uint8_t cdev_id,
                                adapter->nb_qps);
        }
 
+       rte_eventdev_trace_crypto_adapter_queue_pair_del(id, cdev_id,
+               queue_pair_id, ret);
        return ret;
 }
 
@@ -1014,12 +1022,14 @@ rte_event_crypto_adapter_start(uint8_t id)
        if (adapter == NULL)
                return -EINVAL;
 
+       rte_eventdev_trace_crypto_adapter_start(id, adapter);
        return eca_adapter_ctrl(id, 1);
 }
 
 int
 rte_event_crypto_adapter_stop(uint8_t id)
 {
+       rte_eventdev_trace_crypto_adapter_stop(id);
        return eca_adapter_ctrl(id, 0);
 }
 
index 95dd478..f0000d1 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "rte_eventdev.h"
 #include "rte_eventdev_pmd.h"
+#include "rte_eventdev_trace.h"
 #include "rte_event_eth_rx_adapter.h"
 
 #define BATCH_SIZE             32
@@ -1998,6 +1999,8 @@ rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id,
        event_eth_rx_adapter[id] = rx_adapter;
        if (conf_cb == rxa_default_conf_cb)
                rx_adapter->default_cb_arg = 1;
+       rte_eventdev_trace_eth_rx_adapter_create(id, dev_id, conf_cb,
+               conf_arg);
        return 0;
 }
 
@@ -2047,6 +2050,7 @@ rte_event_eth_rx_adapter_free(uint8_t id)
        rte_free(rx_adapter);
        event_eth_rx_adapter[id] = NULL;
 
+       rte_eventdev_trace_eth_rx_adapter_free(id);
        return 0;
 }
 
@@ -2142,6 +2146,8 @@ rte_event_eth_rx_adapter_queue_add(uint8_t id,
                rte_spinlock_unlock(&rx_adapter->rx_lock);
        }
 
+       rte_eventdev_trace_eth_rx_adapter_queue_add(id, eth_dev_id,
+               rx_queue_id, queue_conf, ret);
        if (ret)
                return ret;
 
@@ -2263,18 +2269,22 @@ unlock_ret:
                                rxa_sw_adapter_queue_count(rx_adapter));
        }
 
+       rte_eventdev_trace_eth_rx_adapter_queue_del(id, eth_dev_id,
+               rx_queue_id, ret);
        return ret;
 }
 
 int
 rte_event_eth_rx_adapter_start(uint8_t id)
 {
+       rte_eventdev_trace_eth_rx_adapter_start(id);
        return rxa_ctrl(id, 1);
 }
 
 int
 rte_event_eth_rx_adapter_stop(uint8_t id)
 {
+       rte_eventdev_trace_eth_rx_adapter_stop(id);
        return rxa_ctrl(id, 0);
 }
 
index d02ef57..bb21dc4 100644 (file)
@@ -6,6 +6,7 @@
 #include <rte_ethdev.h>
 
 #include "rte_eventdev_pmd.h"
+#include "rte_eventdev_trace.h"
 #include "rte_event_eth_tx_adapter.h"
 
 #define TXA_BATCH_SIZE         32
@@ -942,7 +943,8 @@ rte_event_eth_tx_adapter_create(uint8_t id, uint8_t dev_id,
                txa_dev_id_array[id] = TXA_INVALID_DEV_ID;
                return ret;
        }
-
+       rte_eventdev_trace_eth_tx_adapter_create(id, dev_id, NULL, port_conf,
+               ret);
        txa_dev_id_array[id] = dev_id;
        return 0;
 }
@@ -984,6 +986,8 @@ rte_event_eth_tx_adapter_create_ext(uint8_t id, uint8_t dev_id,
                return ret;
        }
 
+       rte_eventdev_trace_eth_tx_adapter_create(id, dev_id, conf_cb, conf_arg,
+               ret);
        txa_dev_id_array[id] = dev_id;
        return 0;
 }
@@ -1012,6 +1016,7 @@ rte_event_eth_tx_adapter_free(uint8_t id)
                ret = txa_service_adapter_free(id);
        txa_dev_id_array[id] = TXA_INVALID_DEV_ID;
 
+       rte_eventdev_trace_eth_tx_adapter_free(id, ret);
        return ret;
 }
 
@@ -1043,6 +1048,8 @@ rte_event_eth_tx_adapter_queue_add(uint8_t id,
        else
                ret = txa_service_queue_add(id, txa_evdev(id), eth_dev, queue);
 
+       rte_eventdev_trace_eth_tx_adapter_queue_add(id, eth_dev_id, queue,
+               ret);
        return ret;
 }
 
@@ -1073,6 +1080,8 @@ rte_event_eth_tx_adapter_queue_del(uint8_t id,
        else
                ret = txa_service_queue_del(id, eth_dev, queue);
 
+       rte_eventdev_trace_eth_tx_adapter_queue_del(id, eth_dev_id, queue,
+               ret);
        return ret;
 }
 
@@ -1094,6 +1103,7 @@ rte_event_eth_tx_adapter_start(uint8_t id)
        ret = txa_dev_start(id) ? txa_dev_start(id)(id, txa_evdev(id)) : 0;
        if (ret == 0)
                ret = txa_service_start(id);
+       rte_eventdev_trace_eth_tx_adapter_start(id, ret);
        return ret;
 }
 
@@ -1154,5 +1164,6 @@ rte_event_eth_tx_adapter_stop(uint8_t id)
        ret = txa_dev_stop(id) ? txa_dev_stop(id)(id,  txa_evdev(id)) : 0;
        if (ret == 0)
                ret = txa_service_stop(id);
+       rte_eventdev_trace_eth_tx_adapter_stop(id, ret);
        return ret;
 }
index 93b717a..8c59547 100644 (file)
@@ -369,6 +369,8 @@ rte_event_eth_tx_adapter_enqueue(uint8_t dev_id,
                return 0;
        }
 #endif
+       rte_eventdev_trace_eth_tx_adapter_enqueue(dev_id, port_id, ev,
+               nb_events, flags);
        if (flags)
                return dev->txa_enqueue_same_dest(dev->data->ports[port_id],
                                                  ev, nb_events);
index 161e21a..005459f 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "rte_eventdev.h"
 #include "rte_eventdev_pmd.h"
+#include "rte_eventdev_trace.h"
 #include "rte_event_timer_adapter.h"
 #include "rte_event_timer_adapter_pmd.h"
 
@@ -228,6 +229,8 @@ rte_event_timer_adapter_create_ext(
 
        adapter->allocated = 1;
 
+       rte_eventdev_trace_timer_adapter_create(adapter_id, adapter, conf,
+               conf_cb);
        return adapter;
 
 free_memzone:
@@ -272,7 +275,7 @@ rte_event_timer_adapter_start(const struct rte_event_timer_adapter *adapter)
                return ret;
 
        adapter->data->started = 1;
-
+       rte_eventdev_trace_timer_adapter_start(adapter);
        return 0;
 }
 
@@ -295,7 +298,7 @@ rte_event_timer_adapter_stop(const struct rte_event_timer_adapter *adapter)
                return ret;
 
        adapter->data->started = 0;
-
+       rte_eventdev_trace_timer_adapter_stop(adapter);
        return 0;
 }
 
@@ -379,6 +382,7 @@ rte_event_timer_adapter_free(struct rte_event_timer_adapter *adapter)
        adapter->data = NULL;
        adapter->allocated = 0;
 
+       rte_eventdev_trace_timer_adapter_free(adapter);
        return 0;
 }
 
index 7f6dc5c..d2ebcb0 100644 (file)
@@ -115,6 +115,7 @@ extern "C" {
 #include <rte_memory.h>
 
 #include "rte_eventdev.h"
+#include "rte_eventdev_trace_fp.h"
 
 /**
  * Timer adapter clock source
@@ -579,6 +580,8 @@ rte_event_timer_arm_burst(const struct rte_event_timer_adapter *adapter,
        ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
        FUNC_PTR_OR_ERR_RET(adapter->arm_burst, -EINVAL);
 #endif
+       rte_eventdev_trace_timer_arm_burst(adapter, (void **)evtims,
+               nb_evtims);
        return adapter->arm_burst(adapter, evtims, nb_evtims);
 }
 
@@ -622,6 +625,8 @@ rte_event_timer_arm_tmo_tick_burst(
        ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
        FUNC_PTR_OR_ERR_RET(adapter->arm_tmo_tick_burst, -EINVAL);
 #endif
+       rte_eventdev_trace_timer_arm_tmo_tick_burst(adapter, timeout_ticks,
+               (void **)evtims, nb_evtims);
        return adapter->arm_tmo_tick_burst(adapter, evtims, timeout_ticks,
                                           nb_evtims);
 }
@@ -655,6 +660,8 @@ rte_event_timer_cancel_burst(const struct rte_event_timer_adapter *adapter,
        ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
        FUNC_PTR_OR_ERR_RET(adapter->cancel_burst, -EINVAL);
 #endif
+       rte_eventdev_trace_timer_cancel_burst(adapter, (void **)evtims,
+               nb_evtims);
        return adapter->cancel_burst(adapter, evtims, nb_evtims);
 }
 
index b987e07..e72d8b9 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "rte_eventdev.h"
 #include "rte_eventdev_pmd.h"
+#include "rte_eventdev_trace.h"
 
 static struct rte_eventdev rte_event_devices[RTE_EVENT_MAX_DEVS];
 
@@ -524,6 +525,7 @@ rte_event_dev_configure(uint8_t dev_id,
        }
 
        dev->data->event_dev_cap = info.event_dev_cap;
+       rte_eventdev_trace_configure(dev_id, dev_conf, diag);
        return diag;
 }
 
@@ -650,6 +652,7 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,
        }
 
        dev->data->queues_cfg[queue_id] = *queue_conf;
+       rte_eventdev_trace_queue_setup(dev_id, queue_id, queue_conf);
        return (*dev->dev_ops->queue_setup)(dev, queue_id, queue_conf);
 }
 
@@ -766,6 +769,7 @@ rte_event_port_setup(uint8_t dev_id, uint8_t port_id,
        if (!diag)
                diag = rte_event_port_unlink(dev_id, port_id, NULL, 0);
 
+       rte_eventdev_trace_port_setup(dev_id, port_id, port_conf, diag);
        if (diag < 0)
                return diag;
 
@@ -936,6 +940,7 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,
        for (i = 0; i < diag; i++)
                links_map[queues[i]] = (uint8_t)priorities[i];
 
+       rte_eventdev_trace_port_link(dev_id, port_id, nb_links, diag);
        return diag;
 }
 
@@ -1001,6 +1006,7 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,
        for (i = 0; i < diag; i++)
                links_map[queues[i]] = EVENT_QUEUE_SERVICE_PRIORITY_INVALID;
 
+       rte_eventdev_trace_port_unlink(dev_id, port_id, nb_unlinks, diag);
        return diag;
 }
 
@@ -1213,6 +1219,7 @@ rte_event_dev_start(uint8_t dev_id)
        }
 
        diag = (*dev->dev_ops->dev_start)(dev);
+       rte_eventdev_trace_start(dev_id, diag);
        if (diag == 0)
                dev->data->dev_started = 1;
        else
@@ -1257,6 +1264,7 @@ rte_event_dev_stop(uint8_t dev_id)
 
        dev->data->dev_started = 0;
        (*dev->dev_ops->dev_stop)(dev);
+       rte_eventdev_trace_stop(dev_id);
 }
 
 int
@@ -1275,6 +1283,7 @@ rte_event_dev_close(uint8_t dev_id)
                return -EBUSY;
        }
 
+       rte_eventdev_trace_close(dev_id);
        return (*dev->dev_ops->dev_close)(dev);
 }
 
index 226f352..7dc8323 100644 (file)
@@ -215,6 +215,8 @@ extern "C" {
 #include <rte_memory.h>
 #include <rte_errno.h>
 
+#include "rte_eventdev_trace_fp.h"
+
 struct rte_mbuf; /* we just use mbuf pointers; no need to include rte_mbuf.h */
 struct rte_event;
 
@@ -1343,6 +1345,7 @@ __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
                return 0;
        }
 #endif
+       rte_eventdev_trace_enq_burst(dev_id, port_id, ev, nb_events, fn);
        /*
         * Allow zero cost non burst mode routine invocation if application
         * requests nb_events as const one
@@ -1620,7 +1623,7 @@ rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_event ev[],
                return 0;
        }
 #endif
-
+       rte_eventdev_trace_deq_burst(dev_id, port_id, ev, nb_events);
        /*
         * Allow zero cost non burst mode routine invocation if application
         * requests nb_events as const one
diff --git a/lib/librte_eventdev/rte_eventdev_trace.h b/lib/librte_eventdev/rte_eventdev_trace.h
new file mode 100644 (file)
index 0000000..4de6341
--- /dev/null
@@ -0,0 +1,307 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2020 Marvell International Ltd.
+ */
+
+#ifndef _RTE_EVENTDEV_TRACE_H_
+#define _RTE_EVENTDEV_TRACE_H_
+
+/**
+ * @file
+ *
+ * API for ethdev trace support
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rte_trace_point.h>
+
+#include "rte_eventdev.h"
+#include "rte_event_eth_rx_adapter.h"
+#include "rte_event_timer_adapter.h"
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_configure,
+       RTE_TRACE_POINT_ARGS(uint8_t dev_id,
+               const struct rte_event_dev_config *dev_conf, int rc),
+       rte_trace_point_emit_u8(dev_id);
+       rte_trace_point_emit_u32(dev_conf->dequeue_timeout_ns);
+       rte_trace_point_emit_i32(dev_conf->nb_events_limit);
+       rte_trace_point_emit_u8(dev_conf->nb_event_queues);
+       rte_trace_point_emit_u8(dev_conf->nb_event_ports);
+       rte_trace_point_emit_u32(dev_conf->nb_event_queue_flows);
+       rte_trace_point_emit_u32(dev_conf->nb_event_port_dequeue_depth);
+       rte_trace_point_emit_u32(dev_conf->nb_event_port_enqueue_depth);
+       rte_trace_point_emit_u32(dev_conf->event_dev_cfg);
+       rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_queue_setup,
+       RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t queue_id,
+               const struct rte_event_queue_conf *queue_conf),
+       rte_trace_point_emit_u8(dev_id);
+       rte_trace_point_emit_u8(queue_id);
+       rte_trace_point_emit_u32(queue_conf->nb_atomic_flows);
+       rte_trace_point_emit_u32(queue_conf->nb_atomic_order_sequences);
+       rte_trace_point_emit_u32(queue_conf->event_queue_cfg);
+       rte_trace_point_emit_u8(queue_conf->schedule_type);
+       rte_trace_point_emit_u8(queue_conf->priority);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_port_setup,
+       RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id,
+               const struct rte_event_port_conf *port_conf, int rc),
+       rte_trace_point_emit_u8(dev_id);
+       rte_trace_point_emit_u8(port_id);
+       rte_trace_point_emit_i32(port_conf->new_event_threshold);
+       rte_trace_point_emit_u16(port_conf->dequeue_depth);
+       rte_trace_point_emit_u16(port_conf->enqueue_depth);
+       rte_trace_point_emit_u8(port_conf->disable_implicit_release);
+       rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_port_link,
+       RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id,
+               uint16_t nb_links, int rc),
+       rte_trace_point_emit_u8(dev_id);
+       rte_trace_point_emit_u8(port_id);
+       rte_trace_point_emit_u16(nb_links);
+       rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_port_unlink,
+       RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id,
+               uint16_t nb_unlinks, int rc),
+       rte_trace_point_emit_u8(dev_id);
+       rte_trace_point_emit_u8(port_id);
+       rte_trace_point_emit_u16(nb_unlinks);
+       rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_start,
+       RTE_TRACE_POINT_ARGS(uint8_t dev_id, int rc),
+       rte_trace_point_emit_u8(dev_id);
+       rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_stop,
+       RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+       rte_trace_point_emit_u8(dev_id);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_close,
+       RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+       rte_trace_point_emit_u8(dev_id);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_eth_rx_adapter_create,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id, uint8_t dev_id, void *conf_cb,
+               void *conf_arg),
+       rte_trace_point_emit_u8(adptr_id);
+       rte_trace_point_emit_u8(dev_id);
+       rte_trace_point_emit_ptr(conf_cb);
+       rte_trace_point_emit_ptr(conf_arg);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_eth_rx_adapter_free,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id),
+       rte_trace_point_emit_u8(adptr_id);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_eth_rx_adapter_queue_add,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id, uint16_t eth_dev_id,
+               int32_t rx_queue_id,
+               const struct rte_event_eth_rx_adapter_queue_conf *queue_conf,
+               int rc),
+       rte_trace_point_emit_u8(adptr_id);
+       rte_trace_point_emit_u16(eth_dev_id);
+       rte_trace_point_emit_i32(rx_queue_id);
+       rte_trace_point_emit_u32(queue_conf->rx_queue_flags);
+       rte_trace_point_emit_u16(queue_conf->servicing_weight);
+       rte_trace_point_emit_u8(queue_conf->ev.queue_id);
+       rte_trace_point_emit_u8(queue_conf->ev.priority);
+       rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_eth_rx_adapter_queue_del,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id, uint16_t eth_dev_id,
+               int32_t rx_queue_id, int rc),
+       rte_trace_point_emit_u8(adptr_id);
+       rte_trace_point_emit_u16(eth_dev_id);
+       rte_trace_point_emit_i32(rx_queue_id);
+       rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_eth_rx_adapter_start,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id),
+       rte_trace_point_emit_u8(adptr_id);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_eth_rx_adapter_stop,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id),
+       rte_trace_point_emit_u8(adptr_id);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_eth_tx_adapter_create,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id, uint8_t dev_id, void *conf_cb,
+               struct rte_event_port_conf *port_conf, int rc),
+       rte_trace_point_emit_u8(adptr_id);
+       rte_trace_point_emit_u8(dev_id);
+       rte_trace_point_emit_i32(port_conf->new_event_threshold);
+       rte_trace_point_emit_u16(port_conf->dequeue_depth);
+       rte_trace_point_emit_u16(port_conf->enqueue_depth);
+       rte_trace_point_emit_u8(port_conf->disable_implicit_release);
+       rte_trace_point_emit_ptr(conf_cb);
+       rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_eth_tx_adapter_free,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id, int rc),
+       rte_trace_point_emit_u8(adptr_id);
+       rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_eth_tx_adapter_queue_add,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id, uint16_t eth_dev_id,
+               int32_t queue, int rc),
+       rte_trace_point_emit_u8(adptr_id);
+       rte_trace_point_emit_u16(eth_dev_id);
+       rte_trace_point_emit_i32(queue);
+       rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_eth_tx_adapter_queue_del,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id, uint16_t eth_dev_id,
+               int32_t queue, int rc),
+       rte_trace_point_emit_u8(adptr_id);
+       rte_trace_point_emit_u16(eth_dev_id);
+       rte_trace_point_emit_i32(queue);
+       rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_eth_tx_adapter_start,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id, int rc),
+       rte_trace_point_emit_u8(adptr_id);
+       rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_eth_tx_adapter_stop,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id, int rc),
+       rte_trace_point_emit_u8(adptr_id);
+       rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_timer_adapter_create,
+       RTE_TRACE_POINT_ARGS(uint16_t adapter_id, void *adapter,
+               const struct rte_event_timer_adapter_conf *conf,
+               void *conf_cb),
+       rte_trace_point_emit_u16(adapter_id);
+       rte_trace_point_emit_ptr(adapter);
+       rte_trace_point_emit_ptr(conf);
+       rte_trace_point_emit_u8(conf->event_dev_id);
+       rte_trace_point_emit_u16(conf->timer_adapter_id);
+       rte_trace_point_emit_u64(conf->timer_tick_ns);
+       rte_trace_point_emit_u64(conf->max_tmo_ns);
+       rte_trace_point_emit_u64(conf->nb_timers);
+       rte_trace_point_emit_u64(conf->flags);
+       rte_trace_point_emit_ptr(conf_cb);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_timer_adapter_start,
+       RTE_TRACE_POINT_ARGS(const void *adapter),
+       rte_trace_point_emit_ptr(adapter);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_timer_adapter_stop,
+       RTE_TRACE_POINT_ARGS(const void *adapter),
+       rte_trace_point_emit_ptr(adapter);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_timer_adapter_free,
+       RTE_TRACE_POINT_ARGS(void *adapter),
+       rte_trace_point_emit_ptr(adapter);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_crypto_adapter_create,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id, uint8_t dev_id, void *adapter,
+               struct rte_event_port_conf *port_conf, uint8_t mode),
+       rte_trace_point_emit_u8(adptr_id);
+       rte_trace_point_emit_u8(dev_id);
+       rte_trace_point_emit_ptr(adapter);
+       rte_trace_point_emit_u8(mode);
+       rte_trace_point_emit_i32(port_conf->new_event_threshold);
+       rte_trace_point_emit_u16(port_conf->dequeue_depth);
+       rte_trace_point_emit_u16(port_conf->enqueue_depth);
+       rte_trace_point_emit_u8(port_conf->disable_implicit_release);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_crypto_adapter_free,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id, void *adapter),
+       rte_trace_point_emit_u8(adptr_id);
+       rte_trace_point_emit_ptr(adapter);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_crypto_adapter_queue_pair_add,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id, uint8_t cdev_id,
+               const void *event, int32_t queue_pair_id),
+       rte_trace_point_emit_u8(adptr_id);
+       rte_trace_point_emit_u8(cdev_id);
+       rte_trace_point_emit_i32(queue_pair_id);
+       rte_trace_point_emit_ptr(event);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_crypto_adapter_queue_pair_del,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id, uint8_t cdev_id,
+               int32_t queue_pair_id, int rc),
+       rte_trace_point_emit_u8(adptr_id);
+       rte_trace_point_emit_u8(cdev_id);
+       rte_trace_point_emit_i32(queue_pair_id);
+       rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_crypto_adapter_start,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id, void *adapter),
+       rte_trace_point_emit_u8(adptr_id);
+       rte_trace_point_emit_ptr(adapter);
+)
+
+RTE_TRACE_POINT(
+       rte_eventdev_trace_crypto_adapter_stop,
+       RTE_TRACE_POINT_ARGS(uint8_t adptr_id),
+       rte_trace_point_emit_u8(adptr_id);
+)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTE_EVENTDEV_TRACE_H_ */
diff --git a/lib/librte_eventdev/rte_eventdev_trace_fp.h b/lib/librte_eventdev/rte_eventdev_trace_fp.h
new file mode 100644 (file)
index 0000000..349129c
--- /dev/null
@@ -0,0 +1,84 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2020 Marvell International Ltd.
+ */
+
+#ifndef _RTE_EVENTDEV_TRACE_FP_H_
+#define _RTE_EVENTDEV_TRACE_FP_H_
+
+/**
+ * @file
+ *
+ * API for ethdev trace support
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rte_trace_point.h>
+
+RTE_TRACE_POINT_FP(
+       rte_eventdev_trace_deq_burst,
+       RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id, void *ev_table,
+               uint16_t nb_events),
+       rte_trace_point_emit_u8(dev_id);
+       rte_trace_point_emit_u8(port_id);
+       rte_trace_point_emit_ptr(ev_table);
+       rte_trace_point_emit_u16(nb_events);
+)
+
+RTE_TRACE_POINT_FP(
+       rte_eventdev_trace_enq_burst,
+       RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id,
+               const void *ev_table, uint16_t nb_events, void *enq_mode_cb),
+       rte_trace_point_emit_u8(dev_id);
+       rte_trace_point_emit_u8(port_id);
+       rte_trace_point_emit_ptr(ev_table);
+       rte_trace_point_emit_u16(nb_events);
+       rte_trace_point_emit_ptr(enq_mode_cb);
+)
+
+RTE_TRACE_POINT_FP(
+       rte_eventdev_trace_eth_tx_adapter_enqueue,
+       RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id, void *ev_table,
+               uint16_t nb_events, const uint8_t flags),
+       rte_trace_point_emit_u8(dev_id);
+       rte_trace_point_emit_u8(port_id);
+       rte_trace_point_emit_ptr(ev_table);
+       rte_trace_point_emit_u16(nb_events);
+       rte_trace_point_emit_u8(flags);
+)
+
+RTE_TRACE_POINT_FP(
+       rte_eventdev_trace_timer_arm_burst,
+       RTE_TRACE_POINT_ARGS(const void *adapter, void **evtims_table,
+               uint16_t nb_evtims),
+       rte_trace_point_emit_ptr(adapter);
+       rte_trace_point_emit_ptr(evtims_table);
+       rte_trace_point_emit_u16(nb_evtims);
+)
+
+RTE_TRACE_POINT_FP(
+       rte_eventdev_trace_timer_arm_tmo_tick_burst,
+       RTE_TRACE_POINT_ARGS(const void *adapter, const uint64_t timeout_ticks,
+               void **evtims_table, const uint16_t nb_evtims),
+       rte_trace_point_emit_ptr(adapter);
+       rte_trace_point_emit_u64(timeout_ticks);
+       rte_trace_point_emit_ptr(evtims_table);
+       rte_trace_point_emit_u16(nb_evtims);
+)
+
+RTE_TRACE_POINT_FP(
+       rte_eventdev_trace_timer_cancel_burst,
+       RTE_TRACE_POINT_ARGS(const void *adapter, void **evtims_table,
+               uint16_t nb_evtims),
+       rte_trace_point_emit_ptr(adapter);
+       rte_trace_point_emit_ptr(evtims_table);
+       rte_trace_point_emit_u16(nb_evtims);
+)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTE_EVENTDEV_TRACE_FP_H_ */
index edfc152..91a62cd 100644 (file)
@@ -93,3 +93,45 @@ DPDK_20.0 {
 
        local: *;
 };
+
+EXPERIMENTAL {
+       global:
+
+       # added in 20.05
+       __rte_eventdev_trace_configure;
+       __rte_eventdev_trace_queue_setup;
+       __rte_eventdev_trace_port_setup;
+       __rte_eventdev_trace_port_link;
+       __rte_eventdev_trace_port_unlink;
+       __rte_eventdev_trace_start;
+       __rte_eventdev_trace_stop;
+       __rte_eventdev_trace_close;
+       __rte_eventdev_trace_deq_burst;
+       __rte_eventdev_trace_enq_burst;
+       __rte_eventdev_trace_eth_rx_adapter_create;
+       __rte_eventdev_trace_eth_rx_adapter_free;
+       __rte_eventdev_trace_eth_rx_adapter_queue_add;
+       __rte_eventdev_trace_eth_rx_adapter_queue_del;
+       __rte_eventdev_trace_eth_rx_adapter_start;
+       __rte_eventdev_trace_eth_rx_adapter_stop;
+       __rte_eventdev_trace_eth_tx_adapter_create;
+       __rte_eventdev_trace_eth_tx_adapter_free;
+       __rte_eventdev_trace_eth_tx_adapter_queue_add;
+       __rte_eventdev_trace_eth_tx_adapter_queue_del;
+       __rte_eventdev_trace_eth_tx_adapter_start;
+       __rte_eventdev_trace_eth_tx_adapter_stop;
+       __rte_eventdev_trace_eth_tx_adapter_enqueue;
+       __rte_eventdev_trace_timer_adapter_create;
+       __rte_eventdev_trace_timer_adapter_start;
+       __rte_eventdev_trace_timer_adapter_stop;
+       __rte_eventdev_trace_timer_adapter_free;
+       __rte_eventdev_trace_timer_arm_burst;
+       __rte_eventdev_trace_timer_arm_tmo_tick_burst;
+       __rte_eventdev_trace_timer_cancel_burst;
+       __rte_eventdev_trace_crypto_adapter_create;
+       __rte_eventdev_trace_crypto_adapter_free;
+       __rte_eventdev_trace_crypto_adapter_queue_pair_add;
+       __rte_eventdev_trace_crypto_adapter_queue_pair_del;
+       __rte_eventdev_trace_crypto_adapter_start;
+       __rte_eventdev_trace_crypto_adapter_stop;
+};