-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net/mlx5: SF_DEV Add SF device trace points
Add SF device add and delete specific trace points. echo mlx5:mlx5_sf_dev_add >> /sys/kernel/debug/tracing/set_event echo mlx5:mlx5_sf_dev_del >> /sys/kernel/debug/tracing/set_event echo mlx5:mlx5_sf_vhca_event >> /sys/kernel/debug/tracing/set_event Signed-off-by: Parav Pandit <parav@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
- Loading branch information
Parav Pandit
authored and
Saeed Mahameed
committed
Oct 25, 2021
1 parent
b3ccada
commit d67ab0a
Showing
6 changed files
with
140 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
drivers/net/ethernet/mellanox/mlx5/core/sf/dev/diag/dev_tracepoint.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ | ||
/* Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ | ||
|
||
#undef TRACE_SYSTEM | ||
#define TRACE_SYSTEM mlx5 | ||
|
||
#if !defined(_MLX5_SF_DEV_TP_) || defined(TRACE_HEADER_MULTI_READ) | ||
#define _MLX5_SF_DEV_TP_ | ||
|
||
#include <linux/tracepoint.h> | ||
#include <linux/mlx5/driver.h> | ||
#include "../../dev/dev.h" | ||
|
||
DECLARE_EVENT_CLASS(mlx5_sf_dev_template, | ||
TP_PROTO(const struct mlx5_core_dev *dev, | ||
const struct mlx5_sf_dev *sfdev, | ||
int aux_id), | ||
TP_ARGS(dev, sfdev, aux_id), | ||
TP_STRUCT__entry(__string(devname, dev_name(dev->device)) | ||
__field(const struct mlx5_sf_dev*, sfdev) | ||
__field(int, aux_id) | ||
__field(u16, hw_fn_id) | ||
__field(u32, sfnum) | ||
), | ||
TP_fast_assign(__assign_str(devname, dev_name(dev->device)); | ||
__entry->sfdev = sfdev; | ||
__entry->aux_id = aux_id; | ||
__entry->hw_fn_id = sfdev->fn_id; | ||
__entry->sfnum = sfdev->sfnum; | ||
), | ||
TP_printk("(%s) sfdev=%pK aux_id=%d hw_id=0x%x sfnum=%u\n", | ||
__get_str(devname), __entry->sfdev, | ||
__entry->aux_id, __entry->hw_fn_id, | ||
__entry->sfnum) | ||
); | ||
|
||
DEFINE_EVENT(mlx5_sf_dev_template, mlx5_sf_dev_add, | ||
TP_PROTO(const struct mlx5_core_dev *dev, | ||
const struct mlx5_sf_dev *sfdev, | ||
int aux_id), | ||
TP_ARGS(dev, sfdev, aux_id) | ||
); | ||
|
||
DEFINE_EVENT(mlx5_sf_dev_template, mlx5_sf_dev_del, | ||
TP_PROTO(const struct mlx5_core_dev *dev, | ||
const struct mlx5_sf_dev *sfdev, | ||
int aux_id), | ||
TP_ARGS(dev, sfdev, aux_id) | ||
); | ||
|
||
#endif /* _MLX5_SF_DEV_TP_ */ | ||
|
||
/* This part must be outside protection */ | ||
#undef TRACE_INCLUDE_PATH | ||
#define TRACE_INCLUDE_PATH sf/dev/diag | ||
#undef TRACE_INCLUDE_FILE | ||
#define TRACE_INCLUDE_FILE dev_tracepoint | ||
#include <trace/define_trace.h> |
40 changes: 40 additions & 0 deletions
40
drivers/net/ethernet/mellanox/mlx5/core/sf/diag/vhca_tracepoint.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ | ||
/* Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ | ||
|
||
#undef TRACE_SYSTEM | ||
#define TRACE_SYSTEM mlx5 | ||
|
||
#if !defined(_MLX5_SF_VHCA_TP_) || defined(TRACE_HEADER_MULTI_READ) | ||
#define _MLX5_SF_VHCA_TP_ | ||
|
||
#include <linux/tracepoint.h> | ||
#include <linux/mlx5/driver.h> | ||
#include "sf/vhca_event.h" | ||
|
||
TRACE_EVENT(mlx5_sf_vhca_event, | ||
TP_PROTO(const struct mlx5_core_dev *dev, | ||
const struct mlx5_vhca_state_event *event), | ||
TP_ARGS(dev, event), | ||
TP_STRUCT__entry(__string(devname, dev_name(dev->device)) | ||
__field(u16, hw_fn_id) | ||
__field(u32, sfnum) | ||
__field(u8, vhca_state) | ||
), | ||
TP_fast_assign(__assign_str(devname, dev_name(dev->device)); | ||
__entry->hw_fn_id = event->function_id; | ||
__entry->sfnum = event->sw_function_id; | ||
__entry->vhca_state = event->new_vhca_state; | ||
), | ||
TP_printk("(%s) hw_id=0x%x sfnum=%u vhca_state=%d\n", | ||
__get_str(devname), __entry->hw_fn_id, | ||
__entry->sfnum, __entry->vhca_state) | ||
); | ||
|
||
#endif /* _MLX5_SF_VHCA_TP_ */ | ||
|
||
/* This part must be outside protection */ | ||
#undef TRACE_INCLUDE_PATH | ||
#define TRACE_INCLUDE_PATH sf/diag | ||
#undef TRACE_INCLUDE_FILE | ||
#define TRACE_INCLUDE_FILE vhca_tracepoint | ||
#include <trace/define_trace.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters