diff mbox series

[38/40] vdpa: add trace events for eval_flush

Message ID 1701970793-6865-39-git-send-email-si-wei.liu@oracle.com (mailing list archive)
State New, archived
Headers show
Series vdpa-net: improve migration downtime through descriptor ASID and persistent IOTLB | expand

Commit Message

Si-Wei Liu Dec. 7, 2023, 5:39 p.m. UTC
For better debuggability and observability.

Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
---
 net/trace-events | 2 ++
 net/vhost-vdpa.c | 7 +++++++
 2 files changed, 9 insertions(+)

Comments

Jason Wang Jan. 15, 2024, 3:57 a.m. UTC | #1
On Fri, Dec 8, 2023 at 2:51 AM Si-Wei Liu <si-wei.liu@oracle.com> wrote:
>
> For better debuggability and observability.
>
> Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
> ---
>  net/trace-events | 2 ++
>  net/vhost-vdpa.c | 7 +++++++
>  2 files changed, 9 insertions(+)
>
> diff --git a/net/trace-events b/net/trace-events
> index aab666a..d650c71 100644
> --- a/net/trace-events
> +++ b/net/trace-events
> @@ -26,3 +26,5 @@ colo_filter_rewriter_conn_offset(uint32_t offset) ": offset=%u"
>
>  # vhost-vdpa.c
>  vhost_vdpa_set_address_space_id(void *v, unsigned vq_group, unsigned asid_num) "vhost_vdpa: %p vq_group: %u asid: %u"
> +vhost_vdpa_net_data_eval_flush(void *s, int qindex, int svq_switch, bool svq_flush) "vhost_vdpa: %p qp: %d svq_switch: %d flush_map: %d"
> +vhost_vdpa_net_cvq_eval_flush(void *s, int qindex, int svq_switch, bool svq_flush) "vhost_vdpa: %p qp: %d svq_switch: %d flush_map: %d"
> diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
> index 84876b0..a0bd8cd 100644
> --- a/net/vhost-vdpa.c
> +++ b/net/vhost-vdpa.c
> @@ -608,6 +608,9 @@ static void vhost_vdpa_net_data_eval_flush(NetClientState *nc, bool stop)
>                 v->desc_group < 0) {
>          v->shared->flush_map = true;
>      }
> +    trace_vhost_vdpa_net_data_eval_flush(v, s->vhost_vdpa.index,
> +                                        v->shared->svq_switching,
> +                                        v->shared->flush_map);
>  }
>
>  static NetClientInfo net_vhost_vdpa_info = {
> @@ -1457,6 +1460,10 @@ static void vhost_vdpa_net_cvq_eval_flush(NetClientState *nc, bool stop)

For even better debuggability and observability.

Is it better to squash this into the patch into vhost_vdpa_net_cvq_eval_flush()?

Thanks

>          !s->cvq_isolated && v->desc_group < 0) {
>          v->shared->flush_map = true;
>      }
> +
> +    trace_vhost_vdpa_net_cvq_eval_flush(v, s->vhost_vdpa.index,
> +                                       v->shared->svq_switching,
> +                                       v->shared->flush_map);
>  }
>
>  static NetClientInfo net_vhost_vdpa_cvq_info = {
> --
> 1.8.3.1
>
diff mbox series

Patch

diff --git a/net/trace-events b/net/trace-events
index aab666a..d650c71 100644
--- a/net/trace-events
+++ b/net/trace-events
@@ -26,3 +26,5 @@  colo_filter_rewriter_conn_offset(uint32_t offset) ": offset=%u"
 
 # vhost-vdpa.c
 vhost_vdpa_set_address_space_id(void *v, unsigned vq_group, unsigned asid_num) "vhost_vdpa: %p vq_group: %u asid: %u"
+vhost_vdpa_net_data_eval_flush(void *s, int qindex, int svq_switch, bool svq_flush) "vhost_vdpa: %p qp: %d svq_switch: %d flush_map: %d"
+vhost_vdpa_net_cvq_eval_flush(void *s, int qindex, int svq_switch, bool svq_flush) "vhost_vdpa: %p qp: %d svq_switch: %d flush_map: %d"
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 84876b0..a0bd8cd 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -608,6 +608,9 @@  static void vhost_vdpa_net_data_eval_flush(NetClientState *nc, bool stop)
                v->desc_group < 0) {
         v->shared->flush_map = true;
     }
+    trace_vhost_vdpa_net_data_eval_flush(v, s->vhost_vdpa.index,
+                                        v->shared->svq_switching,
+                                        v->shared->flush_map);
 }
 
 static NetClientInfo net_vhost_vdpa_info = {
@@ -1457,6 +1460,10 @@  static void vhost_vdpa_net_cvq_eval_flush(NetClientState *nc, bool stop)
         !s->cvq_isolated && v->desc_group < 0) {
         v->shared->flush_map = true;
     }
+
+    trace_vhost_vdpa_net_cvq_eval_flush(v, s->vhost_vdpa.index,
+                                       v->shared->svq_switching,
+                                       v->shared->flush_map);
 }
 
 static NetClientInfo net_vhost_vdpa_cvq_info = {