linux/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.h

/*
 * Copyright (c) 2018, Mellanox Technologies. All rights reserved.
 *
 * This software is available to you under a choice of one of two
 * licenses.  You may choose to be licensed under the terms of the GNU
 * General Public License (GPL) Version 2, available from the file
 * COPYING in the main directory of this source tree, or the
 * OpenIB.org BSD license below:
 *
 *     Redistribution and use in source and binary forms, with or
 *     without modification, are permitted provided that the following
 *     conditions are met:
 *
 *      - Redistributions of source code must retain the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer.
 *
 *      - Redistributions in binary form must reproduce the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer in the documentation and/or other materials
 *        provided with the distribution.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#ifndef __LIB_TRACER_H__
#define __LIB_TRACER_H__

#include <linux/mlx5/driver.h>
#include "mlx5_core.h"

#define STRINGS_DB_SECTIONS_NUM
#define STRINGS_DB_READ_SIZE_BYTES
#define STRINGS_DB_LEFTOVER_SIZE_BYTES
#define TRACER_BUFFER_PAGE_NUM
#define TRACER_BUFFER_CHUNK
#define TRACE_BUFFER_SIZE_BYTE

#define TRACER_BLOCK_SIZE_BYTE
#define TRACES_PER_BLOCK

#define TRACE_STR_MSG
#define SAVED_TRACES_NUM

#define TRACER_MAX_PARAMS
#define MESSAGE_HASH_BITS
#define MESSAGE_HASH_SIZE

#define MASK_52_7
#define MASK_6_0

struct mlx5_fw_trace_data {};

enum mlx5_fw_tracer_state {};

struct mlx5_fw_tracer {};

struct tracer_string_format {};

enum mlx5_fw_tracer_ownership_state {};

enum tracer_ctrl_fields_select {};

enum tracer_event_type {};

enum tracing_mode {};

struct tracer_timestamp_event {};

struct tracer_string_event {};

struct tracer_event {};

struct mlx5_ifc_tracer_event_bits {};

struct mlx5_ifc_tracer_string_event_bits {};

struct mlx5_ifc_tracer_timestamp_event_bits {};

struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev);
int mlx5_fw_tracer_init(struct mlx5_fw_tracer *tracer);
void mlx5_fw_tracer_cleanup(struct mlx5_fw_tracer *tracer);
void mlx5_fw_tracer_destroy(struct mlx5_fw_tracer *tracer);
int mlx5_fw_tracer_trigger_core_dump_general(struct mlx5_core_dev *dev);
int mlx5_fw_tracer_get_saved_traces_objects(struct mlx5_fw_tracer *tracer,
					    struct devlink_fmsg *fmsg);
int mlx5_fw_tracer_reload(struct mlx5_fw_tracer *tracer);

#endif