From 60451b590d042f46d63f9fb24291f35ab5b8afd1 Mon Sep 17 00:00:00 2001 From: Patryk Wrobel Date: Tue, 23 Aug 2022 15:50:33 +0000 Subject: [PATCH] Perform deep-copy of helper's name Signed-off-by: Patryk Wrobel --- opencl/test/unit_test/helpers/hw_helper_tests.cpp | 2 +- shared/source/aub_mem_dump/aub_mem_dump.h | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index 36370bb255..38aebf4229 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -193,7 +193,7 @@ TEST_F(HwHelperTest, givenEngineTypeRcsWhenCsTraitsAreQueiredThenCorrectNameInTr EXPECT_NE(nullptr, &helper); auto &csTraits = helper.getCsTraits(aub_stream::ENGINE_RCS); - EXPECT_STREQ("RCS", csTraits.name); + EXPECT_STREQ("RCS", csTraits.name.c_str()); } using isTglLpOrBelow = IsAtMostProduct; diff --git a/shared/source/aub_mem_dump/aub_mem_dump.h b/shared/source/aub_mem_dump/aub_mem_dump.h index 6cc13c9d9a..0bc19a52f8 100644 --- a/shared/source/aub_mem_dump/aub_mem_dump.h +++ b/shared/source/aub_mem_dump/aub_mem_dump.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -309,7 +309,7 @@ struct LrcaHelper { int aubHintCommandBuffer = DataTypeHintValues::TraceCommandBuffer; int aubHintBatchBuffer = DataTypeHintValues::TraceBatchBuffer; - const char *name = "XCS"; + std::string name = "XCS"; uint32_t mmioBase = 0; size_t sizeLRCA = 0x2000; @@ -400,8 +400,7 @@ struct LrcaHelperCcs : public LrcaHelper { struct LrcaHelperLinkBcs : public LrcaHelperBcs { LrcaHelperLinkBcs(uint32_t base, uint32_t engineId) : LrcaHelperBcs(base) { - std::string nameStr("BCS" + std::to_string(engineId)); - name = nameStr.c_str(); + name = "BCS" + std::to_string(engineId); } };