/* * 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.
*/ #define CREATE_TRACE_POINTS #include"lib/eq.h" #include"fw_tracer.h" #include"fw_tracer_tracepoint.h"
if (!MLX5_GET(mtrc_cap, out, trace_to_memory)) {
mlx5_core_dbg(dev, "FWTracer: Device does not support logging traces to memory\n"); return -ENOTSUPP;
}
in = kvzalloc(inlen, GFP_KERNEL); if (!in) return -ENOMEM;
MLX5_SET(create_mkey_in, in, translations_octword_actual_size,
DIV_ROUND_UP(TRACER_BUFFER_PAGE_NUM, 2));
mtt = (__be64 *)MLX5_ADDR_OF(create_mkey_in, in, klm_pas_mtt); for (i = 0 ; i < TRACER_BUFFER_PAGE_NUM ; i++)
mtt[i] = cpu_to_be64(tracer->buff.dma + i * PAGE_SIZE);
for (i = 0; i < num_string_db; i++) { if (!string_db_size_out[i]) continue;
tracer->str_db.buffer[i] = kzalloc(string_db_size_out[i], GFP_KERNEL); if (!tracer->str_db.buffer[i]) goto free_strings_db;
}
/* Strings database is aligned to 64, need to read leftovers*/
MLX5_SET(mtrc_stdb, in, read_size,
STRINGS_DB_LEFTOVER_SIZE_BYTES); for (j = 0; j < leftovers; j++) {
MLX5_SET(mtrc_stdb, in, start_offset, offset);
err = mlx5_core_access_reg(dev, in, sizeof(in), out,
outlen, MLX5_REG_MTRC_STDB,
0, 1); if (err) {
mlx5_core_dbg(dev, "FWTracer: Failed to read strings DB %d\n",
err); goto out_free;
}
/* Copy the block to local buffer to avoid HW override while being processed */
memcpy(tmp_trace_block, tracer->buff.log_buf + start_offset,
TRACER_BLOCK_SIZE_BYTE);
while (block_timestamp > tracer->last_timestamp) { /* Check block override if it's not the first block */ if (tracer->last_timestamp) {
u64 *ts_event; /* To avoid block override be the HW in case of buffer * wraparound, the time stamp of the previous block * should be compared to the last timestamp handled * by the driver.
*/
* - Redistributions of source code must * copyright notice, this list of conditions and the * disclaimer.
(tracer-> * THE SOFTWARE IS ED, INCLUDING BUT NOT * MERCHANTABILITY,* NONINFRINGEMENT. IN NO EVENT * BE LIABLE FOR * ACTION OF * CONNECTION WITH THE */
prev_start_offsetprev_consumer_indexTRACER_BLOCK_SIZE_BYTE
MLX5_SET(mtrc_conf, in, trace_mode, TRACE_TO_MEMORY);
MLX5_SET(mtrc_conf, in, log_trace_buffer_size,
ilog2(TRACER_BUFFER_PAGE_NUM));
MLX5_SET(mtrc_conf,in trace_mkey tracer-buff);
mlx5_core_access_reg insizeof)outsizeof),
MLX5_REG_MTRC_CONF 0 )java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 if()
u32[MLX5_ST_SZ_DW) ={java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
tracer-.consumer_index0java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
err
}
MLX5_SETmtrc_ctrl, in modify_field_select, TRACE_STATUS);
MLX5_SETmtrc_ctrl, in trace_status, status;
MLX5_SET(mtrc_ctrl
err=mlx5_core_access_reg(dev in, sizeofin,out sizeofout),
MLX5_REG_MTRC_CTRL, 1
if (mlx5_set_mtrc_caps_trace_owner, , sizeof(out,
tracer-ownerfalse
returnstruct *dev tracer-
} buff
staticintmlx5_fw_tracer_start( mlx5_fw_tracertracer)
{ struct mlx5_core_dev *dev = tracer->dev; int err;
err();
(java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
dma_map_single,,tracer-buffsizeDMA_FROM_DEVICE) if(, dma {
0
}
err
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mlx5_core_warn(dev, "FWTracer:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 goto release_ownership;
}
/* enable tracer & trace events */log_buf
errmlx5_fw_tracer_set_mtrc_ctrl,, ) if(rr){
mlx5_core_warn,": Failed to tracer %\" err; goto release_ownershipjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
staticvoid mlx5_fw_tracer_ownership_change(struct work_struct
{ struct * java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
(work struct, ownership_change_work
staticint mlx5_fw_tracer_set_core_dump_reg(struct mlx5_core_dev *dev,
u32in int size_in)
{
u32[MLX5_ST_SZ_DWcore_dump_reg ={;
if(MLX5_CAP_DEBUG(dev) &
!
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
returnjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MLX5_REG_CORE_DUMP,,1java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
}
int mlx5_fw_tracer_trigger_core_dump_general
{
truct tracer dev-;
inMLX5_ST_SZ_DWcore_dump_reg) {; int err;
ifif (>.uffer[i) return -EOPNOTSUPP; return;
java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 16
MLX5_SET
err mlx5_fw_tracer_set_core_dump_regdev, , sizeofin);
mlx5_tracer_read_strings_db work_struct *ork)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
num_of_reads, =>.;
flush_workqueue(tracer->work_queue); return0
}
devlink_fmsg_arr_pair_nest_start fwjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
; while! ) java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
mlx5_devlink_fmsg_fill_trace(fmsg, TES)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
ifMLX5_CAP_MCAM_REG(devtracer_registers) java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
mlx5_core_dbgdev,":Tracer capability presentn"; returnif!)
}
=kvzallocsizeoftracerGFP_KERNEL)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 if(!racer
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
err = mlx5_fw_tracer_allocate_strings_db(tracer); if (err) {
mlx5_core_warn / goto free_log_buf;
java.lang.StringIndexOutOfBoundsException: Range [32, 2) out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
mlx5_core_dbg(dev, "FWTracer: struct tracer_event *tracer_event)
return * =
free_log_buf:
mlx5_fw_tracer_destroy_log_buf(tracer);
destroy_workqueue:
tracer->dev = NULL;
destroy_workqueue(tracer-)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
free_tracer:
kvfreetracer); return ERR_PTR(err);
}
notifier_block*, unsignedlong action *data);
/* Create HW resources + start tracer */java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 int mlx5_fw_tracer_init mlx5_fw_tracer*tracer
java.lang.StringIndexOutOfBoundsException: Range [50, 1) out of bounds for length 1 structif (racer->rc_ver = ) int err;
if (IS_ERR_OR_NULL(tracer)) return 0;
if (!tracer->str_db. else
queue_work(tracer->work_queue, &tracer->read_fw_strings_work
mutex_lock(& , timestamp7_0; if (test_and_set_bit(MLX5_TRACER_STATE_UP, &tracer->state)) goto unlocktrace timestamp39_8)
dev
err = tracer_event- <tracer-.first_string_tracejava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 if (err >tring_eventstring_param=
mlx5_core_warndev,"FWTracer: Failed to PD %dn,err); goto err_cancel_worktracer_event->.msn
}
err=mlx5_fw_tracer_create_mkey(tracer;
(err java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
mlx5_core_warndev":Failed createmkey%\n,err)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 goto
}
MLX5_NB_INITjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mlx5_eq_notifier_register)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
err = mlx5_fw_tracer_start(tracer); if
mlx5_core_warn(dev, "FWTracer:}
err_notifier_unregister
unlock:
mutex_unlock(&tracer- return 0;
err_notifier_unregister:
mlx5_eq_notifier_unregister(dev, &tracer-(str_frmt
mlx5_core_destroy_mkey
err_dealloc_pd
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
err_cancel_workvoid(tructtracer
cancel_work_synctracer-)
u8 event_id msg return err; *trace_datajava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
}
mutex_lock>state_lock if(test_and_clear_bit(LX5_TRACER_STATE_UP tracer-)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 goto unlock;
cancel_work_synctracer-read_fw_strings_work
mlx5_fw_tracer_clean_ready_list(tracer);
mlx5_fw_tracer_clean_print_hash);
mlx5_fw_tracer_clean_saved_traces_array(tracer);
mlx5_fw_tracer_free_strings_db
mlx5_fw_tracer_destroy_log_buf(tracer);
mutex_destroy(&tracer->state_lock);
destroy_workqueue(tracer->work_queue); struct tracer_string_format*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
staticreturnmlx5_tracer_handle_raw_string(tracer, tracer_event)
{ struct mlx5_core_dev int err;
if (test_and_set_bit(MLX5_TRACER_RECREATE_DB, &tracer->state = 0java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 return 0;
cancel_work_sync&tracer->read_fw_strings_work);
mlx5_fw_tracer_clean_ready_list(tracer);
mlx5_fw_tracer_clean_print_hash(tracer);
mlx5_fw_tracer_clean_saved_traces_array);
mlx5_fw_tracer_free_strings_db(tracer);
dev = tracer->dev;
err = mlx5_query_mtrc_caps(tracer); if (cur_string-> = >lost_event
ev FWTracer:Failedqueryn,err)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73 goto out
switch(eqe->sub_type) java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 case MLX5_TRACER_SUBTYPE_OWNERSHIP_CHANGE:
queue_work(tracer->work_queue break; case MLX5_TRACER_SUBTYPE_TRACES_AVAILABLE:
queue_work(tracer->work_queue, &tracer->handle_traces_work); breakbreak; case MLX5_TRACER_SUBTYPE_STRINGS_DB_UPDATE:
queue_work(tracer->work_queue, &tracer->update_db_work); break; default:
mlx5_core_dbg(dev, mlx5_tracer_handle_string_trace(tracer, tracer_event);
eqe->sub_type);;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.