-
Notifications
You must be signed in to change notification settings - Fork 654
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial support for MLX5 LTTng tracing using compiled out macros if LTTng flag isn't provided. Signed-off-by: zhenwei pi <[email protected]>
- Loading branch information
Showing
4 changed files
with
93 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */ | ||
/* | ||
* Copyright 2023 Bytedance.com, Inc. or its affiliates. All rights reserved. | ||
*/ | ||
|
||
#define LTTNG_UST_TRACEPOINT_CREATE_PROBES | ||
#define LTTNG_UST_TRACEPOINT_DEFINE | ||
|
||
#include "mlx5_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */ | ||
/* | ||
* Copyright 2023 Bytedance.com, Inc. or its affiliates. All rights reserved. | ||
*/ | ||
|
||
#if defined(LTTNG_ENABLED) | ||
|
||
#undef LTTNG_UST_TRACEPOINT_PROVIDER | ||
#define LTTNG_UST_TRACEPOINT_PROVIDER rdma_core_mlx5 | ||
|
||
#undef LTTNG_UST_TRACEPOINT_INCLUDE | ||
#define LTTNG_UST_TRACEPOINT_INCLUDE "mlx5_trace.h" | ||
|
||
#if !defined(__MLX5_TRACE_H__) || defined(LTTNG_UST_TRACEPOINT_HEADER_MULTI_READ) | ||
#define __MLX5_TRACE_H__ | ||
|
||
#include <lttng/tracepoint.h> | ||
#include <infiniband/verbs.h> | ||
|
||
LTTNG_UST_TRACEPOINT_EVENT( | ||
/* Tracepoint provider name */ | ||
rdma_core_mlx5, | ||
|
||
/* Tracepoint name */ | ||
post_send, | ||
|
||
/* Input arguments */ | ||
LTTNG_UST_TP_ARGS( | ||
char *, dev, | ||
uint32_t, src_qp_num, | ||
char *, opcode, | ||
uint32_t, bytes | ||
), | ||
|
||
/* Output event fields */ | ||
LTTNG_UST_TP_FIELDS( | ||
lttng_ust_field_string(dev, dev) | ||
lttng_ust_field_integer(uint32_t, src_qp_num, src_qp_num) | ||
lttng_ust_field_string(opcode, opcode) | ||
lttng_ust_field_integer(uint32_t, bytes, bytes) | ||
) | ||
) | ||
|
||
#define rdma_tracepoint(arg...) lttng_ust_tracepoint(arg) | ||
|
||
#endif /* __MLX5_TRACE_H__*/ | ||
|
||
#include <lttng/tracepoint-event.h> | ||
|
||
#else | ||
|
||
#ifndef __MLX5_TRACE_H__ | ||
#define __MLX5_TRACE_H__ | ||
|
||
#define MLX5_TP_rdma_core_mlx5 "" | ||
#define MLX5_TP_post_send "" | ||
static inline void dummy_tracepoint(const char *p, const char *n, ...) {}; | ||
|
||
#define rdma_tracepoint(P, N, arg...) \ | ||
dummy_tracepoint(MLX5_TP_##P, MLX5_TP_##N, arg) | ||
|
||
#endif /* __MLX5_TRACE_H__*/ | ||
|
||
#endif /* defined(LTTNG_ENABLED) */ |
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