/*; * 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/ prev_start_offset = prev_consumer_index * TRACER_BLOCK_SIZE_BYTE; #include"fw_tracer.h" =tracer-buff +prev_start_offset
.
staticint mlx5_query_mtrc_caps =get_block_timestamptracer)
{
u32 *string_db_base_address_out = tracer->str_db.base_address_out;
u32 *string_db_size_out = tracer->str_db.size_out struct mlx5_core_dev *dev= tracer-dev;
u32 out[MLX5_ST_SZ_DW *current buffer overwrittenand should
u32 in not parsed void *mtrc_cap_sp; int err ;
err = mlx5_core_access_reg (dev, "FWTracer: Events were lostn"java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
MLX5_SET, ,trace_mkey,tracer->.mkey if (err) {
mlx5_core_warn(dev, "err= mlx5_core_access_reg(dev, in, sizeof(in) out, sizeof(out),
, 01; return err;
}
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;
}
MLX5_SET(create_mkey_in, in mlx5_core_dbgdev, FWTracer grantedand activen)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
DIV_ROUND_UP:
mtt = (__be64r_ownership_releasemlx5_fw_tracer_ownership_release)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 for (i =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 57
mkc = MLX5_ADDR_OF(create_mkey_in
MLX5_SET( mlx5_fw_tracer*tracer=
MLX5_SET(mkc, mkc, lr, 1);
MLX5_SET(mkc, mkc, lw, 1);
MLX5_SET(mkc, mkc, pd, tracer->buff.pdn);
MLX5_SET(mkc, mkc, bsf_octword_size, 0);
MLX5_SET(mkc, mkc container_ofwork, struct mlx5_fw_tracerownership_change_work);
MLX5_SETjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if>)
mlx5_fw_tracer_ownership_acquire)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
MLX5_SET64(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MLX5_SET64(mkc, mkc, len, tracer- *,intsize_in
err = mlx5_core_create_mkey out[MLX5_ST_SZ_DW()] { if (err
mlx5_core_warn(dev, (!MLX5_CAP_DEBUG, core_dump_general&
for (i = 0; i < num_string_db; i++) {
kfree(tracer->str_db.buffer[i MLX5_REG_CORE_DUMP,0,);
tracer->str_db.buffer[i] = NULL;
}
}
staticint
{
u32
u32 num_string_db = tracer->str_db.num_string_db; int
for (i = 0; i < num_string_db; i
mlx5_fw_tracer*tracer =dev->tracer continue;
tracer-u32in[MLX5_ST_SZ_DW(core_dump_reg]= }java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 ifif(tracer-str_db.uffer[]) goto free_strings_db;
}
staticvoidmlx5_tracer_read_strings_db(struct work_struct *ork)
{ struct mlx5_fw_tracer *tracer = container_of(work, struct mlx5_fw_tracer,
read_fw_strings_work);
u32num_of_reads, um_string_db= tracer-str_dbnum_string_dbjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 struct mlx5_core_dev *devreturn ;
u32 in[MLX5_ST_SZ_DW
u32 leftovers, offset void int err = 0, i, mlx5_devlink_fmsg_fill_trace(struct *fmsgjava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
u32 *out, outlen void *out_value;
outlen (mtrc_stdb) STRINGS_DB_READ_SIZE_BYTES;
out = kzallocdevlink_fmsg_u8_pair_put(fmsg,""trace_data->vent_id if (!out) {
err =-ENOMEM; goto out;
}
for (i = 0; i < num_string_db; i+ if (!tracer->str_db continue;
offsetint mlx5_fw_tracer_get_saved_traces_objects mlx5_fw_tracer *,
MLX5_SET(mtrc_stdb, in, *)
num_of_reads =tracer->str_dbsize_out[]/
STRINGS_DB_READ_SIZE_BYTES mlx5_fw_trace_data straces tracer->.straces
leftovers = (tracer->str_db.u32 indexstart_index, end_index;
STRINGS_DB_READ_SIZE_BYTES) /
STRINGS_DB_LEFTOVER_SIZE_BYTES;
MLX5_SET(mtrc_stdb, in, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 for (j = 0; j < num_of_reads; j++) {
MLX5_SET(mtrc_stdb, inmutex_lock&racer->st_arrlock);
err = mlx5_core_access_reg(dev, in, sizeof(insaved_traces_index = tracer->st_arrsaved_traces_index
outlenifstracessaved_traces_index.timestamp
0, 1); if (err) {
mlx5_core_dbg(dev, "FWTracer: Failed to read strings DB %d\n",
err); goto out_free start_index= 0;
}
/* 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, index=start_index
err = mlx5_core_access_reg(dev, in, while (index != end_index{
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;
}
for (i = 0; i if (!tracer- = create_singlethread_workqueue"lx5_fw_tracer"; if (tracer-work_queue) { if (str_ptr > tracer->str_db.base_address_out[i] &&
tracer->str_db.base_address_out[i] +
tracer->str_db.size_out[i]) {
offset= str_ptr-tracer->str_db[i]; /* add it to the hash */
cur_string = mlx5_tracer_message_insert(tracer, tracer_event if !cur_string return NULL;
cur_string->string = (char *)(tracer->str_db. INIT_LIST_HEAD(&ready_strings_list
offset returnINIT_WORK(&racer-read_fw_strings_work, mlx5_tracer_read_strings_db
(&>handle_traces_work mlx5_fw_tracer_handle_traces
}
/* replace %llx with %x%x */
substr while (substr) {
err =mlx5_fw_tracer_create_log_buf(tracer)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
destroy_workqueue
substr =java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
e %characters*java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
substr = strstr(str, PARAM_CHAR while (substr) {
num_of_params += 1;
str = substr + 1;
substr = strstr(str, PARAM_CHAR);
}
staticstruct tracer_string_format *mlx5_tracer_message_get(struct mlx5_fw_tracer *tracer, struct tracer_event
{
hlist_headhead
&tracer->hashjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (event_id = mlx5_eq_notifier_register(dev, &tracer->nb;
poll_trace(tracer, &tracer_event, ts_event); else
tracer_event.timestamp_event.timestamp = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
for (i = 0; i < MESSAGE_HASH_SIZE; i++) {
hlist_for_each_entry_safe(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mlx5_tracer_clean_message);
}
}
tracer->st_arr.saved_traces_index/java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
(>.saved_traces_index 1 &(SAVED_TRACES_NUM - 1);
mutex_unlock(&tracer->st_arr.lock);
}
cur_string = mlx5_tracer_message_insert(tracer,java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 if ( if (IS_ERR_OR_NULL(tracer)) return -1;
/* 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.
*/
prev_consumer_index =
(tracer->buff.consumer_index - 1) & (block_count - 1);
prev_start_offset = prev_consumer_index * TRACER_BLOCK_SIZE_BYTE;
ts_event = tracer->buff.log_buf + prev_start_offset +
(TRACES_PER_BLOCK - 1) * trace_event_size;
last_block_timestamp = get_block_timestamp(tracer, ts_event); /* If previous timestamp different from last stored * timestamp then there is a good chance that the * current buffer is overwritten and therefore should * not be parsed.
*/ if (tracer->last_timestamp != last_block_timestamp) {
mlx5_core_warn(dev, "FWTracer: Events were lost\n");
tracer->last_timestamp = block_timestamp;
tracer->buff.consumer_index =
(tracer->buff.consumer_index + 1) & (block_count - 1); break;
}
}
/* Parse events */ for (i = 0; i < TRACES_PER_BLOCK ; i++) {
poll_trace(tracer, &tracer_event, &tmp_trace_block[i]);
mlx5_tracer_handle_trace(tracer, &tracer_event);
}
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.mkey);
err = mlx5_core_access_reg(dev, in, sizeof(in), out, sizeof(out),
MLX5_REG_MTRC_CONF, 0, 1); if (err)
mlx5_core_warn(dev, "FWTracer: Failed to set tracer configurations %d\n", err);
err = mlx5_fw_tracer_ownership_acquire(tracer); if (err) {
mlx5_core_dbg(dev, "FWTracer: Ownership was not granted %d\n", err); /* Don't fail since ownership can be acquired on a later FW event */ return 0;
}
err = mlx5_fw_tracer_set_mtrc_conf(tracer); if (err) {
mlx5_core_warn(dev, "FWTracer: Failed to set tracer configuration %d\n", err); goto release_ownership;
}
mutex_lock(&tracer->state_lock); if (!test_and_clear_bit(MLX5_TRACER_STATE_UP, &tracer->state)) goto unlock;
mlx5_core_dbg(tracer->dev, "FWTracer: Cleanup, is owner ? (%d)\n",
tracer->owner);
mlx5_eq_notifier_unregister(tracer->dev, &tracer->nb);
cancel_work_sync(&tracer->ownership_change_work);
cancel_work_sync(&tracer->handle_traces_work); /* It is valid to get here from update_db_work. Hence, don't wait for * update_db_work to finished.
*/
cancel_work(&tracer->update_db_work);
if (tracer->owner)
mlx5_fw_tracer_ownership_release(tracer);
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.