Improve submission logging

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2022-02-11 16:28:08 +00:00
committed by Compute-Runtime-Automation
parent dec634c2cd
commit 6a111e41ff
5 changed files with 18 additions and 4 deletions

View File

@ -21,6 +21,7 @@
#include "shared/source/os_interface/linux/os_context_linux.h"
#include "shared/source/os_interface/os_context.h"
#include "shared/source/os_interface/os_interface.h"
#include "shared/source/os_interface/sys_calls_common.h"
#include "shared/test/common/cmd_parse/hw_parse.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/dispatch_flags_helper.h"
@ -203,7 +204,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenPrintIndicesEnabledWhenFlushThenPr
const std::string engineType = EngineHelpers::engineTypeToString(csr->getOsContext().getEngineType());
const std::string engineUsage = EngineHelpers::engineUsageToString(csr->getOsContext().getEngineUsage());
std::ostringstream expectedValue;
expectedValue << "Submission to RootDevice Index: " << csr->getRootDeviceIndex()
expectedValue << SysCalls::getProcessId() << ": Submission to RootDevice Index: " << csr->getRootDeviceIndex()
<< ", Sub-Devices Mask: " << csr->getOsContext().getDeviceBitfield().to_ulong()
<< ", EngineId: " << csr->getOsContext().getEngineType()
<< " (" << engineType << ", " << engineUsage << ")\n";

View File

@ -18,6 +18,7 @@
#include "shared/source/memory_manager/internal_allocation_storage.h"
#include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/os_interface/os_interface.h"
#include "shared/source/os_interface/sys_calls_common.h"
#include "shared/source/os_interface/windows/os_context_win.h"
#include "shared/source/os_interface/windows/wddm_device_command_stream.h"
#include "shared/source/os_interface/windows/wddm_memory_manager.h"
@ -247,10 +248,14 @@ TEST_F(WddmCommandStreamTest, givenPrintIndicesEnabledWhenFlushThenPrintIndices)
const std::string engineType = EngineHelpers::engineTypeToString(csr->getOsContext().getEngineType());
const std::string engineUsage = EngineHelpers::engineUsageToString(csr->getOsContext().getEngineUsage());
std::ostringstream expectedValue;
expectedValue << "Submission to RootDevice Index: " << csr->getRootDeviceIndex()
expectedValue << SysCalls::getProcessId() << ": Submission to RootDevice Index: " << csr->getRootDeviceIndex()
<< ", Sub-Devices Mask: " << csr->getOsContext().getDeviceBitfield().to_ulong()
<< ", EngineId: " << csr->getOsContext().getEngineType()
<< " (" << engineType << ", " << engineUsage << ")\n";
auto osContextWin = static_cast<OsContextWin *>(&csr->getOsContext());
expectedValue << SysCalls::getProcessId() << ": Wddm Submission with context handle " << osContextWin->getWddmContextHandle() << " and HwQueue handle " << osContextWin->getHwQueue().handle << "\n";
EXPECT_STREQ(::testing::internal::GetCapturedStdout().c_str(), expectedValue.str().c_str());
memoryManager->freeGraphicsMemory(commandBuffer);

View File

@ -30,6 +30,7 @@
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/os_interface/os_context.h"
#include "shared/source/os_interface/os_interface.h"
#include "shared/source/os_interface/sys_calls_common.h"
#include "shared/source/utilities/cpuintrinsics.h"
#include "shared/source/utilities/tag_allocator.h"
#include "shared/source/utilities/wait_util.h"
@ -757,7 +758,8 @@ bool CommandStreamReceiver::needsPageTableManager() const {
void CommandStreamReceiver::printDeviceIndex() {
if (DebugManager.flags.PrintDeviceAndEngineIdOnSubmission.get()) {
printf("Submission to RootDevice Index: %u, Sub-Devices Mask: %lu, EngineId: %u (%s, %s)\n",
printf("%u: Submission to RootDevice Index: %u, Sub-Devices Mask: %lu, EngineId: %u (%s, %s)\n",
SysCalls::getProcessId(),
this->getRootDeviceIndex(),
this->osContext->getDeviceBitfield().to_ulong(),
this->osContext->getEngineType(),

View File

@ -8,6 +8,7 @@
#include "shared/source/os_interface/linux/drm_allocation.h"
#include "shared/source/os_interface/linux/drm_command_stream.h"
#include "shared/source/os_interface/linux/os_context_linux.h"
#include "shared/source/os_interface/sys_calls_common.h"
namespace NEO {
@ -29,7 +30,7 @@ int DrmCommandStreamReceiver<GfxFamily>::flushInternal(const BatchBuffer &batchB
this->processResidency(allocationsForResidency, tileIterator);
if (DebugManager.flags.PrintDeviceAndEngineIdOnSubmission.get()) {
printf("Drm Submission of contextIndex: %u, with context id %u\n", contextIndex, drmContextIds[contextIndex]);
printf("%u: Drm Submission of contextIndex: %u, with context id %u\n", SysCalls::getProcessId(), contextIndex, drmContextIds[contextIndex]);
}
int ret = this->exec(batchBuffer, tileIterator, drmContextIds[contextIndex], contextIndex);

View File

@ -22,6 +22,7 @@
#include "shared/source/helpers/string.h"
#include "shared/source/helpers/windows/gmm_callbacks.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/os_interface/sys_calls_common.h"
#include "shared/source/os_interface/windows/driver_info_windows.h"
#include "shared/source/os_interface/windows/dxcore_wrapper.h"
#include "shared/source/os_interface/windows/gdi_interface.h"
@ -856,6 +857,10 @@ bool Wddm::submit(uint64_t commandBuffer, size_t size, void *commandHeader, Wddm
}
DBG_LOG(ResidencyDebugEnable, "Residency:", __FUNCTION__, "currentFenceValue =", submitArguments.monitorFence->currentFenceValue);
if (DebugManager.flags.PrintDeviceAndEngineIdOnSubmission.get()) {
printf("%u: Wddm Submission with context handle %u and HwQueue handle %u\n", SysCalls::getProcessId(), submitArguments.contextHandle, submitArguments.hwQueueHandle);
}
status = wddmInterface->submit(commandBuffer, size, commandHeader, submitArguments);
if (status) {
submitArguments.monitorFence->lastSubmittedFence = submitArguments.monitorFence->currentFenceValue;